Example #1
0
        /// <summary>
        /// 调拨单保存与提交
        /// </summary>
        /// <param name="OperateMode"></param>
        private void SaveOrSubmitMethod(string HandleTypeName)
        {
            try
            {
                if (CheckListInfo())
                {
                    gvPartsMsgList.EndEdit();
                    string opName = "调拨单操作";
                    if (HandleTypeName == submit)
                    {
                        lblorder_num.Text            = CommonUtility.GetNewNo(DataSources.EnumProjectType.AllotBill);//获取调拨单编号
                        txtorder_status_name.Caption = DataSources.GetDescription(DataSources.EnumAuditStatus.SUBMIT, true);
                    }

                    List <SysSQLString> listSql = new List <SysSQLString>();
                    if (status == WindowStatus.Add || status == WindowStatus.Copy)
                    {
                        AllotId = Guid.NewGuid().ToString();
                        AddAllotBillSql(listSql, AllotBillEntity, AllotId, HandleTypeName);
                        opName = "新增调拨单";
                        AddOrEditPartsListMsg(listSql, AllotId, WindowStatus.Add);
                    }
                    else if (status == WindowStatus.Edit)
                    {
                        EditAllotBillSql(listSql, AllotBillEntity, AllotId, HandleTypeName);
                        opName = "修改调拨单";
                        AddOrEditPartsListMsg(listSql, AllotId, WindowStatus.Edit);
                    }


                    if (DBHelper.BatchExeSQLStringMultiByTrans(opName, listSql))
                    {
                        MessageBoxEx.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        string QueryWhere = " enable_flag=1 "; //获取查询条件
                        UCReqBM.GetAllotBillList(QueryWhere);  //更新单据列表
                        deleteMenuByTag(this.Tag.ToString(), UCReqBM.Name);
                    }
                    else
                    {
                        MessageBoxEx.Show("保存失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
Example #2
0
        /// <summary>
        /// 调拨单保存与提交
        /// </summary>
        /// <param name="OperateMode"></param>
        private void SaveOrSubmitMethod(string HandleTypeName)
        {
            try
            {
                if (CheckListInfo())
                {
                    gvPartsMsgList.EndEdit();
                    string opName = "调拨单操作";
                    if (HandleTypeName == submit)
                    {
                        lblorder_num.Text            = CommonUtility.GetNewNo(DataSources.EnumProjectType.AllotBill);//获取调拨单编号
                        txtorder_status_name.Caption = DataSources.GetDescription(DataSources.EnumAuditStatus.SUBMIT, true);
                    }

                    List <SysSQLString> listSql = new List <SysSQLString>();
                    if (status == WindowStatus.Add || status == WindowStatus.Copy)
                    {
                        AllotId = Guid.NewGuid().ToString();
                        AddAllotBillSql(listSql, AllotBillEntity, AllotId, HandleTypeName);
                        opName = "新增调拨单";
                        AddOrEditPartsListMsg(listSql, AllotId, WindowStatus.Add);
                    }
                    else if (status == WindowStatus.Edit)
                    {
                        EditAllotBillSql(listSql, AllotBillEntity, AllotId, HandleTypeName);
                        opName = "修改调拨单";
                        AddOrEditPartsListMsg(listSql, AllotId, WindowStatus.Edit);
                    }


                    if (DBHelper.BatchExeSQLStringMultiByTrans(opName, listSql))
                    {
                        if (HandleTypeName == submit)
                        {
                            MessageBoxEx.Show("提交成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                        else if (HandleTypeName == save)
                        {
                            MessageBoxEx.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                        long   StartDate    = Common.LocalDateTimeToUtcLong(Convert.ToDateTime(DateTime.Now.AddMonths(-6).ToShortDateString())); //获取当前日期的半年前的日期
                        long   EndDate      = Common.LocalDateTimeToUtcLong(Convert.ToDateTime(DateTime.Now.ToShortDateString()));               //获取当前日期
                        string DefaultWhere = " enable_flag=1 and BillTb.order_date between  " + StartDate + " and " + EndDate;                  //默认查询条件
                        UCReqBM.GetAllotBillList(DefaultWhere);                                                                                  //更新单据列表
                        deleteMenuByTag(this.Tag.ToString(), UCReqBM.Name);
                    }
                    else
                    {
                        if (HandleTypeName == submit)
                        {
                            MessageBoxEx.Show("提交失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                        else if (HandleTypeName == save)
                        {
                            MessageBoxEx.Show("保存失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }