protected void btnUpdate_Click(object sender, System.EventArgs e) { if (this.gvTask.Rows.Count == 0) { base.RegisterScript("alert('系统提示:\\n\\n没有选择任务的时候不能进行保存!')"); return; } this.hfldIsPostBack.Value = "true"; ConstructReport constructReport = ConstructReport.Create(this.hfldReportId.Value, this.hfldPrjId.Value, this.txtInputUser.Text.Trim(), System.Convert.ToDateTime(this.txtDate.Text), null, this.txtWorkCard.Value.Trim(), -1); ConstructReport byId = ConstructReport.GetById(this.hfldReportId.Value); constructReport.IsValid = true; if (byId != null) { constructReport.Update(constructReport); System.Collections.IEnumerator enumerator = this.gvTask.Rows.GetEnumerator(); try { while (enumerator.MoveNext()) { GridViewRow gridViewRow = (GridViewRow)enumerator.Current; string taskId = this.gvTask.DataKeys[gridViewRow.RowIndex].Values[0].ToString(); string id = this.gvTask.DataKeys[gridViewRow.RowIndex].Values[1].ToString(); string text = ((TextBox)gridViewRow.FindControl("txtCompleteQuantity")).Text; string text2 = ((TextBox)gridViewRow.FindControl("txtWorkContent")).Text; System.Collections.Generic.List <ConstructResource> resourceList = null; ConstructTask constructTask = ConstructTask.Create(id, this.hfldReportId.Value, taskId, System.Convert.ToDecimal(text), text2, "", resourceList); constructTask.Update(constructTask); } goto IL_1A8; } finally { System.IDisposable disposable = enumerator as System.IDisposable; if (disposable != null) { disposable.Dispose(); } } } constructReport.State = "0"; constructReport.Add(constructReport); IL_1A8: base.RegisterScript("top.ui.tabSuccess({ parentName: '_ConstructTask' });"); }
protected void btnBindResTask_Click(object sender, System.EventArgs e) { if (!string.IsNullOrEmpty(this.hfldResourceId.Value)) { ISerializable serializable = new JsonSerializer(); string[] array = serializable.Deserialize <string[]>(this.hfldResourceId.Value); if (this.type == "add" && ConstructReport.GetById(this.hfldReportId.Value) == null) { ConstructReport constructReport = ConstructReport.Create(this.hfldReportId.Value, this.hfldPrjId.Value, this.txtInputUser.Text.Trim(), System.DateTime.Now, null, this.txtWorkCard.Value.Trim(), -1); constructReport.State = "0"; constructReport.IsValid = false; constructReport.Add(constructReport); BudConsReportService budConsReportService = new BudConsReportService(); BudConsReport byId = budConsReportService.GetById(this.hfldReportId.Value); if (byId != null) { byId.ConstractId = this.contractId; budConsReportService.Update(byId); } } string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string taskId = array2[i]; if (!ConstructTask.isExist(this.hfldReportId.Value, taskId)) { System.Collections.Generic.List <ConstructResource> resourceList = null; ConstructTask constructTask = ConstructTask.Create(System.Guid.NewGuid().ToString(), this.hfldReportId.Value, taskId, System.Convert.ToDecimal("0.000"), "", "", resourceList); constructTask.Add(constructTask, this.isWBSRelevance); } } } this.SelectResource1.ResourceId = string.Empty; this.SelectResource1.ResTempType = string.Empty; this.conId = this.hfldReportId.Value; this.BindGv(); }