Я получаю эту ошибку при попытке реализовать диаграмму Ганта на asp .net.
Я уже добавил свой метод, и он работает в режиме отладки, а также не предоставляет никакой информации.
Это мой код;Я использую хранимые процедуры и не могу использовать прямые запросы SQL из кода.
Я пытаюсь вызвать методы (SP) из базы данных, чтобы я мог выполнять операции CRUD. В настоящее время у меня есть это, но он не предоставляет никакой информации.
using DSProyectosTableAdapters;
using DSInformesProyectosTableAdapters;
using Syncfusion.JavaScript.DataVisualization.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.SqlClient;
using System.Linq;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class ListarClientesProyectoGantt : clsUsuario
{
protected int idPagina = 1;
protected string sConfSing = "Grafica Gantt";
protected string sConfPlu = "Graficas Gantt";
public int? Proyecto
{
get
{
int? id = null;
int idAux;
if (ViewState["idProyecto"] != null && ViewState["idProyecto"].ToString() != "" && int.TryParse(Request.QueryString["P"].ToString(), out idAux))
id = idAux;
else
{
if (Request.QueryString.HasKeys() && Request.QueryString["P"] != null && Request.QueryString["P"].ToString() != "" && int.TryParse(Request.QueryString["P"].ToString(), out idAux))
{
id = idAux;
this.Proyecto = id;
}
else if (Request.UrlReferrer != null)
{
if (Request.UrlReferrer.AbsolutePath != Request.Url.AbsolutePath && Request.UrlReferrer.Query != "")
{
Response.Redirect(string.Format("{0}{1}", Request.Url.AbsolutePath, Request.UrlReferrer.Query));
}
}
}
return id;
}
set
{
this.ViewState["idProyecto"] = value;
}
}
protected void Page_Init(object sender, EventArgs e)
{
try
{
if (!this.Proyecto.HasValue)
{
// Response.Redirect("~/PnlCliente/ListarClientesProyectoGantt.aspx");
}
}
catch (System.Threading.ThreadAbortException)
{
Response.End();
}
catch (Exception TrackViewState )
{
msj.MostrarMensaje(3, TrackViewState.Message, TrackViewState );
}
}
protected void Page_Load(object sender, EventArgs e)
{
try
{
msj.Visible = false;
var MasterP = (Layout2)this.Master;
MasterP.ConstruirMenu(idPagina, (int)Proyecto.Value, 4);
this.GanttControl.DataSource = GetGanttData();
this.GanttControl.DataBind();
}
catch (Exception TrackViewState)
{
msj.MostrarMensaje(2, TrackViewState.Message, TrackViewState);
}
}
public class ActividadesInfo
{
public string TaskId { get; set; }
public string TaskName { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public string ParentId { get; set; }
public string Duration { get; set; }
public string Progress { get; set; }
public string Predecessor { get; set; }
}
public List<ActividadesInfo> GetGanttData()
{
sp_GanttTableAdapter DatosTA = new sp_GanttTableAdapter();
DSProyectos.sp_GanttDataTable DatosT = DatosTA.GetDataIdProyecto(Proyecto);
List<ActividadesInfo> list = new List<ActividadesInfo>();
foreach (var DatosR in DatosT)
{
list.Add(new ActividadesInfo() { TaskId = DatosR.id.ToString(), ParentId =(DatosR.IsidPadreNull() ? 0 : DatosR.idPadre).ToString(), EndDate = DatosR.IsdFechaFNull() ? DateTime.Now : DatosR.dFechaF, StartDate = DatosR.IsdFechaINull() ? DateTime.Now : DatosR.dFechaI, Duration = "3", Predecessor = null, Progress = "100", TaskName = DatosR.sTitulo });
}
return list;
}
}
<%@ Page Language="C#" EnableEventValidation="false" MasterPageFile="~/PnlCliente/Layout2.master" AutoEventWireup="true" EnableTheming="false" CodeFile="ListarClientesProyectoGantt.aspx.cs" Inherits="ListarClientesProyectoGantt" %>
<asp:Content ID="Content3" ContentPlaceHolderID="cphFiltro" runat="Server">
<bit:mensajesv3 ID="msj" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphHead" runat="Server">
<link href="../App_Themes/samva/assets/syncfusion/Content/ejthemes/ej.widgets.core.min.css" rel="stylesheet" />
<link href="../App_Themes/samva/assets/syncfusion/Content/ejthemes/material/ej.theme.min.css" rel="stylesheet" />
<script src="../App_Themes/samva/assets/syncfusion/Scripts/ej/web/ej.web.all.min.js"></script>
<script src="../App_Themes/samva/assets/syncfusion/Scripts/jsviews.min.js"></script>
<script src="../App_Themes/samva/assets/syncfusion/Scripts/jsrender.min.js"></script>
<script src="../App_Themes/samva/assets/syncfusion/Scripts/jquery.easing-1.3.min.js"></script>
<script type="text/javascript">
function ActionComplete(args) {
if (args.requestType == "indent" || args.requestType == "outdent" || args.requestType == "recordUpdate" || (args.requestType === 'save' && args.modifiedRecord) || args.requestType == "drawConnectorLine") {
var ganttRec = [];
if (args.requestType == "save")
ganttRec.push(args.modifiedRecord);
else if (args.requestType == "drawConnectorLine")
ganttRec.push(args.currentRecord);
else
ganttRec.push(args.data);
if (args.updatedRecords && args.updatedRecords.length)
ganttRec = ganttRec.concat(args.updatedRecords);
updateModifiedGanttRecords(ganttRec);
}
else if (args.requestType == "save" && args.addedRecord) {
var data = args.addedRecord.item;
PageMethods.AddIt(data);
if (args.updatedRecords && args.updatedRecords.length)
updateModifiedGanttRecords(args.updatedRecords);
}
else if (args.requestType == "dragAndDrop") {
var ganttRec = [];
ganttRec.push(args.draggedRow);
if (args.updatedRecords && args.updatedRecords.length)
ganttRec = ganttRec.concat(args.updatedRecords);
updateModifiedGanttRecords(ganttRec);
}
else if (args.requestType == "delete") {
var data = args.data.item;
PageMethods.DeleteIt(data);
if (args.data.hasChildRecords) {
deleteChildRecords(args.data);
}
if (args.updatedRecords && args.updatedRecords.length)
updateModifiedGanttRecords(args.updatedRecords);
}
}
function updateModifiedGanttRecords(records) {
var modifiedRecord = [];
if (records && records.length) {
var length = records.length;
for (var i = 0; i < length; i++)
modifiedRecord.push(records[i].item);
}
PageMethods.UpdateIt(modifiedRecord);
}
function deleteChildRecords(record) {
var childRecords = record.childRecords,
length = childRecords.length,
count, currentRecord;
for (count = 0; count < length; count++) {
currentRecord = childRecords[count];
var data = currentRecord.item;
PageMethods.DeleteIt(data);
if (currentRecord.hasChildRecords) {
deleteChildRecords(currentRecord);
}
}
}
</script>
</asp:Content>
Это мой .aspx. Я не знаю, правильно ли я сопоставил все необходимые поля в своем файле aspx.
Будем весьма благодарны за любые предложения или помощь. Заранее спасибо.
<asp:Content ID="Content1" ContentPlaceHolderID="cphContenido" runat="Server">
<ej:Gantt ID="GanttControl" runat="server" AllowSelection="True" DateFormat="M/dd/yyyy"
TaskNameMapping="TaskName" StartDateMapping="StartDate" AllowDragAndDrop="true"
EndDateMapping="EndDate" ProgressMapping="Progress" ParentTaskIdMapping="ParentId" DurationMapping="Duration"
ScheduleStartDate="01/26/2019" ScheduleEndDate="03/20/2019" PredecessorMapping="Predecessor"
TreeColumnIndex="1" AllowGanttChartEditing="true" ActionComplete="ActionComplete" EnableContextMenu="true">
<dragtooltip showtooltip="true" />
<editsettings allowediting="true" allowadding="true" allowdeleting="true" allowindent="true" editmode="normal" rowposition="Child" />
</ej:Gantt>
</asp:Content>
Это линия, где происходит точка останова