Exemple #1
0
 void DayPilotGantt1_Command(object sender, DayPilot.Web.Ui.Events.Gantt.CommandEventArgs e)
 {
     if (e.Command == "goto")
     {
         DayPilotGantt1.StartDate = Convert.ToDateTime((string)e.Data);
         DayPilotGantt1.Days      = DateTime.DaysInMonth(DayPilotGantt1.StartDate.Year, DayPilotGantt1.StartDate.Month);
         LoadTasksAndLinks();
         DayPilotGantt1.UpdateWithMessage("Command received: " + e.Command);
     }
 }
Exemple #2
0
    private void LoadTasksAndLinks()
    {
        DayPilotGantt1.DataSource      = DataGeneratorGantt.GetDataLarge();
        DayPilotGantt1.DataIdField     = "id";
        DayPilotGantt1.DataTextField   = "text";
        DayPilotGantt1.DataStartField  = "start";
        DayPilotGantt1.DataEndField    = "end";
        DayPilotGantt1.DataParentField = "parent";
        DayPilotGantt1.DataBind();

        DayPilotGantt1.Links.Clear();
        DayPilotGantt1.Links.Add("1", "2");
    }
Exemple #3
0
    void DayPilotGantt1_Command(object sender, DayPilot.Web.Ui.Events.Gantt.CommandEventArgs e)
    {
        switch (e.Command)
        {
        case "goto":
            DayPilotGantt1.StartDate = Convert.ToDateTime((string)e.Data);
            DayPilotGantt1.Days      = DateTime.DaysInMonth(DayPilotGantt1.StartDate.Year, DayPilotGantt1.StartDate.Month);
            LoadTasksAndLinks();
            DayPilotGantt1.UpdateWithMessage("Command received: " + e.Command);
            break;

        case "clientstate":
            DayPilotGantt1.UpdateWithMessage("filter: " + DayPilotGantt1.ClientState["filter"]);
            break;
        }
    }
Exemple #4
0
    private void LoadTasksAndLinks()
    {
        DayPilotGantt1.DataSource         = DataGeneratorGantt.GetData();
        DayPilotGantt1.DataIdField        = "id";
        DayPilotGantt1.DataTextField      = "text";
        DayPilotGantt1.DataStartField     = "start";
        DayPilotGantt1.DataEndField       = "end";
        DayPilotGantt1.DataParentField    = "parent";
        DayPilotGantt1.DataMilestoneField = "milestone";
        DayPilotGantt1.DataCompleteField  = "complete";
        DayPilotGantt1.DataTagFields      = "text";
        DayPilotGantt1.DataBind();

        DayPilotGantt1.Links.Clear();
        DayPilotGantt1.Links.Add("1", "2");
    }
Exemple #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DayPilotGantt1.BeforeCellRender       += DayPilotGantt1_BeforeCellRender;
        DayPilotGantt1.TaskMove               += DayPilotGantt1_OnTaskMove;
        DayPilotGantt1.Command                += DayPilotGantt1_Command;
        DayPilotGantt1.BeforeLinkRender       += DayPilotGantt1_BeforeLinkRender;
        DayPilotGantt1.BeforeTaskRender       += DayPilotGantt1_BeforeTaskRender;
        DayPilotGantt1.BeforeTimeHeaderRender += DayPilotGantt1_BeforeTimeHeaderRender;
        DayPilotGantt1.TaskClick              += DayPilotGantt1_TaskClick;
        DayPilotGantt1.TaskMenuClick          += new TaskMenuClickEventHandler(DayPilotGantt1_TaskMenuClick);
        DayPilotGantt1.LinkMenuClick          += new LinkMenuClickEventHandler(DayPilotGantt1_LinkMenuClick);

        if (!IsPostBack)
        {
            DayPilotGantt1.StartDate = DateTime.Today.AddDays(-10);
            DayPilotGantt1.ScrollTo(DateTime.Today);
            DayPilotGantt1.Days = 30;
            LoadTasksAndLinks();
        }
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            Proyecto = Request.QueryString["Proyecto"];
            Usuario  = Request.QueryString["Usuario"];

            DayPilotGantt1.BeforeTaskRender += DayPilotGantt1_BeforeTaskRender;

            if (!IsPostBack)
            {
                MySqlConnection cn;
                MySqlCommand    cmd;
                try
                {
                    cn              = new MySqlConnection("server=localhost;database=pico-tec;userid=root;password=jugranados20140465226978");
                    cmd             = new MySqlCommand("verFechasActividades", cn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@IDProyecto", Convert.ToInt32(Proyecto));
                    cn.Open();

                    DataTable        dataTable = new DataTable();
                    MySqlDataAdapter da        = new MySqlDataAdapter(cmd);
                    da.Fill(dataTable);

                    DayPilotGantt1.StartDate = (DateTime)dataTable.Rows[0]["Fecha Inicio"];
                    DayPilotGantt1.ScrollTo((DateTime)dataTable.Rows[0]["Fecha Fin"]);

                    cn.Close();
                }
                catch (Exception ex)
                {
                    Response.Write(ex);
                    ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Ha ocurrido un error:" + "');", true);
                }

                BindGridView();
                DayPilotGantt1.Days = 30;
                LoadTasksAndLinks();
            }
        }
Exemple #7
0
 void DayPilotGantt1_TaskClick(object sender, TaskClickEventArgs e)
 {
     DayPilotGantt1.UpdateWithMessage("Clicked: " + e.Id);
 }
Exemple #8
0
 void DayPilotGantt1_TaskMenuClick(object sender, TaskMenuClickEventArgs e)
 {
     DayPilotGantt1.UpdateWithMessage("Command: " + e.Command + ", task: " + e.Id);
 }
Exemple #9
0
 protected void DayPilotGantt1_OnTaskMove(object sender, TaskMoveEventArgs e)
 {
     DayPilotGantt1.UpdateWithMessage("Moved to " + e.NewStart);
 }
Exemple #10
0
 void DayPilotGantt1_LinkMenuClick(object sender, LinkMenuClickEventArgs e)
 {
     DayPilotGantt1.Message("Command: " + e.Command + ", link from " + e.From + " to " + e.To);
 }
Exemple #11
0
 void DayPilotGantt1_RowCreate(object sender, RowCreateEventArgs e)
 {
     DayPilotGantt1.Tasks.Add(e.Text, Guid.NewGuid().ToString(), DateTime.Today, DateTime.Today.AddDays(1));
     DayPilotGantt1.UpdateWithMessage("Created");
 }
Exemple #12
0
 void DayPilotGantt1_RowSelect(object sender, RowSelectEventArgs e)
 {
     DayPilotGantt1.Message("Row selected.");
 }