Ejemplo n.º 1
0
        void UCDispatchManager_QCEvent(object sender, EventArgs e)
        {
            List <string> listField = new List <string>();

            foreach (DataGridViewRow dr in dgvRData.Rows)
            {
                object isCheck = dr.Cells["colCheck"].EditedFormattedValue;
                if (isCheck != null && (bool)isCheck)
                {
                    listField.Add(dr.Cells["maintain_id"].Value.ToString());
                }
            }
            if (listField.Count <= 0)
            {
                MessageBoxEx.Show("请选择需要质检的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (MessageBoxEx.Show("确认要质检吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return;
            }
            Inspection = new UCInspection();
            if (Inspection.ShowDialog() == DialogResult.OK)
            {
                List <SQLObj> listSql   = new List <SQLObj>();
                string        strReceId = string.Empty;//单据Id值
                foreach (DataGridViewRow dr in dgvRData.Rows)
                {
                    object isCheck = dr.Cells["colCheck"].EditedFormattedValue;
                    if (isCheck != null && (bool)isCheck)
                    {
                        strReceId += dr.Cells["maintain_id"].Value.ToString() + ",";
                    }
                }
                UpdateRepairOrderInfo(listSql, strReceId, Inspection.DStatus, Inspection.Content);
                SaveProjectData(listSql, strReceId, Inspection.PStatus);
                if (DBHelper.BatchExeSQLMultiByTrans("更新单据调度状态为质检", listSql))
                {
                    MessageBoxEx.Show("质检成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    BindPageData();
                }
            }
        }
Ejemplo n.º 2
0
 void UCDispatchManager_QCEvent(object sender, EventArgs e)
 {
     List<string> listField = new List<string>();
     foreach (DataGridViewRow dr in dgvRData.Rows)
     {
         object isCheck = dr.Cells["colCheck"].EditedFormattedValue;
         if (isCheck != null && (bool)isCheck)
         {
             listField.Add(dr.Cells["maintain_id"].Value.ToString());
         }
     }
     if (listField.Count <= 0)
     {
         MessageBoxEx.Show("请选择需要质检的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     //if (MessageBoxEx.Show("确认要质检吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
     //{
     //    return;
     //}
     Inspection = new UCInspection();
     if (Inspection.ShowDialog() == DialogResult.OK)
     {
         string strMsg = string.Empty;               
         List<SQLObj> listSql = new List<SQLObj>();
         string strReceId = string.Empty;//单据Id值
         foreach (DataGridViewRow dr in dgvRData.Rows)
         {
             object isCheck = dr.Cells["colCheck"].EditedFormattedValue;
             if (isCheck != null && (bool)isCheck)
             {
                 strReceId += dr.Cells["maintain_id"].Value.ToString() + ",";                        
             }
         }
         UpdateRepairOrderInfo(listSql, strReceId, Inspection.DStatus, Inspection.Content);
         SaveProjectData(listSql, strReceId, Inspection.PStatus);
         if (DBHelper.BatchExeSQLMultiByTrans("更新单据调度状态为质检", listSql))
         {
             if (Inspection.DStatus == DataSources.EnumDispatchStatus.NotPassed)
             {
                 strMsg = "质检未通过!";                      
             }
             else if (Inspection.DStatus == DataSources.EnumDispatchStatus.HasPassed)
             {
                 strMsg = "质检成功!";
                 #region 自动生成领料单(草稿状态)
                 List<SQLObj> listblanceSql = new List<SQLObj>();
                 SaveOrderInfo(listblanceSql, strReceId);                       
                 DBHelper.BatchExeSQLMultiByTrans("", listblanceSql);
                 #endregion
             }
             MessageBoxEx.Show(strMsg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             BindPageData();
         }
     }
 }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
 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);
     }
 }
Ejemplo n.º 5
0
        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);
            }
        }