コード例 #1
0
 void UCOldPartsPalautusView_ConfirmEvent(object sender, EventArgs e)
 {
     if (intDetailCount > 0)
     {
         if (MessageBoxEx.Show("确定要确认吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
         {
             return;
         }
         ProcessModeToYT();
         MessageBoxEx.Show("确认成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         uc.BindPageData();
         deleteMenuByTag(this.Tag.ToString(), uc.Name);
     }
 }
コード例 #2
0
        /// <summary>
        /// 保存、提交方法
        /// </summary>
        /// <param name="strMessage">提示信息</param>
        /// <param name="Estatus">单据操作状态</param>
        private void SaveOrSubmitMethod(string strMessage, DataSources.EnumAuditStatus Estatus)
        {
            try
            {
                #region 必要的判断
                string strSCurrentSMon = dtpSTime.Value.Month.ToString(); //创建日期范围开始日期的月份
                string strSCurrentEMon = dtpETime.Value.Month.ToString(); //创建日期范围结束日期的月份
                if (strSCurrentEMon != strSCurrentSMon)
                {
                    MessageBoxEx.Show("创建日期范围必须在同一个月!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
                    return;
                }
                string strSCurrentSDay = dtpSTime.Value.Day.ToString();//创建日期范围开始日期的天
                if (strSCurrentSDay != "1")
                {
                    MessageBoxEx.Show("创建日期范围,开始日期必须为每月第1天!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
                    return;
                }
                if (dtpSTime.Value.AddMonths(1).AddDays(-1).ToShortDateString() != dtpETime.Value.ToShortDateString())
                {
                    MessageBoxEx.Show("创建日期范围必须为整月份!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
                    return;
                }
                if (string.IsNullOrEmpty(laboldpart_receipts_no.Text))
                {
                    MessageBoxEx.Show("请先执行同步操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
                    return;
                }
                #endregion

                if (!string.IsNullOrEmpty(laboldpart_receipts_no.Text.Trim()))
                {
                    string result = DBHelper.GetSingleValue("检测该单号是否存在", "tb_maintain_oldpart_recycle", "receipt_time", "oldpart_receipts_no='" + laboldpart_receipts_no.Text.Trim() + "'", "");
                    if (!string.IsNullOrEmpty(result))
                    {
                        MessageBoxEx.Show("该日期范围内的旧件返厂单据已存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
                        return;
                    }
                }
                if (MessageBoxEx.Show("确认要" + strMessage + "吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
                {
                    return;
                }
                List <SQLObj> listSql = new List <SQLObj>();
                SaveOrderInfo(listSql, Estatus);
                SaveMaterialsData(listSql);
                if (Estatus == DataSources.EnumAuditStatus.SUBMIT)
                {
                    ProcessModeToYT();//提交时把处理状态提交到宇通
                }
                if (DBHelper.BatchExeSQLMultiByTrans(opName, listSql))
                {
                    MessageBoxEx.Show("" + strMessage + "成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
                    uc.BindPageData();
                    deleteMenuByTag(this.Tag.ToString(), this.uc.Name);
                }
                else
                {
                    MessageBoxEx.Show("" + strMessage + "失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show("" + strMessage + "失败!" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }