/// <summary> /// 确定按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSure_Click(object sender, EventArgs e) { Model.CostGoods_HSSECostUnitManageItem newItem = new Model.CostGoods_HSSECostUnitManageItem { HSSECostUnitManageId = this.HSSECostUnitManageId, Type = this.Type, SortIndex = Funs.GetNewInt(this.txtSortIndex.Text.Trim()), ReportTime = Funs.GetNewDateTime(this.txtReportTime.Text), CostContent = this.txtCostContent.Text.Trim(), Quantity = Funs.GetNewDecimal(this.txtQuantity.Text), Metric = this.txtMetric.Text.Trim(), Price = Funs.GetNewDecimal(this.txtPrice.Text), TotalPrice = Funs.GetNewDecimal(this.txtTotalPrice.Text), AuditQuantity = Funs.GetNewDecimal(this.txtQuantity.Text), AuditPrice = Funs.GetNewDecimal(this.txtPrice.Text), AuditTotalPrice = Funs.GetNewDecimal(this.txtTotalPrice.Text), }; if (!string.IsNullOrEmpty(this.hdHSSECostUnitManageItemId.Text)) { newItem.HSSECostUnitManageItemId = this.hdHSSECostUnitManageItemId.Text; BLL.HSSECostUnitManageItemService.UpdateHSSECostUnitManageItem(newItem); } else { newItem.HSSECostUnitManageItemId = SQLHelper.GetNewID(typeof(Model.CostGoods_HSSECostUnitManageItem)); BLL.HSSECostUnitManageItemService.AddHSSECostUnitManageItem(newItem); } this.InitText(); this.UpdateHSSECostUnitManage(); this.BindGrid(); PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(this.HSSECostUnitManageId) + "parent.__doPostBack('','HSSECostUnitManageItemWindowClose');"); }
/// <summary> /// 确定按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSure_Click(object sender, EventArgs e) { var newItem = BLL.HSSECostUnitManageItemService.GetHSSECostUnitManageItemByHSSECostUnitManageItemId(this.hdHSSECostUnitManageItemId.Text); if (newItem != null) { newItem.RatifiedExplain = this.txtRatifiedExplain.Text.Trim(); newItem.IsRatified = false; newItem.RatifiedQuantity = Funs.GetNewDecimal(this.txtRatifiedQuantity.Text); newItem.RatifiedPrice = Funs.GetNewDecimal(this.txtRatifiedPrice.Text); newItem.RatifiedTotalPrice = Funs.GetNewDecimal(this.txtRatifiedTotalPrice.Text); BLL.HSSECostUnitManageItemService.UpdateHSSECostUnitManageItem(newItem); } ; this.InitText(); this.UpdateHSSECostUnitManage(); this.BindGrid(); PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(this.HSSECostUnitManageId) + "parent.__doPostBack('','RatifiedItemWindowClose');"); }
/// <summary> /// /// </summary> private void SaveData(string type) { ///添加安全费用 DateTime?Months = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonths.SelectedValue); Model.CostGoods_HSSECostManage newHSSECostManage = new Model.CostGoods_HSSECostManage { ProjectId = this.ProjectId, Month = Months, Code = this.txtCode.Text, ReportDate = Funs.GetNewDateTime(this.txtReportDate.Text), MainIncome = Funs.GetNewDecimal(this.txtMainIncome.Text), Remark1 = this.txtRemark1.Text, ConstructionIncome = Funs.GetNewDecimal(this.txtConstructionIncome.Text), Remark2 = this.txtRemark2.Text, SafetyCosts = Funs.GetNewDecimal(this.txtSafetyCosts.Text), Remark3 = this.txtRemark3.Text, }; ////单据状态 newHSSECostManage.States = BLL.Const.State_0; if (type == BLL.Const.BtnSubmit) { newHSSECostManage.States = this.ctlAuditFlow.NextStep; } if (!string.IsNullOrEmpty(this.HSSECostManageId)) { newHSSECostManage.HSSECostManageId = this.HSSECostManageId; BLL.HSSECostManageService.UpdateHSSECostManage(newHSSECostManage); BLL.LogService.AddSys_Log(this.CurrUser, newHSSECostManage.Code, newHSSECostManage.HSSECostManageId, BLL.Const.ProjectHSSECostManageMenuId, BLL.Const.BtnModify); } else { this.HSSECostManageId = SQLHelper.GetNewID(typeof(Model.CostGoods_HSSECostManage)); newHSSECostManage.HSSECostManageId = this.HSSECostManageId; newHSSECostManage.CompileDate = System.DateTime.Now; newHSSECostManage.CompileManId = this.CurrUser.UserId; BLL.HSSECostManageService.AddHSSECostManage(newHSSECostManage); BLL.LogService.AddSys_Log(this.CurrUser, newHSSECostManage.Code, newHSSECostManage.HSSECostManageId, BLL.Const.ProjectHSSECostManageMenuId, BLL.Const.BtnAdd); } if (!string.IsNullOrEmpty(this.drpUnitId.SelectedValue) && this.drpUnitId.SelectedValue != BLL.Const._Null) { var updateItem = BLL.HSSECostUnitManageService.GetHSSECostUnitManageByHSSECostUnitManageId(this.HSSECostUnitManageId); if (updateItem != null) { updateItem.HSSECostManageId = this.HSSECostManageId; updateItem.UnitId = this.drpUnitId.SelectedValue; updateItem.EngineeringCost = Funs.GetNewDecimal(this.txtEngineeringCost.Text); updateItem.Remark1 = this.txtRemark1.Text; updateItem.SubUnitCost = Funs.GetNewDecimal(this.txtSubUnitCost.Text); updateItem.Remark2 = this.txtRemark2.Text; updateItem.AuditedSubUnitCost = Funs.GetNewDecimal(this.txtAuditedSubUnitCost.Text); updateItem.Remark3 = this.txtRemark1.Text; updateItem.CostRatio = Funs.GetNewDecimal(this.txtCostRatio.Text); updateItem.Remark4 = this.txtRemark1.Text; BLL.HSSECostUnitManageService.UpdateHSSECostUnitManage(updateItem); } else { ///添加施工单位安全费用 Model.CostGoods_HSSECostUnitManage newHSSECostUnitManage = new Model.CostGoods_HSSECostUnitManage { HSSECostManageId = this.HSSECostManageId, UnitId = this.drpUnitId.SelectedValue, EngineeringCost = Funs.GetNewDecimal(this.txtEngineeringCost.Text), Remark1 = this.txtRemark1.Text, SubUnitCost = Funs.GetNewDecimal(this.txtSubUnitCost.Text), Remark2 = this.txtRemark2.Text, AuditedSubUnitCost = Funs.GetNewDecimal(this.txtAuditedSubUnitCost.Text), Remark3 = this.txtRemark1.Text, CostRatio = Funs.GetNewDecimal(this.txtCostRatio.Text), Remark4 = this.txtRemark1.Text, }; this.HSSECostUnitManageId = SQLHelper.GetNewID(typeof(Model.CostGoods_HSSECostUnitManage)); newHSSECostUnitManage.HSSECostUnitManageId = this.HSSECostUnitManageId; BLL.HSSECostUnitManageService.AddHSSECostUnitManage(newHSSECostUnitManage); } this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.ProjectHSSECostManageMenuId, this.HSSECostManageId, (type == BLL.Const.BtnSubmit ? true : false), this.drpYear.SelectedText + "年" + this.drpMonths.SelectedText + "月安全费用", "../CostGoods/HSSECostManageView.aspx?HSSECostManageId={0}"); ////判断单据是否 加入到企业管理资料 string menuId = BLL.Const.ProjectHSSECostManageMenuId; var safeData = Funs.DB.SafetyData_SafetyData.FirstOrDefault(x => x.MenuId == menuId); if (safeData != null) { BLL.SafetyDataService.AddSafetyData(menuId, this.HSSECostManageId, this.drpYear.SelectedText + "-" + this.drpMonths.SelectedText + "安全费用", "../CostGoods/HSSECostManageView.aspx?HSSECostManageId={0}", this.ProjectId); } } }
/// <summary> /// 检查并保存其他HSE管理活动集合 /// </summary> private void jerqueSaveMonthPlanList() { costManageItems.Clear(); JArray mergedData = Grid1.GetMergedData(); foreach (JObject mergedRow in mergedData) { string status = mergedRow.Value <string>("status"); JObject values = mergedRow.Value <JObject>("values"); int i = mergedRow.Value <int>("index"); Model.CostGoods_CostManageItem costManageItem = new Model.CostGoods_CostManageItem { CostManageItemId = this.Grid1.Rows[i].DataKeys[0].ToString(), InvestCostProject = values.Value <string>("InvestCostProject").ToString(), UseReason = values.Value <string>("UseReason").ToString(), Counts = Funs.GetNewIntOrZero(values.Value <string>("Counts").ToString()), PriceMoney = Funs.GetNewDecimalOrZero(values.Value <string>("PriceMoney").ToString()), AuditCounts = !string.IsNullOrEmpty(values.Value <string>("AuditCounts").ToString()) ? Funs.GetNewInt(values.Value <string>("AuditCounts").ToString()) : null, AuditPriceMoney = !string.IsNullOrEmpty(values.Value <string>("AuditPriceMoney").ToString()) ? Funs.GetNewDecimal(values.Value <string>("AuditPriceMoney").ToString()) : null }; costManageItems.Add(costManageItem); } }