private void Initial() { BudContractConsReport byId = this.rptSer.GetById(this.rptId); this.lblDate.Text = byId.InputDate.ToString("yyyy-MM-dd"); this.txtNode.Value = byId.Note; PTPrjInfoService pTPrjInfoService = new PTPrjInfoService(); PTPrjInfo byId2 = pTPrjInfoService.GetById(byId.PrjId); if (byId2 != null) { this.lblPrjName.Text = byId2.PrjName; } System.Collections.Generic.List <BudContractConsTask> list = ( from ct in this.ctSer where ct.RptId == this.rptId select ct).ToList <BudContractConsTask>(); BudContractTaskService budContractTaskService = new BudContractTaskService(); foreach (BudContractConsTask current in list) { if (current.ContractTask == null) { current.ContractTask = budContractTaskService.GetTaskById(current.TaskId); } } this.gvwConsTask.DataSource = list; this.gvwConsTask.DataBind(); }
public void ShowTaskInfo_click(object sender, System.EventArgs e) { string id = string.Empty; string arg_0B_0 = string.Empty; cn.justwin.Domain.Entities.BudContractTask budContractTask = null; DataTable dataSource = null; string contractID = null; if (!string.IsNullOrEmpty(base.Request["id"])) { contractID = base.Request["id"]; } if (!string.IsNullOrEmpty(this.hdTaskID.Value)) { id = this.hdTaskID.Value; BudContractTaskService budContractTaskService = new BudContractTaskService(); budContractTask = budContractTaskService.GetTaskById(id); this.hdOrderNumber.Value = budContractTask.OrderNumber; } if (budContractTask != null) { dataSource = cn.justwin.Domain.BudContractTask.GetConByParent(this.hdnProjectCode.Value, contractID, budContractTask.OrderNumber, "", "", "", 0); } this.gvBudget.DataSource = dataSource; this.gvBudget.DataBind(); }
protected void Initial() { if (!string.IsNullOrEmpty(base.Request["ContractID"])) { string text = base.Request["ContractID"]; this.hfldContractId.Value = text; ConIncometContract byContractId = this.conIncometSev.GetByContractId(text); this.hfldPrjGuid.Value = byContractId.Project; this.lblContractName.Text = byContractId.ContractName; } if (!string.IsNullOrEmpty(base.Request["id"])) { string rptId = base.Request["id"]; if (rptId != string.Empty) { this.hfldType.Value = "edit"; } else { this.hfldType.Value = "add"; } this.hfldRptId.Value = rptId; BudContractConsReport byId = this.rptSer.GetById(this.hfldRptId.Value); this.txtDate.Text = byId.InputDate.ToString("yyyy-MM-dd"); this.txtNode.Value = byId.Note; System.Collections.Generic.List <BudContractConsTask> list = ( from ct in this.ctSer where ct.RptId == rptId select ct).ToList <BudContractConsTask>(); BudContractTaskService budContractTaskService = new BudContractTaskService(); DataTable dataTable = new DataTable(); foreach (BudContractConsTask current in list) { if (current.ContractTask == null) { current.ContractTask = budContractTaskService.GetTaskById(current.TaskId); dataTable = cn.justwin.Domain.BudContractTask.GetSingleBudContractTask(this.hfldPrjGuid.Value, current.TaskId); if (dataTable.Rows.Count > 0) { current.ContractTask.Quantity = System.Convert.ToDecimal(dataTable.Rows[0]["Quantity"]); current.ContractTask.Total = new decimal?(System.Convert.ToDecimal(dataTable.Rows[0]["total"])); } } } this.SaveToViewState(list); this.BindConsTask(list); } else { this.hfldRptId.Value = System.Guid.NewGuid().ToString(); } if (!string.IsNullOrEmpty(this.hfldPrjGuid.Value)) { PTPrjInfoService pTPrjInfoService = new PTPrjInfoService(); PTPrjInfo byId2 = pTPrjInfoService.GetById(this.hfldPrjGuid.Value); if (byId2 != null) { this.lblPrjName.Text = byId2.PrjName; this.txtDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd"); } } }