Example #1
0
    protected void BtnEdit_Click(object sender, EventArgs e)
    {
        this.DGrdMarket.EditItemIndex = int.Parse(this.HdnSelectedIndex.Value);
        TaskRelationCollection tc = this.DGrdMarket_GetData();

        this.DGrdTender_Bind(tc);
    }
Example #2
0
        public int UpdateBeforeTask(TaskRelationCollection tc, Guid ProjectCode, string TaskCode)
        {
            string sqlString = " ";
            object obj2      = sqlString;

            sqlString = string.Concat(new object[] { obj2, " delete from EPM_Task_TaskRelation where ProjectCode='", ProjectCode, "' and EndTaskCode='", TaskCode, "' " });
            if (tc.Count > 0)
            {
                for (int i = 0; i < tc.Count; i++)
                {
                    object obj3 = sqlString + " insert into EPM_Task_TaskRelation(ProjectCode,BeginTaskCode,EndTaskCode,Relationship,WaitDay) " + " values( ";
                    object obj4 = (string.Concat(new object[] { obj3, " '", tc[i].ProjectCode, "', " }) + " '" + tc[i].BeginTaskCode + "', ") + " '" + tc[i].EndTaskCode + "', ";
                    object obj5 = string.Concat(new object[] { obj4, " '", tc[i].Relationship, "', " });
                    sqlString = string.Concat(new object[] { obj5, " '", tc[i].WaitDay, "' " }) + " ) ";
                }
            }
            try
            {
                publicDbOpClass.ExecSqlString(sqlString);
                return(1);
            }
            catch
            {
                return(0);
            }
        }
Example #3
0
    protected void BtnDel_Click(object sender, EventArgs e)
    {
        this.DGrdMarket.EditItemIndex = -1;
        TaskRelationCollection taskRelationCollection = this.DGrdMarket_GetData();

        taskRelationCollection.RemoveAt(int.Parse(this.HdnSelectedIndex.Value));
        this.DGrdTender_Bind(taskRelationCollection);
    }
Example #4
0
    public int Update()
    {
        TaskRelationCollection tc = this.DGrdMarket_GetData();

        if (this.ScheduleAct.UpdateBeforeTask(tc, this.ProjectCode, this.TaskCode) == 1)
        {
            return(1);
        }
        return(0);
    }
Example #5
0
    public void Bind(string flag)
    {
        if (flag == "View")
        {
            this.BtnAdd.Visible  = false;
            this.BtnEdit.Visible = false;
            this.BtnDel.Visible  = false;
        }
        TaskRelationCollection taskRelation = this.ScheduleAct.GetTaskRelation(this.ProjectCode, this.TaskCode);

        this.DGrdTender_Bind(taskRelation);
    }
Example #6
0
    protected void BtnAdd_Click(object sender, EventArgs e)
    {
        TaskRelationCollection taskRelationCollection = this.DGrdMarket_GetData();

        taskRelationCollection.Insert(0, new TaskRelation
        {
            ProjectCode   = this.ProjectCode,
            EndTaskCode   = this.TaskCode,
            BeginTaskCode = string.Empty,
            WaitDay       = 0,
            Relationship  = 1
        });
        this.DGrdMarket.EditItemIndex = 0;
        this.DGrdTender_Bind(taskRelationCollection);
    }
Example #7
0
        public TaskRelationCollection GetTaskRelation(Guid ProjectCode, string TaskCode)
        {
            TaskRelationCollection relations = new TaskRelationCollection();
            string str  = "";
            object obj2 = str;

            using (DataTable table = publicDbOpClass.DataTableQuary(string.Concat(new object[] { obj2, "select * from EPM_Task_TaskRelation where ProjectCode='", ProjectCode, "' and EndTaskCode='", TaskCode, "' " })))
            {
                if (table.Rows.Count <= 0)
                {
                    return(relations);
                }
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    relations.Add(this.GetTaskRelationFromDataRow(table.Rows[i]));
                }
            }
            return(relations);
        }
Example #8
0
 private void DGrdTender_Bind(TaskRelationCollection tc)
 {
     this.DGrdMarket.DataSource = tc;
     base.Session["SESTENDER"]  = tc;
     this.DGrdMarket.DataBind();
 }
Example #9
0
    private TaskRelationCollection DGrdMarket_GetData()
    {
        TaskRelationCollection taskRelationCollection = (TaskRelationCollection)base.Session["SESTENDER"];

        for (int i = this.DGrdMarket.Items.Count - 1; i >= 0; i--)
        {
            DataGridItem dataGridItem = this.DGrdMarket.Items[i];
            switch (dataGridItem.ItemType)
            {
            case ListItemType.Item:
            case ListItemType.AlternatingItem:
                if (((Label)dataGridItem.Cells[1].FindControl("LblBeginTaskCode")).Text.ToString() != "")
                {
                    taskRelationCollection[i].ProjectCode   = this.ProjectCode;
                    taskRelationCollection[i].EndTaskCode   = this.TaskCode;
                    taskRelationCollection[i].BeginTaskCode = ((Label)dataGridItem.Cells[1].FindControl("LblBeginTaskCode")).Text;
                    string text         = ((Label)dataGridItem.Cells[0].FindControl("LblRelation")).Text;
                    int    relationship = 0;
                    string a;
                    if ((a = text) != null)
                    {
                        if (!(a == "完成开始[FS]"))
                        {
                            if (!(a == "完成完成[FF]"))
                            {
                                if (!(a == "开始完成[SF]"))
                                {
                                    if (a == "开始开始[SS]")
                                    {
                                        relationship = 3;
                                    }
                                }
                                else
                                {
                                    relationship = 2;
                                }
                            }
                            else
                            {
                                relationship = 0;
                            }
                        }
                        else
                        {
                            relationship = 1;
                        }
                    }
                    taskRelationCollection[i].Relationship = relationship;
                    taskRelationCollection[i].WaitDay      = Convert.ToInt32((((Label)dataGridItem.Cells[3].FindControl("LblWaitDay")).Text == "") ? "0" : ((Label)dataGridItem.Cells[3].FindControl("LblWaitDay")).Text);
                }
                break;

            case ListItemType.EditItem:
                if (((TextBox)dataGridItem.Cells[1].FindControl("TxtBeginTaskCode")).Text.ToString() != "")
                {
                    taskRelationCollection[i].ProjectCode   = this.ProjectCode;
                    taskRelationCollection[i].EndTaskCode   = this.TaskCode;
                    taskRelationCollection[i].BeginTaskCode = ((TextBox)dataGridItem.Cells[1].FindControl("TxtBeginTaskCode")).Text;
                    taskRelationCollection[i].Relationship  = Convert.ToInt32(((DropDownList)dataGridItem.Cells[0].FindControl("DDLRelation")).SelectedValue);
                    taskRelationCollection[i].WaitDay       = Convert.ToInt32((((TextBox)dataGridItem.Cells[3].FindControl("TxtWaitDay")).Text == "") ? "0" : ((TextBox)dataGridItem.Cells[3].FindControl("TxtWaitDay")).Text);
                }
                break;
            }
        }
        return(taskRelationCollection);
    }