private string GetParentId(string taskId) { BudContractTaskService budContractTaskService = new BudContractTaskService(); BudContractTask byId = budContractTaskService.GetById(taskId); if (byId != null) { return(byId.ParentId); } return(string.Empty); }
private string GetParentId(string taskId) { BudContractTaskService budContractTaskService = new BudContractTaskService(); cn.justwin.Domain.Entities.BudContractTask byId = budContractTaskService.GetById(taskId); BudConModifyTaskService source = new BudConModifyTaskService(); BudConModifyTask budConModifyTask = ( from r in source where r.TaskId == taskId select r).FirstOrDefault <BudConModifyTask>(); if (byId != null) { return(byId.ParentId); } return(budConModifyTask.ParentId); }
protected void BindHtmlData() { if (this.type.ToLower() == "edit") { BudContractTaskService budContractTaskService = new BudContractTaskService(); cn.justwin.Domain.Entities.BudContractTask byId = budContractTaskService.GetById(this.id); if (byId != null) { this.txtTaskCode.Text = byId.TaskCode; this.ViewState["oldCode"] = byId.TaskCode; this.txtTaskName.Text = byId.TaskName; this.txtStartDate.Text = ((!byId.StartDate.HasValue) ? string.Empty : byId.StartDate.Value.ToString("yyyy-M-d")); this.txtEndDate.Text = ((!byId.EndDate.HasValue) ? string.Empty : byId.EndDate.Value.ToString("yyyy-M-d")); this.txtConstructionPeriod.Text = (byId.ConstructionPeriod.HasValue ? byId.ConstructionPeriod.Value.ToString() : ""); this.txtUnit.Text = byId.Unit; this.txtQuantity.Text = byId.Quantity.ToString(); this.txtUnitPrice.Text = byId.UnitPrice.ToString(); this.txtTotal.Text = byId.Total.ToString(); this.ddlTaskType.SelectedValue = (byId.OrderNumber.Length / 3).ToString(); this.txtNote.Text = byId.Note; this.txtDescription.Text = byId.FeatureDescription; this.txtMainMaterial.Text = byId.MainMaterial.ToString(); this.txtSubMaterial.Text = byId.SubMaterial.ToString(); this.txtLabor.Text = byId.Labor.ToString(); } cn.justwin.Domain.BudContractTask.GetById(this.id); this.hfldState.Value = "edit"; return; } string text = base.Request["layer"]; if (text == "") { this.ddlTaskType.SelectedValue = "1"; return; } if (text == "0") { this.ddlTaskType.SelectedValue = string.Empty; return; } this.ddlTaskType.SelectedValue = text; }
protected string GetTaskCode(string taskId) { string result = string.Empty; BudContractTaskService budContractTaskService = new BudContractTaskService(); BudContractTask byId = budContractTaskService.GetById(taskId); if (byId != null) { result = byId.TaskCode; } else { BudConModifyTask byId2 = this.conModifyTaskSer.GetById(taskId); if (byId2 != null) { result = byId2.ModifyTaskCode; } } return(result); }
protected string GetTaskCode(string taskId) { string result = string.Empty; cn.justwin.Domain.Entities.BudContractTask budContractTask = new cn.justwin.Domain.Entities.BudContractTask(); BudContractTaskService budContractTaskService = new BudContractTaskService(); budContractTask = budContractTaskService.GetById(taskId); if (budContractTask != null) { result = budContractTask.TaskCode; } else { BudConModifyTask byId = this.conModifyTaskSer.GetById(taskId); if (byId != null) { result = byId.ModifyTaskCode; } } return(result); }
protected void btnSave_Click(object sender, System.EventArgs e) { string text = this.txtQuantity.Text; string value = this.txtUnitPrice.Text.Trim(); decimal value2 = System.Convert.ToDecimal(text) * System.Convert.ToDecimal(value); if (string.IsNullOrEmpty(text)) { base.RegisterScript("top.ui.alert('工程量必须输入');"); this.txtQuantity.Focus(); return; } if (string.IsNullOrEmpty(value)) { base.RegisterScript("top.ui.alert('综合单价必须输入');"); this.txtUnitPrice.Focus(); return; } string taskCode = this.txtTaskCode.Text.Trim(); bool flag = false; if (this.ViewState["oldCode"] != null) { this.ViewState["oldCode"].ToString(); } else { string arg_B0_0 = string.Empty; } if (flag) { base.RegisterScript("top.ui.alert('清单编码不能重复');"); this.txtTaskCode.Focus(); return; } string taskName = this.txtTaskName.Text.Trim(); System.DateTime?startDate = null; if (!string.IsNullOrEmpty(this.txtStartDate.Text)) { startDate = new System.DateTime?(System.Convert.ToDateTime(this.txtStartDate.Text)); } System.DateTime?endDate = null; if (!string.IsNullOrEmpty(this.txtEndDate.Text)) { endDate = new System.DateTime?(System.Convert.ToDateTime(this.txtEndDate.Text)); } string unit = this.txtUnit.Text.Trim(); string arg_15D_0 = this.ddlTaskType.SelectedValue; string note = this.txtNote.Text.Trim(); int? constructionPeriod = null; if (!string.IsNullOrEmpty(this.txtConstructionPeriod.Text.Trim())) { constructionPeriod = new int?(System.Convert.ToInt32(this.txtConstructionPeriod.Text.Trim())); } string arg_1B6_0 = this.txtConstructionPeriod.Text; BudContractTaskService budContractTaskService = new BudContractTaskService(); cn.justwin.Domain.Entities.BudContractTask budContractTask; if (this.type.ToUpper() == "EDIT") { budContractTask = budContractTaskService.GetById(this.id); } else { budContractTask = new cn.justwin.Domain.Entities.BudContractTask(); budContractTask.TaskId = System.Guid.NewGuid().ToString(); budContractTask.OrderNumber = cn.justwin.Domain.BudContractTask.GetOrderNumber(this.prjId, this.id); if (string.IsNullOrEmpty(this.id)) { budContractTask.ParentId = null; } else { budContractTask.ParentId = this.id; } budContractTask.PrjId = this.prjId; budContractTask.InputUser = base.UserCode; budContractTask.InputDate = System.DateTime.Now; } budContractTask.TaskCode = taskCode; budContractTask.TaskName = taskName; budContractTask.Unit = unit; budContractTask.Quantity = System.Convert.ToDecimal(text); budContractTask.StartDate = startDate; budContractTask.EndDate = endDate; budContractTask.ConstructionPeriod = constructionPeriod; budContractTask.Note = note; budContractTask.UnitPrice = new decimal?(System.Convert.ToDecimal(value)); budContractTask.Total = new decimal?(value2); budContractTask.TaskType = ""; budContractTask.FeatureDescription = this.txtDescription.Text.Trim(); budContractTask.MainMaterial = new decimal?(System.Convert.ToDecimal(this.txtMainMaterial.Text.Trim())); budContractTask.SubMaterial = new decimal?(System.Convert.ToDecimal(this.txtSubMaterial.Text.Trim())); budContractTask.Labor = new decimal?(System.Convert.ToDecimal(this.txtLabor.Text.Trim())); if (this.type.ToUpper() == "EDIT") { budContractTaskService.Update(budContractTask); } else { budContractTaskService.Add(budContractTask); } string str = "resetData();"; string str2 = "top.ui.winSuccess({parentName:'_BudContractTaskTaskEdit'});"; base.RegisterScript(str + str2); }