/// <summary> /// 删除业务 /// </summary> /// <param name="billNo">业务号</param> public void DeleteInfo(string billNo) { DepotManagementDataContext ctx = CommentParameter.DepotDataContext; ctx.Connection.Open(); ctx.Transaction = ctx.Connection.BeginTransaction(); IFlowServer serverFlow = FlowControlService.ServerModuleFactory.GetServerModule <IFlowServer>(); BillNumberControl billNoControl = new BillNumberControl(CE_BillTypeEnum.创意提案.ToString(), this); try { var varData = from a in ctx.Business_CWQC_CreativePersentation where a.BillNo == billNo select a; if (varData.Count() == 1) { Business_CWQC_CreativePersentation tempInfo = varData.Single(); if (tempInfo.ImproveConditions_After_FileNo != null && tempInfo.ImproveConditions_After_FileNo.Trim().Length > 0) { string[] pathArray = tempInfo.ImproveConditions_After_FileNo.Split(','); for (int i = 0; i < pathArray.Length; i++) { UniversalControlLibrary.FileOperationService.File_Delete(new Guid(pathArray[i]), GlobalObject.GeneralFunction.StringConvertToEnum <CE_CommunicationMode>(BasicInfo.BaseSwitchInfo[(int)GlobalObject.CE_SwitchName.文件传输方式])); } } if (tempInfo.ImproveConditions_Before_FileNo != null && tempInfo.ImproveConditions_Before_FileNo.Trim().Length > 0) { string[] pathArray = tempInfo.ImproveConditions_Before_FileNo.Split(','); for (int i = 0; i < pathArray.Length; i++) { UniversalControlLibrary.FileOperationService.File_Delete(new Guid(pathArray[i]), GlobalObject.GeneralFunction.StringConvertToEnum <CE_CommunicationMode>(BasicInfo.BaseSwitchInfo[(int)GlobalObject.CE_SwitchName.文件传输方式])); } } } ctx.Business_CWQC_CreativePersentation.DeleteAllOnSubmit(varData); ctx.SubmitChanges(); serverFlow.FlowDelete(ctx, billNo); ctx.Transaction.Commit(); billNoControl.CancelBill(billNo); } catch (Exception ex) { ctx.Transaction.Rollback(); throw new Exception(ex.Message); } }
public override void LoadFormInfo() { try { m_billNoControl = new BillNumberControl(CE_BillTypeEnum.创意提案.ToString(), m_mainService); m_lnqBillInfo = m_mainService.GetSingleBillInfo(this.FlowInfo_BillNo); SetInfo(); } catch (Exception ex) { MessageDialog.ShowErrorMessage(ex.Message); } }
bool frm_CommonProcessSubmit(CustomFlowForm form, string advise) { try { Business_CWQC_CreativePersentation lnqSaveInfo = form.ResultList[0] as Business_CWQC_CreativePersentation; Business_CWQC_CreativePersentation_EffectValue lnqEffectValue = form.ResultList[2] as Business_CWQC_CreativePersentation_EffectValue; this.OperationType = GeneralFunction.StringConvertToEnum <CE_FlowOperationType>(form.ResultList[1].ToString()); this.BillNo = lnqSaveInfo.BillNo; switch (this.OperationType) { case CE_FlowOperationType.提交: m_mainService.SaveInfo(lnqSaveInfo, lnqEffectValue); break; case CE_FlowOperationType.暂存: m_mainService.SaveInfo(lnqSaveInfo, lnqEffectValue); break; case CE_FlowOperationType.回退: break; case CE_FlowOperationType.未知: break; default: break; } if (!m_mainService.IsExist(lnqSaveInfo.BillNo)) { MessageDialog.ShowPromptMessage("数据为空,保存失败,如需退出,请直接X掉界面"); return(false); } return(true); } catch (Exception ex) { MessageDialog.ShowPromptMessage(ex.Message); return(false); } }
public void UpdateFilePath(string billNo, string fileNo, SelfSimpleEnum_CreativeePersentation simple) { DepotManagementDataContext ctx = CommentParameter.DepotDataContext; var varData = from a in ctx.Business_CWQC_CreativePersentation where a.BillNo == billNo select a; if (varData.Count() == 1) { Business_CWQC_CreativePersentation tempInfo = varData.Single(); if (simple == SelfSimpleEnum_CreativeePersentation.Before) { tempInfo.ImproveConditions_Before_FileNo = fileNo; } else if (simple == SelfSimpleEnum_CreativeePersentation.After) { tempInfo.ImproveConditions_After_FileNo = fileNo; } } ctx.SubmitChanges(); }
void SetInfo() { IFlowServer serverFlow = FlowControlService.ServerModuleFactory.GetServerModule <IFlowServer>(); dataGridView1.DataSource = m_mainService.GetReferenceInfo(dataGridView1.Tag.ToString()); dataGridView2.DataSource = m_mainService.GetReferenceInfo(dataGridView2.Tag.ToString()); dataGridView3.DataSource = m_mainService.GetReferenceInfo(dataGridView3.Tag.ToString()); if (m_lnqBillInfo != null) { lbBillStatus.Text = serverFlow.GetNowBillStatus(m_lnqBillInfo.BillNo); txtBillNo.Text = m_lnqBillInfo.BillNo; Flow_FlowInfo flowInfo = serverFlow.GetNowFlowInfo(serverFlow.GetBusinessTypeID(CE_BillTypeEnum.创意提案, null), m_lnqBillInfo.BillNo); Flow_FlowData flowData = serverFlow.GetBusinessOperationInfo(txtBillNo.Text, CE_CommonBillStatus.新建单据.ToString())[0]; View_HR_Personnel sqrInfo = UniversalFunction.GetPersonnelInfo(m_lnqBillInfo.Propose); txtDept.Text = sqrInfo.部门名称; txtPropose.Text = sqrInfo.姓名; txtPropose.Tag = sqrInfo.工号; txtImproveConditions_After.Text = m_lnqBillInfo.ImproveConditions_After; txtImproveConditions_Before.Text = m_lnqBillInfo.ImproveConditions_Before; txtTask.Text = m_lnqBillInfo.Task; dtpImproveEndDate.Value = m_lnqBillInfo.ImproveEndDate; dtpImproveStartDate.Value = m_lnqBillInfo.ImproveStartDate; cmbExtensionCoverage.Text = m_lnqBillInfo.ExtensionCoverage; txtValueEffect.Text = m_lnqBillInfo.ValueEffect.ToString(); numFGLD_Abstract.Value = m_lnqBillInfo.FGLD_Abstract == null ? 0 : (int)m_lnqBillInfo.FGLD_Abstract; numFGLD_Apply.Value = m_lnqBillInfo.FGLD_Apply == null ? 0 : (int)m_lnqBillInfo.FGLD_Apply; numFGLD_Economy.Value = m_lnqBillInfo.FGLD_Economy == null ? 0 : (int)m_lnqBillInfo.FGLD_Economy; numFGLD_Ideas.Value = m_lnqBillInfo.FGLD_Ideas == null ? 0 : (int)m_lnqBillInfo.FGLD_Ideas; numFGLD_Strive.Value = m_lnqBillInfo.FGLD_Strive == null ? 0 : (int)m_lnqBillInfo.FGLD_Strive; numFZR_Abstract.Value = m_lnqBillInfo.FZR_Abstract == null ? 0 : (int)m_lnqBillInfo.FZR_Abstract; numFZR_Apply.Value = m_lnqBillInfo.FZR_Apply == null ? 0 : (int)m_lnqBillInfo.FZR_Apply; numFZR_Economy.Value = m_lnqBillInfo.FZR_Economy == null ? 0 : (int)m_lnqBillInfo.FZR_Economy; numFZR_Ideas.Value = m_lnqBillInfo.FZR_Ideas == null ? 0 : (int)m_lnqBillInfo.FZR_Ideas; numFZR_Strive.Value = m_lnqBillInfo.FZR_Strive == null ? 0 : (int)m_lnqBillInfo.FZR_Strive; lbImproveConditions_After_FileNo_Look.Tag = m_lnqBillInfo.ImproveConditions_After_FileNo; lbImproveConditions_Before_FileNo_Look.Tag = m_lnqBillInfo.ImproveConditions_Before_FileNo; List <string> lstCheck = m_lnqBillInfo.ProposalType.Split(',').ToList(); foreach (Control cl in customGroupBox1.Controls) { if (cl is CheckBox) { CheckBox cb = cl as CheckBox; if (lstCheck.Contains(cb.Text)) { cb.Checked = true; } } } foreach (Control cl in tabPage1.Controls) { if (cl is CustomGroupBox) { CustomGroupBox gb = cl as CustomGroupBox; if (gb.Tag != null && gb.Tag.ToString().Trim().Length > 0) { if (flowInfo.FlowID == Convert.ToInt32(gb.Tag)) { gb.Enabled = true; } else { gb.Enabled = false; } } } } if (lbBillStatus.Text != CE_CommonBillStatus.新建单据.ToString()) { txtImproveConditions_After.ReadOnly = true; txtImproveConditions_Before.ReadOnly = true; } } else { lbBillStatus.Text = CE_CommonBillStatus.新建单据.ToString(); m_lnqBillInfo = new Business_CWQC_CreativePersentation(); txtBillNo.Text = this.FlowInfo_BillNo; m_lnqBillInfo.BillNo = txtBillNo.Text; View_HR_Personnel sqrInfo = UniversalFunction.GetPersonnelInfo(BasicInfo.LoginID); txtDept.Text = sqrInfo.部门名称; txtPropose.Text = sqrInfo.姓名; txtPropose.Tag = sqrInfo.工号; if (!isDirectAdd) { customGroupBox6.Enabled = false; customGroupBox7.Enabled = false; } } if (lbBillStatus.Text == CE_CommonBillStatus.新建单据.ToString()) { lbImproveConditions_After_FileNo_Up.Visible = true; lbImproveConditions_Before_FileNo_Up.Visible = true; } else { lbImproveConditions_After_FileNo_Up.Visible = false; lbImproveConditions_Before_FileNo_Up.Visible = false; } if (lbImproveConditions_After_FileNo_Look.Tag != null && lbImproveConditions_After_FileNo_Look.Tag.ToString().Trim().Length > 0) { lbImproveConditions_After_FileNo_Look.Visible = true; } else { lbImproveConditions_After_FileNo_Look.Visible = false; } if (lbImproveConditions_Before_FileNo_Look.Tag != null && lbImproveConditions_Before_FileNo_Look.Tag.ToString().Trim().Length > 0) { lbImproveConditions_Before_FileNo_Look.Visible = true; } else { lbImproveConditions_Before_FileNo_Look.Visible = false; } FZRSetInfo(); FGLDSetInfo(); SetInfo_EffectValue(); }
private bool 创意提案明细_PanelGetDataInfo(CE_FlowOperationType flowOperationType) { try { if (lbBillStatus.Text == CE_CommonBillStatus.新建单据.ToString() && !CheckData()) { return(false); } m_lnqBillInfo = new Business_CWQC_CreativePersentation(); m_lnqBillInfo.Propose = txtPropose.Tag.ToString(); m_lnqBillInfo.BillNo = txtBillNo.Text; m_lnqBillInfo.ExtensionCoverage = cmbExtensionCoverage.Text; m_lnqBillInfo.FGLD_Abstract = (int)numFGLD_Abstract.Value; m_lnqBillInfo.FGLD_Apply = (int)numFGLD_Apply.Value; m_lnqBillInfo.FGLD_Economy = (int)numFGLD_Economy.Value; m_lnqBillInfo.FGLD_Ideas = (int)numFGLD_Ideas.Value; m_lnqBillInfo.FGLD_Strive = (int)numFGLD_Strive.Value; m_lnqBillInfo.FZR_Abstract = (int)numFZR_Abstract.Value; m_lnqBillInfo.FZR_Apply = (int)numFZR_Apply.Value; m_lnqBillInfo.FZR_Economy = (int)numFZR_Economy.Value; m_lnqBillInfo.FZR_Ideas = (int)numFZR_Ideas.Value; m_lnqBillInfo.FZR_Strive = (int)numFZR_Strive.Value; m_lnqBillInfo.ImproveConditions_After = txtImproveConditions_After.Text; m_lnqBillInfo.ImproveConditions_Before = txtImproveConditions_Before.Text; m_lnqBillInfo.ImproveConditions_After_FileNo = lbImproveConditions_After_FileNo_Look.Tag == null ? null : lbImproveConditions_After_FileNo_Look.Tag.ToString(); m_lnqBillInfo.ImproveConditions_Before_FileNo = lbImproveConditions_Before_FileNo_Look.Tag == null ? null : lbImproveConditions_Before_FileNo_Look.Tag.ToString(); m_lnqBillInfo.ImproveEndDate = dtpImproveEndDate.Value; m_lnqBillInfo.ImproveStartDate = dtpImproveEndDate.Value; foreach (Control cl in customGroupBox1.Controls) { if (cl is CheckBox) { CheckBox cb = cl as CheckBox; if (cb.Checked) { m_lnqBillInfo.ProposalType += cb.Text + ","; } } } m_lnqBillInfo.ProposalType = m_lnqBillInfo.ProposalType.Substring(0, m_lnqBillInfo.ProposalType.Length - 1); m_lnqBillInfo.Task = txtTask.Text; m_lnqBillInfo.ValueEffect = Convert.ToDecimal(txtValueEffect.Text); if (lbFGLD_Level.Text != "无") { m_lnqBillInfo.SumScore = Convert.ToInt32(lbFGLD_Sum.Text); m_lnqBillInfo.Level = lbFGLD_Level.Text; m_lnqBillInfo.Bonus = Convert.ToInt32(lbFGLD_Bonus.Text); } else { m_lnqBillInfo.SumScore = Convert.ToInt32(lbFZR_Sum.Text); m_lnqBillInfo.Level = lbFZR_Level.Text; m_lnqBillInfo.Bonus = Convert.ToInt32(lbFZR_Bonus.Text); } if (lbBillStatus.Text != CE_CommonBillStatus.新建单据.ToString() && m_lnqBillInfo.SumScore == 0) { if (MessageDialog.ShowEnquiryMessage("【合计评价分】为【0分】,是否继续提交?") == DialogResult.No) { return(false); } } this.FlowInfo_BillNo = m_lnqBillInfo.BillNo; this.ResultList = new List <object>(); this.ResultList.Add(m_lnqBillInfo); this.ResultList.Add(flowOperationType); this.ResultList.Add(GetInfo_EffectValue()); return(true); } catch (Exception ex) { MessageDialog.ShowPromptMessage(ex.Message); return(false); } }
/// <summary> /// 保存业务信息 /// </summary> /// <param name="billInfo">业务总单信息</param> /// <param name="effectValue">业务明细信息</param> public void SaveInfo(Business_CWQC_CreativePersentation billInfo, ServerModule.Business_CWQC_CreativePersentation_EffectValue effectValue) { DepotManagementDataContext ctx = CommentParameter.DepotDataContext; ctx.Connection.Open(); ctx.Transaction = ctx.Connection.BeginTransaction(); try { var varData = from a in ctx.Business_CWQC_CreativePersentation where a.BillNo == billInfo.BillNo select a; if (varData.Count() == 1) { Business_CWQC_CreativePersentation lnqBill = varData.Single(); lnqBill.BillNo = billInfo.BillNo; lnqBill.Propose = billInfo.Propose; lnqBill.ExtensionCoverage = billInfo.ExtensionCoverage; lnqBill.FGLD_Abstract = billInfo.FGLD_Abstract; lnqBill.FGLD_Apply = billInfo.FGLD_Apply; lnqBill.FGLD_Economy = billInfo.FGLD_Economy; lnqBill.FGLD_Ideas = billInfo.FGLD_Ideas; lnqBill.FGLD_Strive = billInfo.FGLD_Strive; lnqBill.FZR_Abstract = billInfo.FZR_Abstract; lnqBill.FZR_Apply = billInfo.FZR_Apply; lnqBill.FZR_Economy = billInfo.FZR_Economy; lnqBill.FZR_Ideas = billInfo.FZR_Ideas; lnqBill.FZR_Strive = billInfo.FZR_Strive; lnqBill.ImproveConditions_After = billInfo.ImproveConditions_After; lnqBill.ImproveConditions_After_FileNo = billInfo.ImproveConditions_After_FileNo; lnqBill.ImproveConditions_Before = billInfo.ImproveConditions_Before; lnqBill.ImproveConditions_Before_FileNo = billInfo.ImproveConditions_Before_FileNo; lnqBill.ImproveEndDate = billInfo.ImproveEndDate; lnqBill.ImproveStartDate = billInfo.ImproveStartDate; lnqBill.ProposalType = billInfo.ProposalType; lnqBill.Task = billInfo.Task; lnqBill.ValueEffect = billInfo.ValueEffect; lnqBill.Level = billInfo.Level; lnqBill.SumScore = billInfo.SumScore; lnqBill.Bonus = billInfo.Bonus; } else if (varData.Count() == 0) { ctx.Business_CWQC_CreativePersentation.InsertOnSubmit(billInfo); } else { throw new Exception("单据数据不唯一"); } OperationInfo_EffectValue(ctx, effectValue); ctx.SubmitChanges(); ctx.Transaction.Commit(); } catch (Exception ex) { ctx.Transaction.Rollback(); throw new Exception(ex.Message); } }