Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 将dhtmlx甘特图链接到特定登录用户_Sql Server_Asp.net Mvc 5_Dhtmlx_Gantt Chart - Fatal编程技术网

Sql server 将dhtmlx甘特图链接到特定登录用户

Sql server 将dhtmlx甘特图链接到特定登录用户,sql-server,asp.net-mvc-5,dhtmlx,gantt-chart,Sql Server,Asp.net Mvc 5,Dhtmlx,Gantt Chart,因此,我正在使用asp.NETMVC开发一个进度跟踪web应用程序。因此,我需要让每个用户创建一个甘特图,并将其保存在数据库中。我正在使用DHTMLX甘特图库。 我的问题是如何让每个用户保存一个不同的甘特图,只需要帮助了解其背后的逻辑,或者通过查询为特定用户保存特定的甘特图。 我正在使用Visual Studio、ASP.NET MVC和SQL Server数据库。 多谢各位 myquery返回特定用户的甘特图: public ActionResult ViewPlan() {

因此,我正在使用asp.NETMVC开发一个进度跟踪web应用程序。因此,我需要让每个用户创建一个甘特图,并将其保存在数据库中。我正在使用DHTMLX甘特图库。 我的问题是如何让每个用户保存一个不同的甘特图,只需要帮助了解其背后的逻辑,或者通过查询为特定用户保存特定的甘特图。 我正在使用Visual Studio、ASP.NET MVC和SQL Server数据库。 多谢各位

myquery返回特定用户的甘特图:

public ActionResult ViewPlan()
    {
        using (var db = new ProgressTrackerEntities())
        {
            Milestone data = new Milestone();
            var userId = User.Identity.GetUserId();
            var result = from rowM in db.Milestones
                         join userrow in db.Students on rowM.StudentNumber equals userrow.StudentNumber
                         where userrow.StudentNumber == userId
                         select rowM;
            //return chart for that user not sure how to return chart

        }

        return View();
    }
图表的javascript代码:

<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<link href="https://cdn.dhtmlx.com/gantt/edge/dhtmlxgantt.css"
      rel="stylesheet" type="text/css" />
<script src="https://cdn.dhtmlx.com/gantt/edge/dhtmlxgantt.js"></script>
<script>
    document.addEventListener("DOMContentLoaded", function(event) {
        // specifying the date format
        gantt.config.xml_date = "%Y-%m-%d %H:%i";
        // initializing gantt
        gantt.init("gantt_here");

        // initiating data loading
        gantt.load("/api/data");
        // initializing dataProcessor
        var dp = new gantt.dataProcessor("/api/");
        // and attaching it to gantt
        dp.init(gantt);
        // setting the REST mode for dataProcessor
        dp.setTransactionMode("REST");
    });
</script> </head>   <div id="gantt_here" style="width: 100%; height: 100vh;"></div>
</body> </html>

指数
document.addEventListener(“DOMContentLoaded”),函数(事件){
//指定日期格式
gantt.config.xml_date=“%Y-%m-%d%H:%i”;
//初始化甘特图
gantt.init(“这里的gantt_”);
//启动数据加载
甘特图加载(“/api/data”);
//初始化数据处理器
var dp=新的甘特数据处理器(“/api/”);
//并将其附加到甘特图
dp.init(甘特图);
//设置dataProcessor的REST模式
dp.setTransactionMode(“REST”);
});

甘特图的外观:

您应该添加一个最简单的代码示例来解释您需要什么。我用一些代码更新了问题,让我知道您可能需要什么其他代码