/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.drpWorkArea.SelectedValue) && !string.IsNullOrEmpty(this.drpResponsibilityUnit.SelectedValue) && !string.IsNullOrEmpty(this.drpResponsibilityMan.SelectedValue)) { var updateRegistration = Funs.DB.Inspection_Registration.FirstOrDefault(x => x.RegistrationId == this.RegistrationId); if (updateRegistration != null) { updateRegistration.WorkAreaId = this.drpWorkArea.SelectedValue; updateRegistration.ResponsibilityUnitId = this.drpResponsibilityUnit.SelectedValue; updateRegistration.ProblemTypes = this.txtProblemTypes.Text.Trim(); updateRegistration.ResponsibilityManId = this.drpResponsibilityMan.SelectedValue; updateRegistration.ProblemDescription = this.txtProblemDescription.Text.Trim(); updateRegistration.TakeSteps = this.txtTakeSteps.Text.Trim(); string periodString = this.txtRectificationPeriod.Text.Trim() + " " + this.txtH.Text.Trim() + ":" + this.txtM.Text.Trim(); updateRegistration.RectificationPeriod = Funs.GetNewDateTime(periodString); Funs.DB.SubmitChanges(); BLL.LogService.AddSys_Log(this.CurrUser, periodString, updateRegistration.RegistrationId, BLL.Const.RegisterMenuId, BLL.Const.BtnModify); PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); } } else { Alert.ShowInTop("区域、责任单位、责任人为必选项", MessageBoxIcon.Warning); } }
/// <summary> /// 保存按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.Params["CheckDayDetailId"])) { Model.Check_CheckDayDetail detail = BLL.Check_CheckDayDetailService.GetCheckDayDetailByCheckDayDetailId(Request.Params["CheckDayDetailId"]); if (detail != null) { detail.CompleteStatus = true; detail.CompletedDate = Funs.GetNewDateTime(this.txtCompletedDate.Text.Trim()); BLL.Check_CheckDayDetailService.UpdateCheckDayDetail(detail); } } else if (!string.IsNullOrEmpty(Request.Params["CheckSpecialDetailId"])) { Model.Check_CheckSpecialDetail detail = BLL.Check_CheckSpecialDetailService.GetCheckSpecialDetailByCheckSpecialDetailId(Request.Params["CheckSpecialDetailId"]); if (detail != null) { detail.CompleteStatus = true; detail.CompletedDate = Funs.GetNewDateTime(this.txtCompletedDate.Text.Trim()); BLL.Check_CheckSpecialDetailService.UpdateCheckSpecialDetail(detail); } } else if (!string.IsNullOrEmpty(Request.Params["CheckColligationDetailId"])) { Model.Check_CheckColligationDetail detail = BLL.Check_CheckColligationDetailService.GetCheckColligationDetailByCheckColligationDetailId(Request.Params["CheckColligationDetailId"]); if (detail != null) { detail.CompleteStatus = true; detail.CompletedDate = Funs.GetNewDateTime(this.txtCompletedDate.Text.Trim()); BLL.Check_CheckColligationDetailService.UpdateCheckColligationDetail(detail); } } PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); }
/// <summary> /// 保存数据 /// </summary> /// <param name="type"></param> private void SaveData(string type) { Model.CostGoods_Expense expense = new Model.CostGoods_Expense { ProjectId = this.ProjectId }; //if (!string.IsNullOrEmpty(this.txtMonths.Text)) //{ // expense.Months = Funs.GetNewDateTime(this.txtMonths.Text + "-01"); //} if (this.drpYear.SelectedValue != BLL.Const._Null && this.drpMonths.SelectedValue != BLL.Const._Null) { expense.Months = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonths.SelectedValue); } expense.ExpenseCode = this.txtExpenseCode.Text.Trim(); if (this.drpUnitId.SelectedValue != BLL.Const._Null) { expense.UnitId = this.drpUnitId.SelectedValue; } expense.ReportDate = Funs.GetNewDateTime(this.txtReportDate.Text.Trim()); //expense.CheckMan = this.txtCheckMan.Text; //expense.CheckDate = Funs.GetNewDateTime(this.txtCheckDate.Text.Trim()); //expense.ApproveMan = this.txtApproveMan.Text; //expense.ApproveDate = Funs.GetNewDateTime(this.txtApproveDate.Text.Trim()); ////单据状态 expense.States = BLL.Const.State_0; if (type == BLL.Const.BtnSubmit) { expense.States = this.ctlAuditFlow.NextStep; } if (!string.IsNullOrEmpty(this.ExpenseId)) { expense.ExpenseId = this.ExpenseId; BLL.ExpenseService.UpdateExpense(expense); BLL.LogService.AddSys_Log(this.CurrUser, expense.ExpenseCode, expense.ExpenseId, BLL.Const.ProjectExpenseMenuId, BLL.Const.BtnModify); BLL.ExpenseDetailService.DeleteCostDetailByExpenseId(this.ExpenseId); } else { this.ExpenseId = SQLHelper.GetNewID(typeof(Model.CostGoods_Expense)); expense.ExpenseId = this.ExpenseId; expense.CompileMan = this.CurrUser.UserName; expense.CompileDate = DateTime.Now; BLL.ExpenseService.AddExpense(expense); BLL.LogService.AddSys_Log(this.CurrUser, expense.ExpenseCode, expense.ExpenseId, BLL.Const.ProjectExpenseMenuId, BLL.Const.BtnAdd); } //保存费用明细 BLL.ExpenseDetailService.AddCostDetail(expense.ExpenseId, "A1", Funs.GetNewDecimalOrZero(this.nbA1.Text), this.txtDefA1.Text.Trim()); BLL.ExpenseDetailService.AddCostDetail(expense.ExpenseId, "A2", Funs.GetNewDecimalOrZero(this.nbA2.Text), this.txtDefA2.Text.Trim()); BLL.ExpenseDetailService.AddCostDetail(expense.ExpenseId, "A3", Funs.GetNewDecimalOrZero(this.nbA3.Text), this.txtDefA3.Text.Trim()); BLL.ExpenseDetailService.AddCostDetail(expense.ExpenseId, "A4", Funs.GetNewDecimalOrZero(this.nbA4.Text), this.txtDefA4.Text.Trim()); BLL.ExpenseDetailService.AddCostDetail(expense.ExpenseId, "A5", Funs.GetNewDecimalOrZero(this.nbA5.Text), this.txtDefA5.Text.Trim()); BLL.ExpenseDetailService.AddCostDetail(expense.ExpenseId, "A6", Funs.GetNewDecimalOrZero(this.nbA6.Text), this.txtDefA6.Text.Trim()); BLL.ExpenseDetailService.AddCostDetail(expense.ExpenseId, "B1", Funs.GetNewDecimalOrZero(this.nbB1.Text), this.txtDefB1.Text.Trim()); BLL.ExpenseDetailService.AddCostDetail(expense.ExpenseId, "B2", Funs.GetNewDecimalOrZero(this.nbB2.Text), this.txtDefB2.Text.Trim()); BLL.ExpenseDetailService.AddCostDetail(expense.ExpenseId, "B3", Funs.GetNewDecimalOrZero(this.nbB3.Text), this.txtDefB3.Text.Trim()); ////保存流程审核数据 this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.ProjectExpenseMenuId, this.ExpenseId, (type == BLL.Const.BtnSubmit ? true : false), expense.ExpenseCode, "../CostGoods/ExpenseView.aspx?ExpenseId={0}"); }
/// <summary> /// 保存数据 /// </summary> /// <param name="p"></param> private void SaveData(bool isClose) { Model.Accident_NoFourLetoff noFourLetOff = new Model.Accident_NoFourLetoff { ProjectId = this.CurrUser.LoginProjectId, AccidentHandleId = this.AccidentHandleId, AccidentDate = Funs.GetNewDateTime(this.txtAccidentDate.Text.Trim()), FileContents = HttpUtility.HtmlEncode(this.txtFileContents.Text) }; if (this.drpRegistUnitId.SelectedValue != BLL.Const._Null) { noFourLetOff.RegistUnitId = this.drpRegistUnitId.SelectedValue; } if (this.drpHeadManId.SelectedValue != BLL.Const._Null) { noFourLetOff.HeadMan = this.drpHeadManId.SelectedValue; } noFourLetOff.RegistDate = Funs.GetNewDateTime(this.txtRegistDate.Text.Trim()); if (!string.IsNullOrEmpty(this.NoFourLetoffId)) { noFourLetOff.NoFourLetoffId = this.NoFourLetoffId; BLL.NoFourLetoffService.UpdateNoFourLetoff(noFourLetOff); BLL.LogService.AddSys_Log(this.CurrUser, this.txtAccidentHandleCode.Text, this.AccidentHandleId, BLL.Const.ProjectAccidentHandleMenuId, Const.BtnModify); } else { this.NoFourLetoffId = SQLHelper.GetNewID(typeof(Model.Accident_NoFourLetoff)); noFourLetOff.NoFourLetoffId = this.NoFourLetoffId; BLL.NoFourLetoffService.AddNoFourLetoff(noFourLetOff); BLL.LogService.AddSys_Log(this.CurrUser, this.txtAccidentHandleCode.Text, this.AccidentHandleId, BLL.Const.ProjectAccidentHandleMenuId, Const.BtnAdd); } PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); }
private void SaveNew() { if (string.IsNullOrEmpty(this.CheckDayId)) { Model.Check_CheckDay checkDay = new Model.Check_CheckDay { CheckDayId = SQLHelper.GetNewID(typeof(Model.Check_CheckDay)), CheckDayCode = this.txtCheckDayCode.Text.Trim(), ProjectId = this.ProjectId }; if (this.drpWeather.SelectedValue != BLL.Const._Null) { checkDay.WeatherId = this.drpWeather.SelectedValue; } if (this.drpCheckPerson.SelectedValue != BLL.Const._Null) { checkDay.CheckPerson = this.drpCheckPerson.SelectedValue; } checkDay.CheckTime = Funs.GetNewDateTime(this.txtCheckDate.Text.Trim()); checkDay.DaySummary = HttpUtility.HtmlEncode(this.txtDaySummary.Text.Trim()); ////单据状态 checkDay.States = BLL.Const.State_0; this.CheckDayId = checkDay.CheckDayId; checkDay.CompileMan = this.CurrUser.UserId; BLL.Check_CheckDayService.AddCheckDay(checkDay); BLL.LogService.AddSys_Log(this.CurrUser, checkDay.CheckDayCode, checkDay.CheckDayId, BLL.Const.ProjectCheckDayMenuId, BLL.Const.BtnAdd); } }
/// <summary> /// 保存按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { if (this.drpHandleStep.SelectedValue == BLL.Const._Null) { Alert.ShowInTop("请选择处理措施!", MessageBoxIcon.Warning); return; } Model.Check_CheckSpecialDetail detail = BLL.Check_CheckSpecialDetailService.GetCheckSpecialDetailByCheckSpecialDetailId(this.CheckSpecialDetailId); if (detail != null) { detail.Unqualified = this.txtUnqualified.Text.Trim(); detail.Suggestions = this.txtSuggestions.Text.Trim(); detail.WorkArea = this.txtWorkArea.Text.Trim(); if (this.drpUnit.SelectedValue != BLL.Const._Null) { detail.UnitId = this.drpUnit.SelectedValue; } if (this.drpHandleStep.SelectedValue != BLL.Const._Null) { detail.HandleStep = this.drpHandleStep.SelectedValue; } if (this.txtLimitedDate.Enabled == true) { detail.LimitedDate = Funs.GetNewDateTime(this.txtLimitedDate.Text.Trim()); } detail.CompleteStatus = Convert.ToBoolean(this.drpCompleteStatus.SelectedValue); detail.CheckContent = this.txtCheckItem.Text.Trim(); BLL.Check_CheckSpecialDetailService.UpdateCheckSpecialDetail(detail); } PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); }
/// <summary> /// 单位变化事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void drpUnitId_SelectedIndexChanged(object sender, EventArgs e) { if (this.drpUnitId.SelectedValue != BLL.Const._Null) { Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId); DateTime? date = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonths.SelectedValue + "-01"); if (project != null && date.HasValue) { List <Model.CostGoods_CostSmallDetailItem> projectDetails = BLL.CostSmallDetailItemService.GetCostDetailsByUnitId(this.CurrUser.LoginProjectId, this.drpUnitId.SelectedValue, project != null ? project.StartDate : null, date); this.hdProjectA1.Text = (from x in projectDetails where x.CostType == "A1" select x.CostMoney ?? 0).Sum().ToString(); this.hdProjectA2.Text = (from x in projectDetails where x.CostType == "A2" select x.CostMoney ?? 0).Sum().ToString(); this.hdProjectA3.Text = (from x in projectDetails where x.CostType == "A3" select x.CostMoney ?? 0).Sum().ToString(); this.hdProjectA4.Text = (from x in projectDetails where x.CostType == "A4" select x.CostMoney ?? 0).Sum().ToString(); this.hdProjectA5.Text = (from x in projectDetails where x.CostType == "A5" select x.CostMoney ?? 0).Sum().ToString(); this.hdProjectA6.Text = (from x in projectDetails where x.CostType == "A6" select x.CostMoney ?? 0).Sum().ToString(); this.hdProjectB1.Text = (from x in projectDetails where x.CostType == "B1" select x.CostMoney ?? 0).Sum().ToString(); this.hdProjectB2.Text = (from x in projectDetails where x.CostType == "B2" select x.CostMoney ?? 0).Sum().ToString(); this.hdProjectB3.Text = (from x in projectDetails where x.CostType == "B3" select x.CostMoney ?? 0).Sum().ToString(); } } else { this.hdProjectA1.Text = "0"; this.hdProjectA2.Text = "0"; this.hdProjectA3.Text = "0"; this.hdProjectA4.Text = "0"; this.hdProjectA5.Text = "0"; this.hdProjectA6.Text = "0"; this.hdProjectB1.Text = "0"; this.hdProjectB2.Text = "0"; this.hdProjectB3.Text = "0"; } }
/// <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="type"></param> private void SaveData() { Model.CostGoods_MeasuresPlan measuresPlan = new Model.CostGoods_MeasuresPlan { ProjectId = this.CurrUser.LoginProjectId, MeasuresPlanCode = this.txtMeasuresPlanCode.Text.Trim() }; if (this.drpUnitId.SelectedValue != BLL.Const._Null) { measuresPlan.UnitId = this.drpUnitId.SelectedValue; } measuresPlan.FileContents = HttpUtility.HtmlEncode(this.txtFileContents.Text); measuresPlan.CompileMan = this.CurrUser.UserId; measuresPlan.CompileDate = Funs.GetNewDateTime(this.txtCompileDate.Text.Trim()); if (!string.IsNullOrEmpty(this.MeasuresPlanId)) { measuresPlan.MeasuresPlanId = this.MeasuresPlanId; BLL.MeasuresPlanService.UpdateMeasuresPlan(measuresPlan); BLL.LogService.AddSys_Log(this.CurrUser, measuresPlan.MeasuresPlanCode, measuresPlan.MeasuresPlanId, BLL.Const.ProjectMeasuresPlanMenuId, BLL.Const.BtnModify); } else { this.MeasuresPlanId = SQLHelper.GetNewID(typeof(Model.CostGoods_MeasuresPlan)); measuresPlan.MeasuresPlanId = this.MeasuresPlanId; BLL.MeasuresPlanService.AddMeasuresPlan(measuresPlan); BLL.LogService.AddSys_Log(this.CurrUser, measuresPlan.MeasuresPlanCode, measuresPlan.MeasuresPlanId, BLL.Const.ProjectMeasuresPlanMenuId, BLL.Const.BtnAdd); } }
private void SaveNew() { if (string.IsNullOrEmpty(this.CheckColligationId)) { Model.Check_CheckColligation checkColligation = new Model.Check_CheckColligation { CheckColligationId = SQLHelper.GetNewID(typeof(Model.Check_CheckColligation)), CheckColligationCode = this.txtCheckColligationCode.Text.Trim(), ProjectId = this.ProjectId }; if (this.drpCheckType.SelectedValue != BLL.Const._Null) { checkColligation.CheckType = this.drpCheckType.SelectedValue; } //参与单位 string unitIds = string.Empty; foreach (var item in this.drpUnit.SelectedValueArray) { unitIds += item + ","; } if (!string.IsNullOrEmpty(unitIds)) { unitIds = unitIds.Substring(0, unitIds.LastIndexOf(",")); } checkColligation.PartInUnits = unitIds; if (this.drpCheckPerson.SelectedValue != BLL.Const._Null) { checkColligation.CheckPerson = this.drpCheckPerson.SelectedValue; } ///组成员 string partInPersonIds = string.Empty; string partInPersons = string.Empty; foreach (var item in this.drpPartInPersons.SelectedValueArray) { var user = BLL.UserService.GetUserByUserId(item); if (user != null) { partInPersonIds += user.UserId + ","; partInPersons += user.UserName + ","; } } if (!string.IsNullOrEmpty(partInPersonIds)) { checkColligation.PartInPersonIds = partInPersonIds.Substring(0, partInPersonIds.LastIndexOf(",")); checkColligation.PartInPersons = partInPersons.Substring(0, partInPersons.LastIndexOf(",")); } checkColligation.PartInPersonNames = this.txtPartInPersonNames.Text.Trim(); checkColligation.CheckTime = Funs.GetNewDateTime(this.txtCheckDate.Text.Trim()); checkColligation.DaySummary = HttpUtility.HtmlEncode(this.txtDaySummary.Text.Trim()); ////单据状态 checkColligation.States = BLL.Const.State_0; this.CheckColligationId = checkColligation.CheckColligationId; checkColligation.CompileMan = this.CurrUser.UserId; BLL.Check_CheckColligationService.AddCheckColligation(checkColligation); BLL.LogService.AddSys_Log(this.CurrUser, checkColligation.CheckColligationCode, checkColligation.CheckColligationId, BLL.Const.ProjectCheckColligationMenuId, BLL.Const.BtnAdd); } }
/// <summary> /// 保存数据 /// </summary> /// <param name="type"></param> private void SaveData(string type) { Model.Accident_AccidentReportOther accidentReportOther = new Model.Accident_AccidentReportOther { ProjectId = this.CurrUser.LoginProjectId, AccidentReportOtherCode = this.txtAccidentReportOtherCode.Text.Trim(), AccidentReportOtherName = this.txtAccidentReportOtherName.Text.Trim() }; if (this.drpAccidentTypeId.SelectedValue != BLL.Const._Null) { accidentReportOther.AccidentTypeId = this.drpAccidentTypeId.SelectedValue; } accidentReportOther.Abstract = this.txtAbstract.Text.Trim(); accidentReportOther.AccidentDate = Funs.GetNewDateTime(this.txtAccidentDate.Text.Trim()); accidentReportOther.WorkArea = this.txtWorkArea.Text; accidentReportOther.PeopleNum = Funs.GetNewIntOrZero(this.txtPeopleNum.Text.Trim()); if (this.drpUnitId.SelectedValue != BLL.Const._Null) { accidentReportOther.UnitId = this.drpUnitId.SelectedValue; } accidentReportOther.WorkingHoursLoss = 0; accidentReportOther.EconomicLoss = Funs.GetNewDecimalOrZero(this.txtEconomicLoss.Text.Trim()); accidentReportOther.EconomicOtherLoss = Funs.GetNewDecimalOrZero(this.txtEconomicOtherLoss.Text.Trim()); accidentReportOther.ReportMan = this.txtReportMan.Text.Trim(); accidentReportOther.ReporterUnit = this.txtReporterUnit.Text.Trim(); accidentReportOther.ReportDate = Funs.GetNewDateTime(this.txtReportDate.Text.Trim()); accidentReportOther.ProcessDescription = this.txtProcessDescription.Text.Trim(); accidentReportOther.EmergencyMeasures = this.txtEmergencyMeasures.Text.Trim(); accidentReportOther.ImmediateCause = this.txtImmediateCause.Text.Trim(); accidentReportOther.IndirectReason = this.txtIndirectReason.Text.Trim(); accidentReportOther.CorrectivePreventive = this.txtCorrectivePreventive.Text.Trim(); accidentReportOther.FileContent = HttpUtility.HtmlEncode(this.txtFileContents.Text); if (this.drpCompileMan.SelectedValue != BLL.Const._Null) { accidentReportOther.CompileMan = this.drpCompileMan.SelectedValue; } accidentReportOther.CompileDate = Funs.GetNewDateTime(this.txtCompileDate.Text.Trim()); accidentReportOther.States = BLL.Const.State_0; if (type == BLL.Const.BtnSubmit) { accidentReportOther.States = this.ctlAuditFlow.NextStep; } if (!string.IsNullOrEmpty(this.AccidentReportOtherId)) { accidentReportOther.AccidentReportOtherId = this.AccidentReportOtherId; BLL.AccidentReportOtherService.UpdateAccidentReportOther(accidentReportOther); BLL.LogService.AddSys_Log(this.CurrUser, accidentReportOther.AccidentReportOtherCode, accidentReportOther.AccidentReportOtherId, BLL.Const.ProjectAccidentReportOtherMenuId, Const.BtnModify); } else { this.AccidentReportOtherId = SQLHelper.GetNewID(typeof(Model.Accident_AccidentReportOther)); accidentReportOther.AccidentReportOtherId = this.AccidentReportOtherId; BLL.AccidentReportOtherService.AddAccidentReportOther(accidentReportOther); BLL.LogService.AddSys_Log(this.CurrUser, accidentReportOther.AccidentReportOtherCode, accidentReportOther.AccidentReportOtherId, BLL.Const.ProjectAccidentReportOtherMenuId, Const.BtnAdd); } //保存流程审核数据 this.ctlAuditFlow.btnSaveData(this.CurrUser.LoginProjectId, BLL.Const.ProjectAccidentReportOtherMenuId, this.AccidentReportOtherId, (type == BLL.Const.BtnSubmit ? true : false), accidentReportOther.AccidentReportOtherCode, "../Accident/AccidentReportOtherView.aspx?AccidentReportOtherId={0}"); }
/// <summary> /// 保存数据 /// </summary> /// <param name="type"></param> private void SaveData(string type) { Model.Check_IncentiveNotice incentiveNotice = new Model.Check_IncentiveNotice { ProjectId = this.ProjectId, IncentiveNoticeCode = this.txtIncentiveNoticeCode.Text.Trim(), UnitId = this.drpUnit.SelectedValue, IncentiveDate = Funs.GetNewDateTime(this.txtIncentiveDate.Text.Trim()) }; if (this.drpTeamGroup.SelectedValue != BLL.Const._Null) { incentiveNotice.TeamGroupId = this.drpTeamGroup.SelectedValue; } if (this.drpPerson.SelectedValue != BLL.Const._Null) { incentiveNotice.PersonId = this.drpPerson.SelectedValue; } incentiveNotice.BasicItem = this.txtBasicItem.Text.Trim(); if (this.drpRewardType.SelectedValue != BLL.Const._Null) { incentiveNotice.RewardType = this.drpRewardType.SelectedValue; } incentiveNotice.IncentiveMoney = Funs.GetNewDecimalOrZero(this.txtPayMoney.Text.Trim()); incentiveNotice.TitleReward = this.txtTitleReward.Text.Trim(); incentiveNotice.MattleReward = this.txtMattleReward.Text.Trim(); incentiveNotice.FileContents = HttpUtility.HtmlEncode(this.txtFileContents.Text); incentiveNotice.AttachUrl = this.AttachUrl; incentiveNotice.CompileMan = this.CurrUser.UserId; incentiveNotice.CompileDate = Funs.GetNewDateTime(this.txtIncentiveDate.Text.Trim()); if (this.drpSignMan.SelectedValue != BLL.Const._Null) { incentiveNotice.SignMan = this.drpSignMan.SelectedValue; } if (this.drpApproveMan.SelectedValue != BLL.Const._Null) { incentiveNotice.ApproveMan = this.drpApproveMan.SelectedValue; } incentiveNotice.States = BLL.Const.State_0; if (type == BLL.Const.BtnSubmit) { incentiveNotice.States = this.ctlAuditFlow.NextStep; } incentiveNotice.Currency = this.txtCurrency.Text.Trim(); if (!string.IsNullOrEmpty(this.IncentiveNoticeId)) { incentiveNotice.IncentiveNoticeId = this.IncentiveNoticeId; BLL.IncentiveNoticeService.UpdateIncentiveNotice(incentiveNotice); BLL.LogService.AddSys_Log(this.CurrUser, incentiveNotice.IncentiveNoticeCode, incentiveNotice.IncentiveNoticeId, BLL.Const.ProjectIncentiveNoticeMenuId, BLL.Const.BtnModify); } else { this.IncentiveNoticeId = SQLHelper.GetNewID(typeof(Model.Check_IncentiveNotice)); incentiveNotice.IncentiveNoticeId = this.IncentiveNoticeId; BLL.IncentiveNoticeService.AddIncentiveNotice(incentiveNotice); BLL.LogService.AddSys_Log(this.CurrUser, incentiveNotice.IncentiveNoticeCode, incentiveNotice.IncentiveNoticeId, BLL.Const.ProjectIncentiveNoticeMenuId, BLL.Const.BtnAdd); } ////保存流程审核数据 this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.ProjectIncentiveNoticeMenuId, this.IncentiveNoticeId, (type == BLL.Const.BtnSubmit ? true : false), incentiveNotice.IncentiveNoticeCode, "../Check/IncentiveNoticeView.aspx?IncentiveNoticeId={0}"); }
/// <summary> /// /// </summary> private void InitTextValue() { string unitId = this.drpUnitId.SelectedValue; int year = Funs.GetNewIntOrZero(this.drpYear.SelectedValue); int month = Funs.GetNewIntOrZero(this.drpMonths.SelectedValue); DateTime?Months = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonths.SelectedValue); this.HSSECostManageId = string.Empty; this.HSSECostUnitManageId = string.Empty; decimal pMainIncome = 0, pConstructionIncome = 0, pSafetyCosts = 0; var sumHsseCostMange = BLL.HSSECostManageService.GetListHSSECostManageByProjectIdMonth(this.ProjectId, Months); if (sumHsseCostMange.Count() > 0) { pMainIncome = sumHsseCostMange.Sum(x => x.MainIncome) ?? 0; pConstructionIncome = sumHsseCostMange.Sum(x => x.ConstructionIncome) ?? 0; pSafetyCosts = sumHsseCostMange.Sum(x => x.SafetyCosts) ?? 0; } Model.CostGoods_HSSECostUnitManage hsseCostUnitManage = new Model.CostGoods_HSSECostUnitManage(); var hsseCostManage = BLL.HSSECostManageService.GetHSSECostManageByProjectIdMonth(ProjectId, year, month); if (hsseCostManage != null) { this.HSSECostManageId = hsseCostManage.HSSECostManageId; this.txtCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(hsseCostManage.HSSECostManageId); this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", hsseCostManage.ReportDate); this.txtMainIncome.Text = hsseCostManage.MainIncome.ToString(); this.txtProjectMainIncome.Text = (pMainIncome + (hsseCostManage.MainIncome ?? 0)).ToString(); this.txtRemark1.Text = hsseCostManage.Remark1; this.txtConstructionIncome.Text = hsseCostManage.ConstructionIncome.ToString(); this.txtProjectConstructionIncome.Text = (pConstructionIncome + (hsseCostManage.ConstructionIncome ?? 0)).ToString(); this.txtRemark2.Text = hsseCostManage.Remark2; this.txtSafetyCosts.Text = hsseCostManage.SafetyCosts.ToString(); this.txtProjectSafetyCosts.Text = (pSafetyCosts + (hsseCostManage.SafetyCosts ?? 0)).ToString(); this.txtRemark3.Text = hsseCostManage.Remark3; hsseCostUnitManage = BLL.HSSECostUnitManageService.GetHSSECostUnitManageByHSSECostManageIdUnitId(this.HSSECostManageId, this.drpUnitId.SelectedValue); if (hsseCostManage.States == BLL.Const.State_2) { this.btnSave.Hidden = true; this.btnSubmit.Hidden = true; } } else { this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); this.txtCode.Text = BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.ProjectHSSECostManageMenuId, this.ProjectId, string.Empty); this.txtMainIncome.Text = "0"; this.txtConstructionIncome.Text = "0"; this.txtSafetyCosts.Text = "0"; this.txtProjectMainIncome.Text = pMainIncome.ToString(); this.txtProjectConstructionIncome.Text = pConstructionIncome.ToString(); this.txtProjectSafetyCosts.Text = pSafetyCosts.ToString(); hsseCostUnitManage = BLL.HSSECostUnitManageService.GetHSSECostUnitManageByProjectIdUnitIdYearMonth(this.ProjectId, this.drpUnitId.SelectedValue, year, month); } this.InitTextUnitValue(hsseCostUnitManage); }
/// <summary> /// 保存按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { if (this.drpHandleStep.SelectedValue == BLL.Const._Null) { Alert.ShowInTop("请选择处理措施!", MessageBoxIcon.Warning); return; } if (this.drpHiddenDangerLevel.SelectedValue == BLL.Const._Null) { Alert.ShowInTop("请选择隐患级别!", MessageBoxIcon.Warning); return; } Model.Check_CheckColligationDetail detail = new Model.Check_CheckColligationDetail(); detail.Unqualified = this.txtUnqualified.Text.Trim(); detail.WorkArea = this.txtWorkArea.Text.Trim(); detail.LimitedDate = Funs.GetNewDateTime(this.txtLimitedDate.Text.Trim()); detail.HiddenDangerType = this.txtHiddenDangerType.Text.Trim(); if (this.drpHiddenDangerLevel.SelectedValue != BLL.Const._Null) { detail.HiddenDangerLevel = this.drpHiddenDangerLevel.SelectedValue; } if (this.drpUnit.SelectedValue != BLL.Const._Null) { detail.UnitId = this.drpUnit.SelectedValue; } if (this.drpPerson.SelectedValue != BLL.Const._Null) { detail.PersonId = this.drpPerson.SelectedValue; } detail.Suggestions = this.txtSuggestions.Text.Trim(); if (drpHandleStep.SelectedItem != null) { string hs = string.Empty; foreach (ListItem item in drpHandleStep.SelectedItemArray) { hs += item.Value + "|"; } if (!string.IsNullOrEmpty(hs)) { hs = hs.Substring(0, hs.LastIndexOf('|')); } detail.HandleStep = hs; } if (!string.IsNullOrEmpty(this.CheckColligationDetailId)) { detail.CheckColligationDetailId = this.CheckColligationDetailId; BLL.Check_CheckColligationDetailService.UpdateCheckColligationDetail(detail); } else { detail.CheckColligationId = Request.Params["CheckColligationId"]; this.CheckColligationDetailId = SQLHelper.GetNewID(typeof(Model.Check_CheckColligationDetail)); detail.CheckColligationDetailId = this.CheckColligationDetailId; BLL.Check_CheckColligationDetailService.AddCheckColligationDetail(detail); } PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); }
/// <summary> /// 保存数据 /// </summary> /// <param name="p"></param> private void SaveData(bool isColse) { Model.Check_RectifyNotices rectifyNotices = new Model.Check_RectifyNotices { ProjectId = this.ProjectId, RectifyNoticesCode = this.txtRectifyNoticesCode.Text.Trim(), CheckedDate = Funs.GetNewDateTime(this.txtCheckedDate.Text.Trim()), WrongContent = HttpUtility.HtmlEncode(this.txtWrongContent.Text.Trim()), SignDate = Funs.GetNewDateTime(this.txtSignDate.Text.Trim()), CompleteStatus = HttpUtility.HtmlEncode(this.txtCompleteStatus.Text.Trim()), DutyPerson = this.txtDutyPerson.Text.Trim(), CompleteDate = Funs.GetNewDateTime(this.txtCompleteDate.Text.Trim()), IsRectify = Convert.ToBoolean(this.drpIsRectify.SelectedValue), ReCheckDate = Funs.GetNewDateTime(this.txtReCheckDate.Text.Trim()), }; if (this.drpUnitId.SelectedValue != BLL.Const._Null) { rectifyNotices.UnitId = this.drpUnitId.SelectedValue; } if (this.drpDutyPerson.SelectedValue != BLL.Const._Null) { rectifyNotices.DutyPersonId = this.drpDutyPerson.SelectedValue; } if (this.drpWorkAreaId.SelectedValue != BLL.Const._Null) { rectifyNotices.WorkAreaId = this.drpWorkAreaId.SelectedValue; } if (this.drpSignPerson.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpSignPerson.SelectedValue)) { rectifyNotices.SignPerson = this.drpSignPerson.SelectedValue; } if (!string.IsNullOrEmpty(this.drpCheckPerson.SelectedValue) && this.drpCheckPerson.SelectedValue != BLL.Const._Null) { rectifyNotices.CheckPerson = this.drpCheckPerson.SelectedValue; } if (!string.IsNullOrEmpty(this.RectifyNoticeId)) { rectifyNotices.RectifyNoticesId = this.RectifyNoticeId; BLL.RectifyNoticesService.UpdateRectifyNotices(rectifyNotices); BLL.LogService.AddSys_Log(this.CurrUser, rectifyNotices.RectifyNoticesCode, rectifyNotices.RectifyNoticesId, BLL.Const.ProjectRectifyNoticeMenuId, BLL.Const.BtnModify); } else { this.RectifyNoticeId = SQLHelper.GetNewID(typeof(Model.Check_RectifyNotices)); rectifyNotices.RectifyNoticesId = this.RectifyNoticeId; BLL.RectifyNoticesService.AddRectifyNotices(rectifyNotices); BLL.LogService.AddSys_Log(this.CurrUser, rectifyNotices.RectifyNoticesCode, rectifyNotices.RectifyNoticesId, BLL.Const.ProjectRectifyNoticeMenuId, BLL.Const.BtnAdd); ///写入工程师日志 BLL.HSSELogService.CollectHSSELog(rectifyNotices.ProjectId, rectifyNotices.SignPerson, rectifyNotices.SignDate, "22", rectifyNotices.WrongContent, Const.BtnAdd, 1); } if (isColse) { PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } }
/// <summary> /// 输入框变化事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Text_TextChanged(object sender, EventArgs e) { decimal? pMainIncome = 0, pConstructionIncome = 0, pSafetyCosts = 0; decimal? pEngineeringCost = 0, pSubUnitCost = 0, pAuditedSubUnitCost = 0; DateTime?Months = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonths.SelectedValue); var sumHSSECostManage = BLL.HSSECostManageService.GetListHSSECostManageByProjectIdMonth(this.ProjectId, Months); if (sumHSSECostManage.Count() > 0) { pMainIncome = sumHSSECostManage.Sum(x => x.MainIncome ?? 0); pConstructionIncome = sumHSSECostManage.Sum(x => x.ConstructionIncome ?? 0); pSafetyCosts = sumHSSECostManage.Sum(x => x.SafetyCosts ?? 0); } var sumHSSECostUnitManage = BLL.HSSECostUnitManageService.GetHSSECostUnitManageListByProjectIdUnitIdMonth(this.ProjectId, this.drpUnitId.SelectedValue, Months); if (sumHSSECostUnitManage.Count() > 0) { pEngineeringCost = sumHSSECostUnitManage.Sum(x => x.EngineeringCost ?? 0); pSubUnitCost = sumHSSECostUnitManage.Sum(x => x.SubUnitCost ?? 0); pAuditedSubUnitCost = sumHSSECostUnitManage.Sum(x => x.AuditedSubUnitCost ?? 0); } decimal?EngineeringCost = 0, AuditedSubUnitCost = 0; this.txtProjectMainIncome.Text = (pMainIncome + Funs.GetNewDecimalOrZero(this.txtMainIncome.Text)).ToString(); this.txtProjectConstructionIncome.Text = (pConstructionIncome + Funs.GetNewDecimalOrZero(this.txtConstructionIncome.Text)).ToString(); this.txtProjectSafetyCosts.Text = (pSafetyCosts + Funs.GetNewDecimalOrZero(this.txtSafetyCosts.Text)).ToString(); EngineeringCost = Funs.GetNewDecimalOrZero(this.txtEngineeringCost.Text); AuditedSubUnitCost = Funs.GetNewDecimalOrZero(this.txtAuditedSubUnitCost.Text); pEngineeringCost = pEngineeringCost + EngineeringCost; pAuditedSubUnitCost = pAuditedSubUnitCost + AuditedSubUnitCost; this.txtProjectEngineeringCost.Text = (pEngineeringCost).ToString(); this.txtProjectSubUnitCost.Text = (pConstructionIncome + Funs.GetNewDecimalOrZero(this.txtSubUnitCost.Text)).ToString(); this.txtProjectAuditedSubUnitCost.Text = (pAuditedSubUnitCost).ToString(); if (EngineeringCost.HasValue && EngineeringCost != 0 && AuditedSubUnitCost.HasValue) { this.txtCostRatio.Text = Math.Round((AuditedSubUnitCost / EngineeringCost * 100).Value, 2).ToString() + "%";; } else { this.txtCostRatio.Text = "0%"; } if (pEngineeringCost.HasValue && pEngineeringCost != 0 && pAuditedSubUnitCost.HasValue) { this.txtProjectCostRatio.Text = Math.Round((pAuditedSubUnitCost / pEngineeringCost * 100).Value, 2).ToString() + "%";; } else { this.txtProjectCostRatio.Text = "0%"; } }
/// <summary> /// 保存数据 /// </summary> /// <param name="type"></param> private void SaveData(string type) { Model.Check_CheckSpecial checkSpecial = new Model.Check_CheckSpecial { CheckSpecialCode = this.txtCheckSpecialCode.Text.Trim(), ProjectId = this.ProjectId }; ///组成员 string partInPersonIds = string.Empty; string partInPersons = string.Empty; foreach (var item in this.drpPartInPersons.SelectedValueArray) { var user = BLL.UserService.GetUserByUserId(item); if (user != null) { partInPersonIds += user.UserId + ","; partInPersons += user.UserName + ","; } } if (!string.IsNullOrEmpty(partInPersonIds)) { checkSpecial.PartInPersonIds = partInPersonIds.Substring(0, partInPersonIds.LastIndexOf(",")); checkSpecial.PartInPersons = partInPersons.Substring(0, partInPersons.LastIndexOf(",")); } checkSpecial.PartInPersonNames = this.txtPartInPersonNames.Text.Trim(); checkSpecial.CheckTime = Funs.GetNewDateTime(this.txtCheckDate.Text.Trim()); ////单据状态 checkSpecial.States = Const.State_0; if (type == Const.BtnSubmit) { checkSpecial.States = Const.State_1; } if (!string.IsNullOrEmpty(this.drpSupCheckItemSet.SelectedValue) && this.drpSupCheckItemSet.SelectedValue != Const._Null) { checkSpecial.CheckItemSetId = this.drpSupCheckItemSet.SelectedValue; } if (!string.IsNullOrEmpty(this.CheckSpecialId)) { checkSpecial.CheckSpecialId = this.CheckSpecialId; Check_CheckSpecialService.UpdateCheckSpecial(checkSpecial); LogService.AddSys_Log(this.CurrUser, checkSpecial.CheckSpecialCode, checkSpecial.CheckSpecialId, BLL.Const.ProjectCheckSpecialMenuId, BLL.Const.BtnModify); Check_CheckSpecialDetailService.DeleteCheckSpecialDetails(this.CheckSpecialId); } else { checkSpecial.CheckSpecialId = SQLHelper.GetNewID(typeof(Model.Check_CheckSpecial)); this.CheckSpecialId = checkSpecial.CheckSpecialId; checkSpecial.CompileMan = this.CurrUser.UserId; Check_CheckSpecialService.AddCheckSpecial(checkSpecial); LogService.AddSys_Log(this.CurrUser, checkSpecial.CheckSpecialCode, checkSpecial.CheckSpecialId, BLL.Const.ProjectCheckSpecialMenuId, BLL.Const.BtnAdd); } this.SaveDetail(type, checkSpecial); }
/// <summary> /// 收集页面信息 /// </summary> /// <returns></returns> private List <Model.Check_RectifyNoticesItem> CollectGridInfo() { List <Model.Check_RectifyNoticesItem> getViewList = new List <Model.Check_RectifyNoticesItem>(); for (int i = 0; i < Grid1.Rows.Count; i++) { var str = Grid1.Rows[i].DataKeys[1] + ""; if (str.IndexOf("True") > -1) { Model.Check_RectifyNoticesItem newView = new Model.Check_RectifyNoticesItem { RectifyNoticesItemId = Grid1.Rows[i].DataKeys[0].ToString(), RectifyNoticesId = this.RectifyNoticesId, WrongContent = Grid1.Rows[i].Values[0].ToString(), Requirement = Grid1.Rows[i].Values[1].ToString(), LimitTime = Convert.ToDateTime(Grid1.Rows[i].Values[2].ToString()), RectifyResults = Grid1.Rows[i].Values[3].ToString(), IsRectify = true }; getViewList.Add(newView); } else if (str.IndexOf("False") > -1) { Model.Check_RectifyNoticesItem newView = new Model.Check_RectifyNoticesItem { RectifyNoticesItemId = Grid1.Rows[i].DataKeys[0].ToString(), RectifyNoticesId = this.RectifyNoticesId, WrongContent = Grid1.Rows[i].Values[0].ToString(), Requirement = Grid1.Rows[i].Values[1].ToString(), LimitTime = Convert.ToDateTime(Grid1.Rows[i].Values[2].ToString()), RectifyResults = Grid1.Rows[i].Values[3].ToString(), IsRectify = false }; getViewList.Add(newView); } else { Model.Check_RectifyNoticesItem newView = new Model.Check_RectifyNoticesItem { RectifyNoticesItemId = Grid1.Rows[i].DataKeys[0].ToString(), RectifyNoticesId = this.RectifyNoticesId, WrongContent = Grid1.Rows[i].Values[0].ToString(), Requirement = Grid1.Rows[i].Values[1].ToString(), LimitTime = Funs.GetNewDateTime(Grid1.Rows[i].Values[2].ToString()), RectifyResults = Grid1.Rows[i].Values[3].ToString() }; getViewList.Add(newView); } } return(getViewList); }
/// <summary> /// 绑定数据 /// </summary> private void BindGrid() { string strSql = @" SELECT MeasuresPlan.MeasuresPlanId, " + @" MeasuresPlan.ProjectId," + @" CodeRecords.Code AS MeasuresPlanCode," + @" MeasuresPlan.UnitId," + @" Users.UserName AS CompileMan," + @" MeasuresPlan.CompileDate," + @" Unit.UnitName" + @" FROM CostGoods_MeasuresPlan AS MeasuresPlan " + @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON MeasuresPlan.MeasuresPlanId = CodeRecords.DataId " + @" LEFT JOIN Sys_User AS Users ON Users.UserId = MeasuresPlan.CompileMan " + @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = MeasuresPlan.UnitId WHERE 1=1 "; List <SqlParameter> listStr = new List <SqlParameter>(); strSql += " AND MeasuresPlan.ProjectId = @ProjectId"; if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值 { listStr.Add(new SqlParameter("@ProjectId", Request.Params["projectId"])); } else { listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); } if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId)) { strSql += " AND MeasuresPlan.UnitId = @UnitId"; ///状态为已完成 listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId)); } if (!string.IsNullOrEmpty(this.txtUnitName.Text.Trim())) { strSql += " AND Unit.UnitName LIKE @UnitName "; listStr.Add(new SqlParameter("@UnitName", "%" + this.txtUnitName.Text.Trim() + "%")); } if (!string.IsNullOrEmpty(this.txtStartDate.Text.Trim())) { strSql += " AND MeasuresPlan.CompileDate >= @StartDate "; listStr.Add(new SqlParameter("@StartDate", Funs.GetNewDateTime(this.txtStartDate.Text.Trim()))); } if (!string.IsNullOrEmpty(this.txtEndDate.Text.Trim())) { strSql += " AND MeasuresPlan.CompileDate <= @EndDate "; listStr.Add(new SqlParameter("@EndDate", Funs.GetNewDateTime(this.txtEndDate.Text.Trim()))); } SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); Grid1.RecordCount = tb.Rows.Count; tb = GetFilteredTable(Grid1.FilteredData, tb); var table = this.GetPagedDataTable(Grid1, tb); Grid1.DataSource = table; Grid1.DataBind(); }
/// <summary> /// 保存数据 /// </summary> /// <param name="type"></param> private void SaveData(string type) { if (!BLL.CommonService.IsMainUnitOrAdmin(this.CurrUser.UserId) && type == BLL.Const.BtnSubmit && this.ctlAuditFlow.NextStep == BLL.Const.State_2) { Alert.ShowInParent("分包商不能关闭审核流程", MessageBoxIcon.Warning); return; } Model.CostGoods_CostManage costManage = new Model.CostGoods_CostManage { ProjectId = this.ProjectId, CostManageCode = this.txtCostManageCode.Text.Trim(), CostManageName = this.txtCostManageName.Text.Trim() }; if (this.drpUnitId.SelectedValue != BLL.Const._Null) { costManage.UnitId = this.drpUnitId.SelectedValue; } costManage.ContractNum = this.txtContractNum.Text.Trim(); costManage.CostManageDate = Funs.GetNewDateTime(this.txtCostManageDate.Text.Trim()); costManage.Opinion = this.txtOpinion.Text.Trim(); costManage.SubHSE = this.txtSubHSE.Text.Trim(); costManage.SubCN = this.txtSubCN.Text.Trim(); costManage.SubProject = this.txtSubProject.Text.Trim(); costManage.CompileMan = this.CurrUser.UserId; costManage.CompileDate = DateTime.Now; costManage.States = BLL.Const.State_0; if (type == BLL.Const.BtnSubmit) { costManage.States = this.ctlAuditFlow.NextStep; } if (!string.IsNullOrEmpty(this.CostManageId)) { costManage.CostManageId = this.CostManageId; BLL.CostManageService.UpdateCostManage(costManage); BLL.LogService.AddSys_Log(this.CurrUser, costManage.CostManageCode, costManage.CostManageId, BLL.Const.ProjectCostManageMenuId, BLL.Const.BtnModify); } else { this.CostManageId = SQLHelper.GetNewID(typeof(Model.CostGoods_CostManage)); costManage.CostManageId = this.CostManageId; BLL.CostManageService.AddCostManage(costManage); BLL.LogService.AddSys_Log(this.CurrUser, costManage.CostManageCode, costManage.CostManageId, BLL.Const.ProjectCostManageMenuId, BLL.Const.BtnAdd); } jerqueSaveMonthPlanList(); BLL.CostManageItemService.DeleteCostManageItemByCostManageId(this.CostManageId); foreach (var costManageItem in costManageItems) { costManageItem.CostManageId = this.CostManageId; BLL.CostManageItemService.AddCostManageItem(costManageItem); } ////保存流程审核数据 this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.ProjectCostManageMenuId, this.CostManageId, (type == BLL.Const.BtnSubmit ? true : false), costManage.CostManageName, "../CostGoods/CostManageView.aspx?CostManageId={0}"); }
/// <summary> /// 查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void TextBox_TextChanged(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.txtStartDate.Text.Trim()) && !string.IsNullOrEmpty(this.txtEndDate.Text.Trim())) { if (Funs.GetNewDateTime(this.txtEndDate.Text.Trim()) < Funs.GetNewDateTime(this.txtStartDate.Text.Trim())) { Alert.ShowInTop("开始日期不能大于结束日期!", MessageBoxIcon.Warning); return; } } BindGrid(); }
/// <summary> /// 查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void TextBox_TextChanged(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.txtStartRectificationTime.Text.Trim()) && !string.IsNullOrEmpty(this.txtEndRectificationTime.Text.Trim())) { if (Funs.GetNewDateTime(this.txtStartRectificationTime.Text.Trim()) > Funs.GetNewDateTime(this.txtEndRectificationTime.Text.Trim())) { Alert.ShowInTop("开始时间不能大于结束时间!", MessageBoxIcon.Warning); return; } } this.BindGrid(); }
/// <summary> /// 保存数据 /// </summary> /// <param name="type"></param> private void SaveData(string type) { Model.CostGoods_GoodsManage goodsManage = new Model.CostGoods_GoodsManage { ProjectId = this.ProjectId, GoodsCode = this.txtGoodsCode.Text.Trim(), GoodsName = this.txtGoodsName.Text.Trim() }; if (this.drpUnitId.SelectedValue != BLL.Const._Null) { goodsManage.UnitId = this.drpUnitId.SelectedValue; } if (this.drpGoodsCategory.SelectedValue != BLL.Const._Null) { goodsManage.GoodsCategoryId = this.drpGoodsCategory.SelectedValue; } goodsManage.SizeModel = this.txtSizeModel.Text.Trim(); goodsManage.FactoryCode = this.txtFactoryCode.Text.Trim(); goodsManage.CheckDate = Funs.GetNewDateTime(this.txtCheckDate.Text); if (!string.IsNullOrEmpty(this.txtEnableYear.Text.Trim())) { goodsManage.EnableYear = Funs.GetNewIntOrZero(this.txtEnableYear.Text); } if (this.drpCheckPerson.SelectedValue != BLL.Const._Null) { goodsManage.CheckPerson = this.drpCheckPerson.SelectedValue; } goodsManage.InTime = Funs.GetNewDateTime(this.txtInTime.Text.Trim()); goodsManage.States = BLL.Const.State_0; if (type == BLL.Const.BtnSubmit) { goodsManage.States = this.ctlAuditFlow.NextStep; } goodsManage.CompileMan = this.CurrUser.UserId; goodsManage.CompileDate = DateTime.Now; goodsManage.Remark = this.txtRemark.Text.Trim(); if (!string.IsNullOrEmpty(this.GoodsManageId)) { goodsManage.GoodsManageId = this.GoodsManageId; BLL.GoodsManageService.UpdateGoodsManage(goodsManage); BLL.LogService.AddSys_Log(this.CurrUser, goodsManage.GoodsCode, goodsManage.GoodsManageId, BLL.Const.GoodsManageMenuId, BLL.Const.BtnAdd); } else { this.GoodsManageId = SQLHelper.GetNewID(typeof(Model.CostGoods_GoodsManage)); goodsManage.GoodsManageId = this.GoodsManageId; BLL.GoodsManageService.AddGoodsManage(goodsManage); BLL.LogService.AddSys_Log(this.CurrUser, goodsManage.GoodsCode, goodsManage.GoodsManageId,BLL.Const.GoodsManageMenuId,BLL.Const.BtnModify); } ////保存流程审核数据 this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.GoodsManageMenuId, this.GoodsManageId, (type == BLL.Const.BtnSubmit ? true : false), goodsManage.GoodsName, "../CostGoods/GoodsManageView.aspx?GoodsManageId={0}"); }
/// <summary> /// 保存数据 /// </summary> /// <param name="type"></param> private void SaveData(string type) { Model.Check_ContactList newContactList = new Model.Check_ContactList { ProjectId = this.ProjectId, Code = this.txtCode.Text.Trim(), CompileDate = Funs.GetNewDateTime(this.txtCompileDate.Text.Trim()) }; if (this.drpCompileMan.SelectedValue != BLL.Const._Null) { newContactList.CompileMan = this.drpCompileMan.SelectedValue; } if (this.drpSponsorUnit.SelectedValue != BLL.Const._Null) { newContactList.SponsorUnitId = this.drpSponsorUnit.SelectedValue; } ///接收单位 string receivingUnits = string.Empty; string receivingUnitNames = string.Empty; foreach (var item in this.drpReceivingUnits.SelectedValueArray) { var role = BLL.UnitService.GetUnitByUnitId(item); if (role != null) { receivingUnits += role.UnitId + ","; receivingUnitNames += role.UnitName + ","; } } if (!string.IsNullOrEmpty(receivingUnits)) { newContactList.ReceivingUnits = receivingUnits.Substring(0, receivingUnits.LastIndexOf(",")); newContactList.ReceivingUnitNames = receivingUnitNames.Substring(0, receivingUnitNames.LastIndexOf(",")); } newContactList.Remark = this.txtRemark.Text.Trim(); newContactList.SeeFile = HttpUtility.HtmlEncode(this.txtSeeFile.Text); if (!string.IsNullOrEmpty(this.ContactListId)) { newContactList.ContactListId = this.ContactListId; BLL.ContactListService.UpdateContactList(newContactList); BLL.LogService.AddSys_Log(this.CurrUser, newContactList.Code, newContactList.ContactListId, BLL.Const.ProjectContactListMenuId, BLL.Const.BtnModify); } else { this.ContactListId = SQLHelper.GetNewID(typeof(Model.Check_ContactList)); newContactList.ContactListId = this.ContactListId; BLL.ContactListService.AddContactList(newContactList); BLL.LogService.AddSys_Log(this.CurrUser, newContactList.Code, newContactList.ContactListId, BLL.Const.ProjectContactListMenuId, BLL.Const.BtnAdd); } }
/// <summary> /// 保存数据 /// </summary> /// <param name="p"></param> private void SaveData(bool isColse) { Model.Check_SupervisionNotice SupervisionNotice = new Model.Check_SupervisionNotice { ProjectId = this.CurrUser.LoginProjectId, SupervisionNoticeCode = this.txtSupervisionNoticeCode.Text.Trim() }; if (this.drpUnitId.SelectedValue != BLL.Const._Null) { SupervisionNotice.UnitId = this.drpUnitId.SelectedValue; } if (this.drpWorkAreaId.SelectedValue != BLL.Const._Null) { SupervisionNotice.WorkAreaId = this.drpWorkAreaId.SelectedValue; } SupervisionNotice.CheckedDate = Funs.GetNewDateTime(this.txtCheckedDate.Text.Trim()); SupervisionNotice.WrongContent = this.txtWrongContent.Text.Trim(); SupervisionNotice.SignPerson = this.CurrUser.UserId; SupervisionNotice.SignDate = Funs.GetNewDateTime(this.txtSignDate.Text.Trim()); SupervisionNotice.CompleteStatus = this.txtCompleteStatus.Text.Trim(); SupervisionNotice.DutyPerson = this.txtDutyPerson.Text.Trim(); SupervisionNotice.CompleteDate = Funs.GetNewDateTime(this.txtCompleteDate.Text.Trim()); SupervisionNotice.IsRectify = Convert.ToBoolean(this.drpIsRectify.SelectedValue); if (this.drpCheckPerson.SelectedValue != BLL.Const._Null) { SupervisionNotice.CheckPerson = this.drpCheckPerson.SelectedValue; } if (!string.IsNullOrEmpty(this.SupervisionNoticeId)) { SupervisionNotice.SupervisionNoticeId = this.SupervisionNoticeId; BLL.SupervisionNoticeService.UpdateSupervisionNotice(SupervisionNotice); BLL.LogService.AddSys_Log(this.CurrUser, SupervisionNotice.SupervisionNoticeCode, SupervisionNotice.SupervisionNoticeId, BLL.Const.ProjectSupervisionNoticeMenuId, BLL.Const.BtnModify); } else { this.SupervisionNoticeId = SQLHelper.GetNewID(typeof(Model.Check_SupervisionNotice)); SupervisionNotice.SupervisionNoticeId = this.SupervisionNoticeId; BLL.SupervisionNoticeService.AddSupervisionNotice(SupervisionNotice); BLL.LogService.AddSys_Log(this.CurrUser, SupervisionNotice.SupervisionNoticeCode, SupervisionNotice.SupervisionNoticeId, BLL.Const.ProjectSupervisionNoticeMenuId, BLL.Const.BtnAdd); } if (isColse) { PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } }
/// <summary> /// 保存数据 /// </summary> /// <param name="type"></param> private void SaveData(string type) { Model.Administrative_ManageCheck manageCheck = new Model.Administrative_ManageCheck { ProjectId = this.ProjectId, ManageCheckCode = this.txtManageCheckCode.Text.Trim() }; if (this.drpCheckTypeCode.SelectedValue != BLL.Const._Null) { manageCheck.CheckTypeCode = this.drpCheckTypeCode.SelectedValue; } manageCheck.SupplyCheck = this.txtSupplyCheck.Text.Trim(); manageCheck.IsSupplyCheck = Convert.ToBoolean(this.drpIsSupplyCheck.SelectedValue); manageCheck.ViolationRule = Funs.GetNewInt(this.drpViolationRule.SelectedValue); manageCheck.CheckPerson = this.txtCheckPerson.Text.Trim(); manageCheck.CheckTime = Funs.GetNewDateTime(this.txtCheckTime.Text.Trim()); manageCheck.VerifyPerson = this.txtVerifyPerson.Text.Trim(); manageCheck.VerifyTime = Funs.GetNewDateTime(this.txtVerifyTime.Text.Trim()); manageCheck.States = BLL.Const.State_0; if (type == BLL.Const.BtnSubmit) { manageCheck.States = this.ctlAuditFlow.NextStep; } manageCheck.CompileMan = this.CurrUser.UserId; manageCheck.CompileDate = DateTime.Now; BLL.ManageCheckItemService.DeleteMangeCheckItemByManageCheckId(this.ManageCheckId); if (!string.IsNullOrEmpty(this.ManageCheckId)) { manageCheck.ManageCheckId = this.ManageCheckId; BLL.ManageCheckService.UpdateManageCheck(manageCheck); BLL.LogService.AddSys_Log(this.CurrUser, manageCheck.ManageCheckCode, manageCheck.ManageCheckId, BLL.Const.ManageCheckMenuId, BLL.Const.BtnModify); } else { this.ManageCheckId = SQLHelper.GetNewID(typeof(Model.Administrative_ManageCheck)); manageCheck.ManageCheckId = this.ManageCheckId; BLL.ManageCheckService.AddManageCheck(manageCheck); BLL.LogService.AddSys_Log(this.CurrUser, manageCheck.ManageCheckCode, manageCheck.ManageCheckId, BLL.Const.ManageCheckMenuId, BLL.Const.BtnAdd); } GetGvManageCheck(this.ManageCheckId); ////保存流程审核数据 this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.ManageCheckMenuId, this.ManageCheckId, (type == BLL.Const.BtnSubmit ? true : false), this.drpCheckTypeCode.SelectedText, "../Administrative/ManageCheckView.aspx?ManageCheckId={0}"); }
/// <summary> /// 保存数据 /// </summary> /// <param name="type"></param> private void SaveData(string type) { Model.Check_CheckDay checkDay = new Model.Check_CheckDay { CheckDayCode = this.txtCheckDayCode.Text.Trim(), ProjectId = this.ProjectId }; if (this.drpWeather.SelectedValue != BLL.Const._Null) { checkDay.WeatherId = this.drpWeather.SelectedValue; } if (this.drpCheckPerson.SelectedValue != BLL.Const._Null) { checkDay.CheckPerson = this.drpCheckPerson.SelectedValue; } checkDay.CheckTime = Funs.GetNewDateTime(this.txtCheckDate.Text.Trim()); checkDay.DaySummary = HttpUtility.HtmlEncode(this.txtDaySummary.Text.Trim()); ////单据状态 checkDay.States = BLL.Const.State_0; if (type == BLL.Const.BtnSubmit) { checkDay.States = this.ctlAuditFlow.NextStep; } if (!string.IsNullOrEmpty(this.CheckDayId)) { checkDay.CheckDayId = this.CheckDayId; BLL.Check_CheckDayService.UpdateCheckDay(checkDay); BLL.LogService.AddSys_Log(this.CurrUser, checkDay.CheckDayCode, checkDay.CheckDayId, BLL.Const.ProjectCheckDayMenuId, BLL.Const.BtnModify); } else { checkDay.CheckDayId = SQLHelper.GetNewID(typeof(Model.Check_CheckDay)); this.CheckDayId = checkDay.CheckDayId; checkDay.CompileMan = this.CurrUser.UserId; BLL.Check_CheckDayService.AddCheckDay(checkDay); BLL.LogService.AddSys_Log(this.CurrUser, checkDay.CheckDayCode, checkDay.CheckDayId, BLL.Const.ProjectCheckDayMenuId, BLL.Const.BtnAdd); } ////保存流程审核数据 this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.ProjectCheckDayMenuId, this.CheckDayId, (type == BLL.Const.BtnSubmit ? true : false), this.txtCheckDate.Text.Trim(), "../Check/CheckDayView.aspx?CheckDayId={0}"); }
/// <summary> /// /// </summary> private void SaveNew() { if (string.IsNullOrEmpty(this.CheckSpecialId)) { Model.Check_CheckSpecial checkSpecial = new Model.Check_CheckSpecial { CheckSpecialId = SQLHelper.GetNewID(typeof(Model.Check_CheckSpecial)), CheckSpecialCode = this.txtCheckSpecialCode.Text.Trim(), ProjectId = this.ProjectId }; ///组成员 string partInPersonIds = string.Empty; string partInPersons = string.Empty; foreach (var item in this.drpPartInPersons.SelectedValueArray) { var user = BLL.UserService.GetUserByUserId(item); if (user != null) { partInPersonIds += user.UserId + ","; partInPersons += user.UserName + ","; } } if (!string.IsNullOrEmpty(partInPersonIds)) { checkSpecial.PartInPersonIds = partInPersonIds.Substring(0, partInPersonIds.LastIndexOf(",")); checkSpecial.PartInPersons = partInPersons.Substring(0, partInPersons.LastIndexOf(",")); } checkSpecial.PartInPersonNames = this.txtPartInPersonNames.Text.Trim(); checkSpecial.CheckTime = Funs.GetNewDateTime(this.txtCheckDate.Text.Trim()); ////单据状态 checkSpecial.States = Const.State_0; this.CheckSpecialId = checkSpecial.CheckSpecialId; checkSpecial.CompileMan = this.CurrUser.UserId; BLL.Check_CheckSpecialService.AddCheckSpecial(checkSpecial); BLL.LogService.AddSys_Log(this.CurrUser, checkSpecial.CheckSpecialCode, checkSpecial.CheckSpecialId, BLL.Const.ProjectCheckSpecialMenuId, BLL.Const.BtnAdd); } }
/// <summary> /// 保存数据 /// </summary> /// <param name="type"></param> private void SaveData(string type) { Model.Administrative_HealthManage healthManage = new Model.Administrative_HealthManage { ProjectId = this.ProjectId }; if (this.drpPersonId.SelectedValue != BLL.Const._Null) { healthManage.PersonId = this.drpPersonId.SelectedValue; } healthManage.Age = Funs.GetNewInt(this.txtAge.Text.Trim()); healthManage.Bloodtype = this.txtBloodtype.Text.Trim(); healthManage.HealthState = this.txtHealthState.Text.Trim(); healthManage.Taboo = this.txtTaboo.Text.Trim(); healthManage.CheckTime = Funs.GetNewDateTime(this.txtCheckTime.Text.Trim()); healthManage.Remark = this.txtRemark.Text.Trim(); healthManage.CompileMan = this.CurrUser.UserId; healthManage.CompileDate = DateTime.Now; healthManage.States = BLL.Const.State_0; if (type == BLL.Const.BtnSubmit) { healthManage.States = this.ctlAuditFlow.NextStep; } if (!string.IsNullOrEmpty(this.HealthManageId)) { healthManage.HealthManageId = this.HealthManageId; BLL.HealthManageService.UpdateHealthManage(healthManage); BLL.LogService.AddSys_Log(this.CurrUser, this.drpPersonId.SelectedText, healthManage.HealthManageId, BLL.Const.HealthManageMenuId, BLL.Const.BtnModify); } else { this.HealthManageId = SQLHelper.GetNewID(typeof(Model.Administrative_HealthManage)); healthManage.HealthManageId = this.HealthManageId; BLL.HealthManageService.AddHealthManage(healthManage); BLL.LogService.AddSys_Log(this.CurrUser, this.drpPersonId.SelectedText, healthManage.HealthManageId, BLL.Const.HealthManageMenuId, BLL.Const.BtnAdd); } ////保存流程审核数据 this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.HealthManageMenuId, this.HealthManageId, (type == BLL.Const.BtnSubmit ? true : false), this.drpPersonId.SelectedText.Trim(), "../Administrative/HealthManageView.aspx?HealthManageId={0}"); }
/// <summary> /// 保存数据 /// </summary> /// <param name="type"></param> private void SaveData(string type) { Model.CostGoods_GoodsOut goodsOut = new Model.CostGoods_GoodsOut { ProjectId = this.ProjectId, GoodsOutCode = this.txtGoodsOutCode.Text.Trim() }; if (!string.IsNullOrEmpty(this.hdGoodsDefId.Text.Trim())) { goodsOut.GoodsDefId = this.hdGoodsDefId.Text.Trim(); } goodsOut.GoodsNum = Funs.GetNewInt(this.txtCounts.Text.Trim()); goodsOut.OutPerson = this.txtOutPerson.Text.Trim(); goodsOut.OutDate = Funs.GetNewDateTime(this.txtOutDate.Text.Trim()); goodsOut.States = BLL.Const.State_0; if (type == BLL.Const.BtnSubmit) { goodsOut.States = this.ctlAuditFlow.NextStep; } goodsOut.CompileMan = this.CurrUser.UserId; goodsOut.CompileDate = DateTime.Now; if (!string.IsNullOrEmpty(this.GoodsOutId)) { goodsOut.GoodsOutId = this.GoodsOutId; BLL.GoodsOut2Service.UpdateGoodsOut(goodsOut); BLL.LogService.AddSys_Log(this.CurrUser, goodsOut.GoodsOutCode, goodsOut.GoodsOutId, BLL.Const.GoodsOut2MenuId, BLL.Const.BtnModify); } else { this.GoodsOutId = SQLHelper.GetNewID(typeof(Model.CostGoods_GoodsOut)); goodsOut.GoodsOutId = this.GoodsOutId; BLL.GoodsOut2Service.AddGoodsOut(goodsOut); BLL.LogService.AddSys_Log(this.CurrUser, goodsOut.GoodsOutCode, goodsOut.GoodsOutId, BLL.Const.GoodsOut2MenuId, BLL.Const.BtnAdd); } ////保存流程审核数据 this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.GoodsOut2MenuId, this.GoodsOutId, (type == BLL.Const.BtnSubmit ? true : false), goodsOut.GoodsOutCode, "../CostGoods/GoodsOutView.aspx?GoodsOutId={0}"); }