private void Init_theSchedule(Guid versionCode) { this._DtSchedule.Reset(); this._DtSchedule.Columns.Add(new DataColumn("TaskCode", typeof(string))); this._DtSchedule.Columns.Add(new DataColumn("TaskName", typeof(string))); this._DtSchedule.Columns.Add(new DataColumn("ParentTaskCode", typeof(string))); this._DtSchedule.Columns.Add(new DataColumn("Quantity", typeof(decimal))); this._DtSchedule.Columns.Add(new DataColumn("SumCompleteQuantity", typeof(decimal))); this._DtSchedule.Columns.Add(new DataColumn("total", typeof(decimal))); this._DtSchedule.Columns.Add(new DataColumn("cctotal", typeof(decimal))); this._DtSchedule.Columns.Add(new DataColumn("IsHaveChild", typeof(string))); ArrayList allTemp = TemplatesAction.getAllTemp(); for (int i = 0; i < allTemp.Count; i++) { DataRow dataRow = this._DtSchedule.NewRow(); Templates templates = (Templates)allTemp[i]; dataRow["TaskCode"] = templates.TemplatesCode; dataRow["TaskName"] = templates.TemplatesName; dataRow["ParentTaskCode"] = templates.ParentCode; dataRow["Quantity"] = BindBudgetAction.getTotalQuantity(this.hdnPrjGuid.Value, templates.TemplatesCode); dataRow["SumCompleteQuantity"] = BindBudgetAction.gettotalSumCompleteQuantity(this.hdnPrjGuid.Value, templates.TemplatesCode); dataRow["total"] = BindBudgetAction.getAlltotal(this.hdnPrjGuid.Value, templates.TemplatesCode); dataRow["cctotal"] = BindBudgetAction.getAllccTotal(this.hdnPrjGuid.Value, templates.TemplatesCode); this._DtSchedule.Rows.Add(dataRow); } }
public void DG_ListBind(string TempCode, string PrjGuid) { DataSet allNews = BindBudgetAction.getAllNews(PrjGuid, TempCode); this.DG_list.DataSource = allNews; this.DG_list.DataBind(); }
protected void BtnSave_Click(object sender, EventArgs e) { if (BindBudgetAction.Delete(this.hdnTaskCode.Value)) { string text = this.hdnProjectName.Value.ToString(); string[] array = text.Split(new char[] { ',' }); for (int i = 0; i < array.Length; i++) { if (array[i] != "" && !BindBudgetAction.Add(new BindBudget { PrjCode = new Guid(this.hdnPrjGuid.Value), Templatescode = this.hdnTaskCode.Value, TaskCode = array[i].ToString() })) { this.RegisterStartupScript("", "<script>alert('编辑失败!');</script>"); return; } } this.RegisterStartupScript("", "<script>alert('编辑成功!');window.close();</script>"); return; } this.RegisterStartupScript("", "<script>alert('编辑失败!');</script>"); }
protected void btnDel_Click(object sender, EventArgs e) { if (!TemplatesAction.getPare(this.hdnWorkCode.Value.Trim())) { if (TemplatesAction.Delete(this.hdnWorkCode.Value)) { if (!BindBudgetAction.Delete(this.hdnWorkCode.Value)) { this.RegisterStartupScript("", "<script>alert('绑定删除失败!');</script>"); } } else { this.RegisterStartupScript("", "<script>alert('删除失败!');</script>"); } } else { this.RegisterStartupScript("", "<script>alert('该级别下面有分级,请先删除分级!');</script>"); } this.Init_theWork(); this.tblWork_Create(true); }
public void CreateChild(DataTable dt1, string TaskCode, int level, string inherHead, bool isExpend, bool firstExpend) { DataRow[] array = this._DtSchedule.Select("ParentTaskCode ='" + TaskCode + "'"); int num = array.Length; for (int i = 0; i < num; i++) { bool flag = false; DataRow dataRow = array[i]; for (int j = 0; j < this._ScheduleCodeList.Length; j++) { if (this._ScheduleCodeList[j] == dataRow["TaskCode"].ToString()) { flag = true; break; } } bool flag2 = this._DtSchedule.Select("ParentTaskCode ='" + dataRow["TaskCode"].ToString() + "'").Length > 0; dataRow["IsHaveChild"] = flag2.ToString(); DataRow dataRow2 = dt1.NewRow(); dataRow2.ItemArray = dataRow.ItemArray; dataRow2["HeadImg"] = inherHead + this.getHeadImg(i, num, dataRow, flag2, firstExpend); dataRow2["ParentTaskCode"] = TaskCode; if (level == 0) { dataRow2["display"] = "block"; isExpend = true; } else { if (isExpend) { dataRow2["display"] = "block"; } else { if (firstExpend) { dataRow2["display"] = "block"; } else { dataRow2["display"] = "none"; } } } dt1.Rows.Add(dataRow2); if (flag2) { this.CreateChild(dt1, dataRow["TaskCode"].ToString(), level + 1, this.getInherImg(i, num, inherHead), isExpend && flag, firstExpend); } else { level++; DataTable newsreturnTable = BindBudgetAction.getNewsreturnTable(this.hdnPrjGuid.Value, dataRow["TaskCode"].ToString()); DataRow[] array2 = newsreturnTable.Select("1=1"); for (int k = 0; k < array2.Length; k++) { dataRow = array2[k]; dataRow2 = dt1.NewRow(); dataRow2.ItemArray = dataRow.ItemArray; dataRow2["HeadImg"] = inherHead + "<img src=\"../../../images/tree/i.gif\" align=\"absmiddle\">" + this.getHeadImg(i + 1, num + 1, dataRow, false, firstExpend); dataRow2["ParentTaskCode"] = TaskCode; dataRow2["display"] = "block"; dt1.Rows.Add(dataRow2); } } } }
private void tblSchedule_Draw(DataTable dt) { new ConstructWBSTaskAction(); TableRow tableRow = new TableRow(); TableCell tableCell = new TableCell(); for (int i = 0; i < dt.Rows.Count; i++) { DataRow dataRow = dt.Rows[i]; tableRow = new TableRow(); TableCell tableCell2 = new TableCell(); HtmlInputCheckBox htmlInputCheckBox = new HtmlInputCheckBox(); htmlInputCheckBox.ID = "chk_" + i.ToString(); htmlInputCheckBox.Value = dataRow["TaskCode"].ToString(); if (dataRow["IsHaveChild"].ToString().ToLower() == "true") { htmlInputCheckBox.Visible = false; } if (BindBudgetAction.ishave(this.hdnPrjGuid.Value, this.hdnTaskCode.Value, dataRow["TaskCode"].ToString())) { htmlInputCheckBox.Checked = true; } tableCell2.Controls.Add(htmlInputCheckBox); tableRow.Cells.Add(tableCell2); tableCell = new TableCell(); tableCell.Text = dataRow["HeadImg"].ToString() + ((dataRow["TaskName"].ToString().Trim() == "") ? ".." : dataRow["TaskName"].ToString().Trim()); tableCell.Wrap = false; tableRow.Cells.Add(tableCell); tableCell = new TableCell(); tableCell.Text = dataRow["ParentTaskCode"].ToString() + "<font color=\"#ff0000\">" + dataRow["TaskCode"].ToString().Substring(dataRow["ParentTaskCode"].ToString().Length) + "</font>"; tableCell.Width = Unit.Pixel(70); tableCell.Wrap = false; tableRow.Cells.Add(tableCell); if (dataRow["ParentTaskCode"].ToString() != "") { tableRow.Attributes["id"] = dataRow["ParentTaskCode"].ToString(); } if (dataRow["IsHaveChild"].ToString().ToLower() == "false") { tableRow.Attributes["onclick"] = string.Concat(new string[] { "doClick(this,'", this.tblSchedule.ClientID, "',true);clickRow(this,'", dataRow["NoteID"].ToString(), "',", dataRow["IsHaveChild"].ToString().ToLower(), ",", dataRow["WorkLayer"].ToString(), ");" }); } else { tableRow.Attributes["onclick"] = string.Concat(new string[] { "doClick(this,'", this.tblSchedule.ClientID, "',false);clickRow(this,'", dataRow["NoteID"].ToString(), "',", dataRow["IsHaveChild"].ToString().ToLower(), ",", dataRow["WorkLayer"].ToString(), ");" }); } tableRow.Attributes["onmouseover"] = "doMouseOver(this);"; tableRow.Attributes["onmouseout"] = "doMouseOut(this);"; tableRow.Style.Add("display", dataRow["display"].ToString()); tableRow.CssClass = "grid_row"; this.tblSchedule.Rows.Add(tableRow); } }