private void btnOK_Click(object sender, EventArgs e) { Content = !rtbContent.Text.Trim().Contains("质检意见:") ? rtbContent.Text.Trim() : rtbContent.Text.Trim().Replace("质检意见:", ""); rtbContent.Text = Content; if (rtbContent.Text.Trim().Length > 200) { MessageBoxEx.Show("质检意见不能超过200个字!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (rdbReturn.Checked && rtbContent.Text.Length == 0) { MessageBoxEx.Show("请填写质检意见!"); rtbContent.Focus(); return; } if (rdbOK.Checked) { DStatus = DataSources.EnumDispatchStatus.HasPassed; PStatus = DataSources.EnumProjectDisStatus.InspectionCompleted; } else { DStatus = DataSources.EnumDispatchStatus.NotPassed; PStatus = DataSources.EnumProjectDisStatus.NotInspectionCompleted; } this.DialogResult = DialogResult.OK; this.Close(); }
private void btnOK_Click(object sender, EventArgs e) { Content = !rtbContent.Text.Trim().Contains("质检意见:") ? rtbContent.Text.Trim() : rtbContent.Text.Trim().Replace("质检意见:", ""); rtbContent.Text = Content; if (rtbContent.Text.Trim().Length > 200) { MessageBoxEx.Show("质检意见不能超过200个字!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (rdbReturn.Checked && rtbContent.Text.Length == 0) { MessageBoxEx.Show("请填写质检意见!"); rtbContent.Focus(); return; } if (rdbOK.Checked) { DStatus = DataSources.EnumDispatchStatus.HasPassed; PStatus = DataSources.EnumProjectDisStatus.InspectionCompleted; } else { DStatus = DataSources.EnumDispatchStatus.NotPassed; PStatus = DataSources.EnumProjectDisStatus.NotInspectionCompleted; } this.DialogResult = DialogResult.OK; this.Close(); }
private void btnOK_Click(object sender, EventArgs e) { if (rtbContent.Text.Length == 0) { MessageBoxEx.Show("请填写停工原因!"); rtbContent.Focus(); return; } Content = !rtbContent.Text.Trim().Contains("停工原因:") ? rtbContent.Text.Trim() : rtbContent.Text.Trim().Replace("停工原因:", ""); DStatus = DataSources.EnumDispatchStatus.StopWork; PStatus = DataSources.EnumProjectDisStatus.Pause; this.DialogResult = DialogResult.OK; this.Close(); }
private void btnOK_Click(object sender, EventArgs e) { if (rtbContent.Text.Length == 0) { MessageBoxEx.Show("请填写停工原因!"); rtbContent.Focus(); return; } Content = !rtbContent.Text.Trim().Contains("停工原因:") ? rtbContent.Text.Trim() : rtbContent.Text.Trim().Replace("停工原因:", ""); DStatus = DataSources.EnumDispatchStatus.StopWork; PStatus = DataSources.EnumProjectDisStatus.Pause; this.DialogResult = DialogResult.OK; this.Close(); }
/// <summary> /// 质检-更新单据状态 /// </summary> /// <param name="listSql">SQLObj list</param> /// <param name="strRId">单据Id字符串</param> /// <param name="DStatus">调度状态枚举</param> /// <param name="DStatus">质检意见</param> private void UpdateRepairOrderInfo(List <SQLObj> listSql, string strRId, DataSources.EnumDispatchStatus DStatus, string strContent) { strRId = strRId.Substring(0, strRId.Length - 1); string[] Array = strRId.Split(','); for (int i = 0; i < Array.Length; i++) { SQLObj obj = new SQLObj(); obj.cmdType = CommandType.Text; Dictionary <string, ParamObj> dicParam = new Dictionary <string, ParamObj>(); dicParam.Add("maintain_id", new ParamObj("maintain_id", Array[i], SysDbType.VarChar, 40)); //单据ID dicParam.Add("dispatch_status", new ParamObj("dispatch_status", Convert.ToInt32(DStatus).ToString(), SysDbType.VarChar, 1)); //调度状态 dicParam.Add("Verify_advice", new ParamObj("Verify_advice", strContent, SysDbType.VarChar, 200)); //质检意见 dicParam.Add("update_by", new ParamObj("update_by", HXCPcClient.GlobalStaticObj.UserID, SysDbType.VarChar, 40)); //修改人Id dicParam.Add("update_name", new ParamObj("update_name", HXCPcClient.GlobalStaticObj.UserName, SysDbType.VarChar, 40)); //修改人姓名 dicParam.Add("update_time", new ParamObj("update_time", Common.LocalDateTimeToUtcLong(HXCPcClient.GlobalStaticObj.CurrentDateTime).ToString(), SysDbType.BigInt)); //修改时间 obj.sqlString = "update tb_maintain_info set dispatch_status=@dispatch_status,Verify_advice=@Verify_advice,update_by=@update_by,update_name=@update_name,update_time=@update_time where maintain_id=@maintain_id"; obj.Param = dicParam; listSql.Add(obj); } }
void UCDispatchDetails_DtaloEvent(object sender, EventArgs e) { try { if (!IsChooserProject()) { return; } //frmDispatching persons = new frmDispatching(); //DialogResult result = persons.ShowDialog(); //if (result == DialogResult.OK) //{ if (!IsChooserUser()) { return; } if (MessageBoxEx.Show("确认要分配工时吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } #region 保存调度人员的信息 List<SQLObj> listSqlUser = new List<SQLObj>(); string strProjectID = string.Empty; for (int i = 0; i < dgvproject.RowCount; i++) { DataGridViewRow dgvr = dgvproject.Rows[i]; object isCheck = dgvr.Cells["colCheck"].Value; if (isCheck != null && (bool)isCheck) { strProjectID = CommonCtrl.IsNullToString(dgvr.Cells["item_id"].Value); DispatchUserInfo(listSqlUser, strReceiveId, strProjectID); } } DBHelper.BatchExeSQLMultiByTrans("添加分配工时人员信息", listSqlUser); //BindUserInfo(persons.strUserId); //base.btnAffirm.Enabled = true;//确认分配工时 base.btnSave.Enabled = true;//保存 base.btnSatart.Enabled = true;//开工 DStatus = DataSources.EnumDispatchStatus.NotStartWork; PStatus = DataSources.EnumProjectDisStatus.NotStartWork; AlterOrdersStatus(DStatus, PStatus); #endregion // IsAllOverall = true; //} } catch (Exception ex) { HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex); } }
void UCDispatchDetails_StartEvent(object sender, EventArgs e) { if (!JudgeProjectOK("开工")) { return; } if (MessageBoxEx.Show("确认要开工吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } DStatus = DataSources.EnumDispatchStatus.StartWork; PStatus = DataSources.EnumProjectDisStatus.Maintenance; strStarTime = DateTime.Now.ToString(); strStopTime = string.Empty; strCTime = string.Empty; base.btnSave.Enabled = true; base.btnComplete.Enabled = true; base.btnStop.Enabled = true; if (strProjectSattus == "4")//停工在开工 { strStarTime = string.Empty; strContinueTime = DateTime.Now.ToString(); } AlterOrdersStatus(DStatus, PStatus); //List<SQLObj> listSql = new List<SQLObj>(); //UpdateRepairOrderInfo(listSql, DStatus); //if (DBHelper.BatchExeSQLMultiByTrans(opName, listSql)) //{ // MessageBoxEx.Show("已开工!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None); // uc.BindPageData(); // base.deleteMenuByTag(this.Tag.ToString(), this.uc.Name); //} }
void UCDispatchDetails_StartEvent(object sender, EventArgs e) { try { //if (!JudgeProjectOK()) //{ // return; //} if (MessageBoxEx.Show("确认要开工吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } bool iscontinue = true; #region 判断维修配件库存是否够用 foreach (DataGridViewRow dgvr in dgvMaterials.Rows) { string strPCode = CommonCtrl.IsNullToString(dgvr.Cells["parts_code"].Value); string strPId = CommonCtrl.IsNullToString(dgvr.Cells["parts_id"].Value); if (!string.IsNullOrEmpty(strPCode) && !string.IsNullOrEmpty(strPId)) { //配件数量 decimal intPNum = !string.IsNullOrEmpty(CommonCtrl.IsNullToString(dgvr.Cells["quantity"].Value)) ? Convert.ToDecimal(CommonCtrl.IsNullToString(dgvr.Cells["quantity"].Value)) : 0; //配件账面库存数量 decimal intPCount = Convert.ToDecimal(CommonFuncCall.CheckPartStockCount(strPId, DataSources.EnumStatisticType.PaperCount)); if (intPNum > intPCount) { if (MessageBoxEx.Show("您选择的配件【" + strPCode + "】库存不足,是否继续开工?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { iscontinue = false; break; } else { continue; } } } } #endregion if (iscontinue) { DStatus = DataSources.EnumDispatchStatus.StartWork; PStatus = DataSources.EnumProjectDisStatus.Maintenance; strStarTime = DateTime.Now.ToString(); strStopTime = string.Empty; strCTime = string.Empty; base.btnSave.Enabled = true; base.btnComplete.Enabled = true; base.btnStop.Enabled = true; createFetch.Enabled = true;//自动生成领料单 //if (strProjectSattus == "4")//停工在开工 //{ //strStarTime = string.Empty; strContinueTime = DateTime.Now.ToString(); //} AlterOrdersStatus(DStatus, PStatus); //List<SQLObj> listSql = new List<SQLObj>(); //UpdateRepairOrderInfo(listSql, DStatus); //if (DBHelper.BatchExeSQLMultiByTrans(opName, listSql)) //{ // MessageBoxEx.Show("已开工!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None); // uc.BindPageData(); // base.deleteMenuByTag(this.Tag.ToString(), this.uc.Name); //} } } catch (Exception ex) { HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex); } }
void UCDispatchDetails_AffirmEvent(object sender, EventArgs e) { //if (IsAllOverall) //{ // foreach (DataGridViewRow dr in dgvproject.Rows) // { // string strPname = CommonCtrl.IsNullToString(dr.Cells["item_name"].Value); // string strProgress = CommonCtrl.IsNullToString(dr.Cells["repair_progress"].Value); // if (strPname.Length > 0) // { // if (strProgress=="未分配工时") // { // //if (MessageBoxEx.Show("您有未分配工时项目,请分配工时!", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) // //{ // // return; // //} // MessageBoxEx.Show("您有未分配工时项目,请分配工时!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return; // } // } // } //} //else if (!IsChooserProject()) //{ // return; //} if (MessageBoxEx.Show("确认要分配工时吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } base.btnSave.Enabled = true;//保存 base.btnSatart.Enabled = true;//开工 DStatus = DataSources.EnumDispatchStatus.NotStartWork; PStatus = DataSources.EnumProjectDisStatus.NotStartWork; AlterOrdersStatus(DStatus, PStatus); }
void UCDispatchDetails_CompleteEvent(object sender, EventArgs e) { try { //if (!JudgeProjectOK("完工")) //{ // return; //} if (MessageBoxEx.Show("确认要完工吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } if (decPartsCount > decFPartsCount) { MessageBoxEx.Show("用料数量与领料数量不符,用料数量(" + decPartsCount + ")大于领料数量(" + ControlsConfig.SetNewValue(decFPartsCount,1) + ")请完善领料信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (decPartsCount < decFPartsCount) { MessageBoxEx.Show("用料数量与领料数量不符,用料数量(" + decPartsCount + ")小于领料数量(" + ControlsConfig.SetNewValue(decFPartsCount,1) + ")请完善领料信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } DStatus = DataSources.EnumDispatchStatus.FinishWork; PStatus = DataSources.EnumProjectDisStatus.RepairsCompleted; strStarTime = string.Empty; strStopTime = string.Empty; strCTime = DateTime.Now.ToString(); strContinueTime = string.Empty; AlterOrdersStatus(DStatus, PStatus); base.btnSave.Enabled = true; List<SQLObj> listSql = new List<SQLObj>(); UpdateRepairOrderInfo(listSql, DStatus); SaveProjectData(listSql, strReceiveId, PStatus); if (DBHelper.BatchExeSQLMultiByTrans(opName, listSql)) { MessageBoxEx.Show("已完工!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None); uc.BindPageData(); isAutoClose = true; base.deleteMenuByTag(this.Tag.ToString(), this.uc.Name); } } catch (Exception ex) { HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex); } }
void UCDispatchDetails_StopEvent(object sender, EventArgs e) { try { //if (!JudgeProjectOK("停工")) //{ // return; //} if (MessageBoxEx.Show("确认要停工吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } StopReason = new UCStopReason(); if (StopReason.ShowDialog() == DialogResult.OK) { strStopReason = StopReason.Content; DStatus = StopReason.DStatus; PStatus = StopReason.PStatus; strStarTime = string.Empty; strStopTime = DateTime.Now.ToString(); strCTime = string.Empty; strContinueTime = string.Empty; AlterOrdersStatus(DStatus, PStatus); base.btnSave.Enabled = true; } } catch (Exception ex) { HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex); } }
void UCDispatchDetails_AffirmEvent(object sender, EventArgs e) { if (IsAllOverall) { foreach (DataGridViewRow dr in dgvproject.Rows) { object isCheck = dr.Cells["colCheck"].EditedFormattedValue; string strPname = CommonCtrl.IsNullToString(dr.Cells["item_name"].Value); if (strPname.Length > 0) { if (!(bool)isCheck) { if (MessageBoxEx.Show("您有未派工项目,请派工!", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } } } } } else if (!IsChooserProject()) { return; } if (MessageBoxEx.Show("确认要派工吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } base.btnSave.Enabled = true;//保存 base.btnSatart.Enabled = true;//开工 DStatus = DataSources.EnumDispatchStatus.NotStartWork; PStatus = DataSources.EnumProjectDisStatus.NotStartWork; AlterOrdersStatus(DStatus, PStatus); }
void UCDispatchDetails_QCEvent(object sender, EventArgs e) { try { //if (MessageBoxEx.Show("确认要质检吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) //{ // return; //} Inspection = new UCInspection(); if (Inspection.ShowDialog() == DialogResult.OK) { strInspection = Inspection.Content; DStatus = Inspection.DStatus; PStatus = Inspection.PStatus; AlterOrdersStatus(DStatus, PStatus); //质检状体直接入库 List<SQLObj> listSql = new List<SQLObj>(); UpdateRepairOrderInfo(listSql, DStatus); AttachmentInfo(listSql); SaveProjectData(listSql, strReceiveId, PStatus); SaveMaterialsData(listSql, strReceiveId); SaveOtherData(listSql, strReceiveId); DBHelper.BatchExeSQLMultiByTrans(opName, listSql); if (DStatus == DataSources.EnumDispatchStatus.NotPassed) { MessageBoxEx.Show("质检未通过!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None); } else if (DStatus == DataSources.EnumDispatchStatus.HasPassed) { MessageBoxEx.Show("质检成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None); #region 自动生成领料单(草稿状体) strBlanceId = strReceiveId; if (string.IsNullOrEmpty(DBHelper.GetSingleValue("查询单据是否结算", "tb_maintain_settlement_info", "settlement_id", "maintain_id='" + strBlanceId + "'", ""))) { List<SQLObj> listblanceSql = new List<SQLObj>(); strBlanceId = strReceiveId; SaveOrderInfo(listblanceSql); SaveBalanceInfo(listblanceSql); SaveProjectData(listblanceSql); SaveMaterialsData(listblanceSql); SaveOtherData(listblanceSql); ucAttr.TableName = "tb_maintain_info"; ucAttr.TableNameKeyValue = strBlanceId; listblanceSql.AddRange(ucAttr.AttachmentSql); DBHelper.BatchExeSQLMultiByTrans(opName, listblanceSql); } #endregion } isAutoClose = true; uc.BindPageData(); base.deleteMenuByTag(this.Tag.ToString(), this.uc.Name); } } catch (Exception ex) { HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex); } }
void UCDispatchDetails_QCEvent(object sender, EventArgs e) { try { if (MessageBoxEx.Show("确认要质检吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } Inspection = new UCInspection(); if (Inspection.ShowDialog() == DialogResult.OK) { strInspection = Inspection.Content; DStatus = Inspection.DStatus; PStatus = Inspection.PStatus; AlterOrdersStatus(DStatus, PStatus); //质检状体直接入库 List<SQLObj> listSql = new List<SQLObj>(); UpdateRepairOrderInfo(listSql, DStatus); AttachmentInfo(listSql); SaveProjectData(listSql, strReceiveId, PStatus); SaveMaterialsData(listSql, strReceiveId); SaveOtherData(listSql, strReceiveId); DBHelper.BatchExeSQLMultiByTrans(opName, listSql); if (DStatus == DataSources.EnumDispatchStatus.NotPassed) { base.btnSave.Enabled = true;//保存 base.btnDtalo.Enabled = true;//分配工时 base.btnSatart.Enabled = true;//开工 base.btnStop.Enabled = true;//停工 base.btnComplete.Enabled = true;//完工 base.btnQC.Enabled = false;//质检 } else if (DStatus == DataSources.EnumDispatchStatus.HasPassed) { MessageBoxEx.Show("质检成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None); uc.BindPageData(); base.deleteMenuByTag(this.Tag.ToString(), this.uc.Name); } } } catch (Exception ex) { HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex); } }
void UCDispatchDetails_StopEvent(object sender, EventArgs e) { if (!JudgeProjectOK("停工")) { return; } if (MessageBoxEx.Show("确认要停工吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } StopReason = new UCStopReason(); if (StopReason.ShowDialog() == DialogResult.OK) { strStopReason = StopReason.Content; DStatus = StopReason.DStatus; PStatus = StopReason.PStatus; strStarTime = string.Empty; strStopTime = DateTime.Now.ToString(); strCTime = string.Empty; strContinueTime = string.Empty; AlterOrdersStatus(DStatus, PStatus); base.btnSave.Enabled = true; } }
void UCDispatchDetails_CompleteEvent(object sender, EventArgs e) { if (!JudgeProjectOK("完工")) { return; } if (MessageBoxEx.Show("确认要完工吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } DStatus = DataSources.EnumDispatchStatus.FinishWork; PStatus = DataSources.EnumProjectDisStatus.RepairsCompleted; strStarTime = string.Empty; strStopTime = string.Empty; strCTime = DateTime.Now.ToString(); strContinueTime = string.Empty; AlterOrdersStatus(DStatus, PStatus); base.btnSave.Enabled = true; List<SQLObj> listSql = new List<SQLObj>(); UpdateRepairOrderInfo(listSql, DStatus); if (DBHelper.BatchExeSQLMultiByTrans(opName, listSql)) { MessageBoxEx.Show("已完工!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None); uc.BindPageData(); base.deleteMenuByTag(this.Tag.ToString(), this.uc.Name); } }
void UCDispatchDetails_QCEvent(object sender, EventArgs e) { if (MessageBoxEx.Show("确认要质检吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } Inspection = new UCInspection(); if (Inspection.ShowDialog() == DialogResult.OK) { strInspection = Inspection.Content; DStatus = Inspection.DStatus; PStatus = Inspection.PStatus; AlterOrdersStatus(DStatus, PStatus); } }
void UCDispatchDetails_DtaloEvent(object sender, EventArgs e) { if (!IsChooserProject()) { return; } if (MessageBoxEx.Show("确认要派工吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } //frmDispatching persons = new frmDispatching(); //DialogResult result = persons.ShowDialog(); //if (result == DialogResult.OK) //{ if (!IsChooserUser()) { return; } #region 保存调度人员的信息 List<SQLObj> listSqlUser = new List<SQLObj>(); foreach (DataGridViewRow dgvr in dgvproject.Rows) { object isCheck = dgvr.Cells["colCheck"].EditedFormattedValue; if (isCheck != null && (bool)isCheck) { string strProjectID = CommonCtrl.IsNullToString(dgvr.Cells["OldItem_id"].Value); DispatchUserInfo(listSqlUser, strReceiveId, strProjectID); DBHelper.BatchExeSQLMultiByTrans("添加派工人员信息", listSqlUser); } } //BindUserInfo(persons.strUserId); //base.btnAffirm.Enabled = true;//确认派工 base.btnSave.Enabled = true;//保存 base.btnSatart.Enabled = true;//开工 DStatus = DataSources.EnumDispatchStatus.NotStartWork; PStatus = DataSources.EnumProjectDisStatus.NotStartWork; AlterOrdersStatus(DStatus, PStatus); #endregion // IsAllOverall = true; //} }