示例#1
0
 void UCRepairRescueView_VerifyEvent(object sender, EventArgs e)
 {
     //if (MessageBoxEx.Show("确认要审核吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
     //{
     //    return;
     //}
     verify = new UCVerify();
     if (verify.ShowDialog() == DialogResult.OK)
     {
         List <SQLObj> listSql = new List <SQLObj>();
         SQLObj        obj     = new SQLObj();
         obj.cmdType = CommandType.Text;
         Dictionary <string, ParamObj> dicParam = new Dictionary <string, ParamObj>();
         dicParam.Add("rescue_id", new ParamObj("rescue_id", strRescueId, SysDbType.VarChar, 40));                                                                          //单据ID
         dicParam.Add("document_status", new ParamObj("document_status", verify.auditStatus, SysDbType.VarChar, 40));                                                       //单据状态
         dicParam.Add("Verify_advice", new ParamObj("Verify_advice", verify.Content, 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_rescue_info set document_status=@document_status,Verify_advice=@Verify_advice,update_by=@update_by,update_name=@update_name,update_time=@update_time where rescue_id=@rescue_id";
         obj.Param     = dicParam;
         listSql.Add(obj);
         if (DBHelper.BatchExeSQLMultiByTrans("更新单据状态为审核", listSql))
         {
             MessageBoxEx.Show("审核成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             uc.BindPageData();
             deleteMenuByTag(this.Tag.ToString(), uc.Name);
         }
     }
 }
示例#2
0
        void UCBulletinAddOrEdit_VerifyEvent(object sender, EventArgs e)
        {
            if (MessageBoxEx.Show("确认要审核吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return;
            }
            verify = new UCVerify();
            if (verify.ShowDialog() == DialogResult.OK)
            {
                List <SQLObj> listSql = new List <SQLObj>();

                SQLObj obj = new SQLObj();
                obj.cmdType = CommandType.Text;

                Dictionary <string, ParamObj> dicParam = new Dictionary <string, ParamObj>();

                dicParam.Add("announcement_id", new ParamObj("announcement_id", id, SysDbType.VarChar, 40));          //单据ID
                dicParam.Add("status", new ParamObj("status", verify.auditStatus, SysDbType.VarChar, 40));            //单据状态
                dicParam.Add("Verify_advice", new ParamObj("Verify_advice", verify.Content, SysDbType.VarChar, 200)); //审核意见
                obj.sqlString = "update sys_announcement set status=@status,Verify_advice=@Verify_advice where announcement_id=@announcement_id";
                obj.Param     = dicParam;
                listSql.Add(obj);
                if (DBHelper.BatchExeSQLMultiByTrans("更新单据状态为提交", listSql))
                {
                    if (this.RefreshDataStart != null)
                    {
                        this.RefreshDataStart();
                    }
                    MessageBoxEx.Show("审核成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    deleteMenuByTag(this.Tag.ToString(), "UCBulletinAddOrEdit");
                }
            }
        }
示例#3
0
        /// <summary> 审核事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void UCSaleOrderManager_VerifyEvent(object sender, EventArgs e)
        {
            List <string> listField = GetVerifyRecord();

            if (listField.Count == 0)
            {
                MessageBoxEx.Show("请选择要审核的数据!");
                return;
            }
            UCVerify UcVerify = new UCVerify();

            if (UcVerify.ShowDialog() == DialogResult.OK)
            {
                string Content = UcVerify.Content;
                SYSModel.DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;

                List <SysSQLString> list_sql = new List <SysSQLString>();
                for (int i = 0; i < listField.Count; i++)
                {
                    SysSQLString sysStringSql = new SysSQLString();
                    sysStringSql.cmdType = CommandType.Text;
                    Dictionary <string, string> dic = new Dictionary <string, string>();
                    if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                    {
                        //获取销售订单状态(已审核)
                        dic.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                        dic.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
                    }
                    else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                    {
                        //获取销售订单状态(审核不通过)
                        dic.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                        dic.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
                    }
                    dic.Add("update_by", GlobalStaticObj.UserID);                                   //修改人Id
                    dic.Add("update_name", GlobalStaticObj.UserName);                               //修改人姓名
                    dic.Add("update_time", Common.LocalDateTimeToUtcLong(DateTime.Now).ToString()); //修改时间
                    dic.Add("sale_order_id", listField[i]);
                    sysStringSql.sqlString = @"update tb_parts_sale_order set 
                                               order_status=@order_status,order_status_name=@order_status_name,
                                               update_by=@update_by,update_name=@update_name,update_time=@update_time 
                                               where sale_order_id=@sale_order_id";
                    sysStringSql.Param     = dic;
                    list_sql.Add(sysStringSql);
                }
                if (DBHelper.BatchExeSQLStringMultiByTrans("销售订单审核操作", list_sql))
                {
                    if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                    {
                        AddBillPayReceive(listField);
                    }
                    BindgvSaleOrderList();
                    MessageBoxEx.Show("操作成功!");
                }
                else
                {
                    MessageBoxEx.Show("操作失败!");
                }
            }
        }
示例#4
0
        void UCOldPartsPalautusManager_VerifyEvent(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["return_id"].Value.ToString());
                }
            }
            if (listField.Count <= 0)
            {
                MessageBoxEx.Show("请选择需要审核的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (MessageBoxEx.Show("确认要审核吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return;
            }
            verify = new UCVerify();
            if (verify.ShowDialog() == DialogResult.OK)
            {
                List <SQLObj> listSql = new List <SQLObj>();
                foreach (DataGridViewRow dr in dgvRData.Rows)
                {
                    object isCheck = dr.Cells["colCheck"].EditedFormattedValue;
                    if (isCheck != null && (bool)isCheck)
                    {
                        SQLObj obj = new SQLObj();
                        obj.cmdType = CommandType.Text;
                        Dictionary <string, ParamObj> dicParam = new Dictionary <string, ParamObj>();
                        dicParam.Add("return_id", new ParamObj("return_id", dr.Cells["return_id"].Value, SysDbType.VarChar, 40));                                                          //单据ID
                        dicParam.Add("info_status", new ParamObj("info_status", verify.auditStatus, SysDbType.VarChar, 40));                                                               //单据状态
                        dicParam.Add("verify_advice", new ParamObj("verify_advice", verify.Content, 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_oldpart_recycle set info_status=@info_status,verify_advice=@verify_advice,update_by=@update_by,update_name=@update_name,update_time=@update_time where return_id=@return_id";
                        obj.Param     = dicParam;
                        listSql.Add(obj);
                    }
                }
                if (DBHelper.BatchExeSQLMultiByTrans("更新单据状态为审核", listSql))
                {
                    string strMsg = string.Empty;
                    if (verify.auditStatus == DataSources.EnumAuditStatus.AUDIT)
                    {
                        strMsg = "成功";
                    }
                    else
                    {
                        strMsg = "不通过";
                    }
                    MessageBoxEx.Show("审核" + strMsg + "!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    BindPageData();
                }
            }
        }
示例#5
0
        /// <summary>
        /// 审核报损单
        /// </summary>
        /// <param name="send"></param>
        /// <param name="e"></param>
        private void UCReportedLossBillManager_VerifyEvent(object send, EventArgs e)
        {
            try
            {
                Dictionary <string, long> OrderIDDateDic = GetVerifyRecord();//获取需要核实的记录行
                if (LossIDValuelist.Count == 0 && gvLossBillList.SelectedRows.Count == 0)
                {
                    MessageBoxEx.Show("请选择符合审核条件的单据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                UCVerify UcVerify = new UCVerify();
                UcVerify.ShowDialog();
                if (UcVerify.DialogResult == DialogResult.OK)
                {
                    string Content = UcVerify.Content;
                    DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;//获取审核状态

                    Dictionary <string, string> ShippingBillField = new Dictionary <string, string>();
                    if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                    {
                        //获取报损单状态(已审核)
                        ShippingBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                        ShippingBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
                    }
                    else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                    {
                        //获取报损单状态(审核不通过)
                        ShippingBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                        ShippingBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
                    }
                    bool flag = DBHelper.BatchUpdateDataByIn(LossVerifyLogMsg, LossTable, ShippingBillField, StockLossID, LossIDValuelist.ToArray());//批量审核获取的报损单记录
                    if (flag)
                    {
                        if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                        {
                            CommonFuncCall.StatisticStock(GetLossPart(OrderIDDateDic), "报损单配件表");//同步更新报损单账面库存
                        }
                        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 LsBillTb.order_date between  " + StartDate + " and " + EndDate;               //默认查询条件
                        GetRepLossBillList(DefaultWhere);                                                                                        //刷新报损单列表
                    }
                    else
                    {
                        MessageBoxEx.Show("审核失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
示例#6
0
        //审核事件
        void UC_VerifyEvent(object sender, EventArgs e)
        {
            bool flag = false;

            foreach (DataGridViewRow dr in dgvRecord.Rows)
            {
                object isCheck = dr.Cells[this.columnCheck.Name].EditedFormattedValue;
                if (isCheck != null && (bool)isCheck)
                {
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                MessageBoxEx.Show("请选择需要审核的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (MessageBoxEx.Show("确认要审核吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return;
            }
            verify = new UCVerify();
            if (verify.ShowDialog() == DialogResult.OK)
            {
                List <SQLObj> listSql = new List <SQLObj>();
                foreach (DataGridViewRow dr in dgvRecord.Rows)
                {
                    object isCheck = dr.Cells[this.columnCheck.Name].EditedFormattedValue;
                    if (isCheck != null && (bool)isCheck)
                    {
                        SQLObj obj = new SQLObj();
                        obj.cmdType = CommandType.Text;
                        Dictionary <string, ParamObj> dicParam = new Dictionary <string, ParamObj>();
                        dicParam.Add("announcement_id", new ParamObj("announcement_id", dr.Cells[this.columnId.Name].Value, SysDbType.VarChar, 40)); //单据ID
                        dicParam.Add("status", new ParamObj("status", verify.auditStatus.ToString("d"), SysDbType.VarChar, 40));                     //单据状态

                        obj.sqlString = "update sys_announcement set status=@status where announcement_id=@announcement_id";
                        obj.Param     = dicParam;
                        listSql.Add(obj);
                    }
                }
                if (DBHelper.BatchExeSQLMultiByTrans("", listSql))
                {
                    this.BindPageData();
                    MessageBoxEx.Show("撤回成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
示例#7
0
        /// <summary>
        /// 审核其它收货单
        /// </summary>
        /// <param name="send"></param>
        /// <param name="e"></param>
        private void UCStockCheckManager_VerifyEvent(object send, EventArgs e)
        {
            try
            {
                List <string> listField = GetVerifyRecord();//获取需要核实的记录行

                if (listField.Count == 0 && gvCheckBillList.SelectedRows.Count == 0)
                {
                    MessageBoxEx.Show("请选择符合审核条件的单据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                UCVerify UcVerify = new UCVerify();
                UcVerify.ShowDialog();
                string Content = UcVerify.Content;
                DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;//获取审核状态

                Dictionary <string, string> CheckBillField = new Dictionary <string, string>();
                if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                {
                    //获取其它收货单状态(已审核)
                    CheckBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                    CheckBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
                }
                else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    //获取其它收货单状态(审核不通过)
                    CheckBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                    CheckBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
                }
                bool flag = DBHelper.BatchUpdateDataByIn(CheckVerifyLogMsg, CheckTable, CheckBillField, CheckID, listField.ToArray());//批量审核获取的盘点单记录
                if (flag)
                {
                    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 order_status_name='已审核通过'  and CkBillTb.order_date between  " + StartDate + " and " + EndDate; //默认查询条件
                    GetCheckBillList(DefaultWhere);                                                                                                          //刷新盘点单列表
                }
                else
                {
                    MessageBoxEx.Show("审核失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
示例#8
0
        /// <summary>
        /// 审核操作
        /// </summary>
        /// <param name="send"></param>
        /// <param name="e"></param>
        private void UCAllocationBillManager_VerifyEvent(object send, EventArgs e)
        {
            try
            {
                Dictionary <string, long> OrderIDDateDic = GetVerifyRecord();//获取需要核实的记录行
                if (InoutIDValuelist.Count == 0)
                {
                    MessageBoxEx.Show("请选择符合审核条件的单据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                UCVerify UcVerify = new UCVerify();
                UcVerify.ShowDialog();
                string Content = UcVerify.Content;
                DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;//获取审核状态

                Dictionary <string, string> AllocBillField = new Dictionary <string, string>();
                if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                {
                    //获取出入库单状态(已审核)
                    AllocBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                    AllocBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
                }
                else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    //获取出入库单状态(审核不通过)
                    AllocBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                    AllocBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
                }
                bool flag = DBHelper.BatchUpdateDataByIn(InOutVerifyLogMsg, InOutTable, AllocBillField, InOutID, InoutIDValuelist.ToArray());//批量审核获取的出入库单记录
                if (flag)
                {
                    CommonFuncCall.StatisticStock(GetInoutPart(OrderIDDateDic), "出入库单配件表");                                                                 //同步更新实际库存
                    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 order_status_name='已审核通过' and IOBillTb.order_date between  " + StartDate + " and " + EndDate; //默认查询条件
                    GetInOutBillList(DefaultWhere);                                                                                                         //刷新出入库单列表
                }
                else
                {
                    MessageBoxEx.Show("审核失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
示例#9
0
        /// <summary>
        /// 审核其它收货单
        /// </summary>
        /// <param name="send"></param>
        /// <param name="e"></param>
        private void UCStockReceiptManager_VerifyEvent(object send, EventArgs e)
        {
            try
            {
                List <string> listField = GetVerifyRecord();//获取需要核实的记录行

                if (listField.Count == 0 && gvReceiptBillList.SelectedRows.Count == 0)
                {
                    MessageBoxEx.Show("请选择符合审核条件的单据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                UCVerify UcVerify = new UCVerify();
                UcVerify.ShowDialog();
                string Content = UcVerify.Content;
                DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;//获取审核状态

                Dictionary <string, string> ReceiptBillField = new Dictionary <string, string>();
                if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                {
                    //获取其它收货单状态(已审核)
                    ReceiptBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                    ReceiptBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
                }
                else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    //获取其它收货单状态(审核不通过)
                    ReceiptBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                    ReceiptBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
                }
                bool flag = DBHelper.BatchUpdateDataByIn(ReceiptVerifyLogMsg, ReceiptTable, ReceiptBillField, ReceiptID, listField.ToArray());//批量审核获取的其它收货单记录
                if (flag)
                {
                    MessageBoxEx.Show("审核成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    string QueryWhere = " order_status_name='已审核通过' ";
                    GetReceiptBillList(QueryWhere);//刷新其它收货单列表
                }
                else
                {
                    MessageBoxEx.Show("审核失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
示例#10
0
        void UCYTManager_VerifyEvent(object sender, EventArgs e)
        {
            List <string> listField = GetVerifyRecord();

            if (listField.Count == 0)
            {
                MessageBoxEx.Show("请选择要审核的数据!");
                return;
            }
            UCVerify UcVerify = new UCVerify();

            UcVerify.ShowDialog();
            string Content = UcVerify.Content;

            SYSModel.DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;

            Dictionary <string, string> purchasePlanField = new Dictionary <string, string>();

            if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
            {
                //获取宇通采购订单状态(已审核)
                purchasePlanField.Add("apply_date_time", Common.LocalDateTimeToUtcLong(DateTime.Now).ToString());
                purchasePlanField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                purchasePlanField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
            }
            else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
            {
                //获取宇通采购订单状态(审核不通过)
                purchasePlanField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                purchasePlanField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
            }
            bool flag = DBHelper.BatchUpdateDataByIn("批量审核宇通采购订单表", "tb_parts_purchase_order_2", purchasePlanField, "purchase_order_yt_id", listField.ToArray());

            if (flag)
            {
                if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                {
                    DealPurascherToYT(listField);
                }
                BindgvYTPurchaseOrderList();
                MessageBoxEx.Show("操作成功!");
            }
            else
            {
                MessageBoxEx.Show("操作失败!");
            }
        }
示例#11
0
        /// <summary>
        /// 审核操作
        /// </summary>
        /// <param name="send"></param>
        /// <param name="e"></param>
        private void UCAllocationBillManager_VerifyEvent(object send, EventArgs e)
        {
            try
            {
                Dictionary <string, long> OrderIDDateDic = GetVerifyRecord();//获取需要核实的记录行
                if (InoutIDValuelist.Count == 0)
                {
                    MessageBoxEx.Show("请选择符合审核条件的单据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                UCVerify UcVerify = new UCVerify();
                UcVerify.ShowDialog();
                string Content = UcVerify.Content;
                DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;//获取审核状态

                Dictionary <string, string> AllocBillField = new Dictionary <string, string>();
                if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                {
                    //获取出入库单状态(已审核)
                    AllocBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                    AllocBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
                }
                else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    //获取出入库单状态(审核不通过)
                    AllocBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                    AllocBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
                }
                bool flag = DBHelper.BatchUpdateDataByIn(InOutVerifyLogMsg, InOutTable, AllocBillField, InOutID, InoutIDValuelist.ToArray());//批量审核获取的出入库单记录
                if (flag)
                {
                    CommonFuncCall.StatisticStock(OrderIDDateDic, InOutID, PartCount, InOutPartTable);//同步更新实际库存
                    MessageBoxEx.Show("审核成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    string QueryWhere = " order_status_name='已审核通过' ";
                    GetInOutBillList(QueryWhere);//刷新出入库单列表
                }
                else
                {
                    MessageBoxEx.Show("审核失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
示例#12
0
        /// <summary> 审核事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void UCPurchaseBillManang_VerifyEvent(object sender, EventArgs e)
        {
            List <string> listField = GetVerifyRecord();

            if (listField.Count == 0)
            {
                MessageBoxEx.Show("请选择要审核的数据!");
                return;
            }
            UCVerify UcVerify = new UCVerify();

            if (UcVerify.ShowDialog() == DialogResult.OK)
            {
                string Content = UcVerify.Content;
                SYSModel.DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;

                Dictionary <string, string> purchasePlanField = new Dictionary <string, string>();
                if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                {
                    //获取采购开单状态(已审核)
                    purchasePlanField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                    purchasePlanField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
                }
                else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    //获取采购开单状态(审核不通过)
                    purchasePlanField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                    purchasePlanField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
                }
                bool flag = DBHelper.BatchUpdateDataByIn("批量审核采购开单表", "tb_parts_purchase_billing", purchasePlanField, "purchase_billing_id", listField.ToArray());
                if (flag)
                {
                    if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                    {
                        CreateBill(listField);
                    }
                    BindgvPurchaseOrderList();
                    MessageBoxEx.Show("操作成功!");
                }
                else
                {
                    MessageBoxEx.Show("操作失败!");
                }
            }
        }
示例#13
0
        void UCFMaterialReturnView_VerifyEvent(object sender, EventArgs e)
        {
            //if (MessageBoxEx.Show("确认要审核吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
            //{
            //    return;
            //}
            Dictionary <string, long> OrderIDDateDic = new Dictionary <string, long>();//获取需要核实的记录行

            verify = new UCVerify();
            if (verify.ShowDialog() == DialogResult.OK)
            {
                List <SQLObj> listSql = new List <SQLObj>();
                SQLObj        obj     = new SQLObj();
                obj.cmdType = CommandType.Text;
                Dictionary <string, ParamObj> dicParam = new Dictionary <string, ParamObj>();
                dicParam.Add("refund_id", new ParamObj("refund_id", strReturnId, SysDbType.VarChar, 40));                                                                          //单据ID
                dicParam.Add("info_status", new ParamObj("info_status", verify.auditStatus, SysDbType.VarChar, 40));                                                               //单据状态
                dicParam.Add("Verify_advice", new ParamObj("Verify_advice", verify.Content, 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_refund_material set info_status=@info_status,Verify_advice=@Verify_advice,update_by=@update_by,update_name=@update_name,update_time=@update_time where refund_id=@refund_id";
                obj.Param     = dicParam;
                listSql.Add(obj);
                long OrdeDate = (long)Convert.ToInt64(strFetchTime);
                OrderIDDateDic.Add(strReturnId, OrdeDate);//添加已审核单据主键ID和单据日期键值对
                if (DBHelper.BatchExeSQLMultiByTrans("更新单据状态为审核", listSql))
                {
                    string strMsg = string.Empty;
                    if (verify.auditStatus == DataSources.EnumAuditStatus.AUDIT)
                    {
                        strMsg = "成功";
                        CommonFuncCall.StatisticStock(GetInoutPart(OrderIDDateDic), "领料退货单明细数据表");//同步更新实际库存
                    }
                    else
                    {
                        strMsg = "不通过";
                    }
                    MessageBoxEx.Show("审核" + strMsg + "!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    uc.BindPageData();
                    deleteMenuByTag(this.Tag.ToString(), uc.Name);
                }
            }
        }
示例#14
0
 void UCReceiveView_VerifyEvent(object sender, EventArgs e)
 {
     if (MessageBoxEx.Show("确认要审核吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
     {
         return;
     }
     verify = new UCVerify();
     if (verify.ShowDialog() == DialogResult.OK)
     {
         List <SQLObj> listSql = new List <SQLObj>();
         SQLObj        obj     = new SQLObj();
         obj.cmdType = CommandType.Text;
         Dictionary <string, ParamObj> dicParam = new Dictionary <string, ParamObj>();
         dicParam.Add("maintain_id", new ParamObj("maintain_id", strReceiveId, SysDbType.VarChar, 40));                                                                     //单据ID
         dicParam.Add("info_status", new ParamObj("info_status", verify.auditStatus, SysDbType.VarChar, 40));                                                               //单据状态
         dicParam.Add("Verify_advice", new ParamObj("Verify_advice", verify.Content, 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 info_status=@info_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);
         UpdateMaintainInfo(listSql, strBeforOrderId, strBeforSource, "0");
         if (DBHelper.BatchExeSQLMultiByTrans("更新单据状态为审核", listSql))
         {
             string strMsg = string.Empty;
             if (verify.auditStatus == DataSources.EnumAuditStatus.AUDIT)
             {
                 strMsg = "成功";
             }
             else
             {
                 strMsg = "不通过";
             }
             MessageBoxEx.Show("审核" + strMsg + "!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             uc.BindPageData();
             deleteMenuByTag(this.Tag.ToString(), uc.Name);
         }
     }
 }
        /// <summary>
        /// 审核操作
        /// </summary>
        /// <param name="send"></param>
        /// <param name="e"></param>
        private void UCRequisitionManager_VerifyEvent(object send, EventArgs e)
        {
            try
            {
                List<string> listField = GetVerifyRecord();//获取需要核实的记录行
                if (listField.Count == 0 && gvAllotBillList.SelectedRows.Count==0)
                {
                    MessageBoxEx.Show("请选择符合审核条件的单据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                UCVerify UcVerify = new UCVerify();
                UcVerify.ShowDialog();
                string Content = UcVerify.Content;
                DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;//获取审核状态

                Dictionary<string, string> AllocBillField = new Dictionary<string, string>();
                if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                {
                    //获取调拨单单状态(已审核)
                    AllocBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                    AllocBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
                }
                else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    //获取调拨单单状态(审核不通过)
                    AllocBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                    AllocBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
                }
                bool flag = DBHelper.BatchUpdateDataByIn(AllotVerifyLogMsg, AllotBillTable, AllocBillField, AllotBillID, listField.ToArray());//批量审核获取的调拨单记录
                if (flag)
                {
                    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 order_status_name='已审核通过' and BillTb.order_date between  " + StartDate + " and " + EndDate;//默认查询条件
                    GetAllotBillList(DefaultWhere);//刷新调拨单列表

                }
                else
                {
                    MessageBoxEx.Show("审核失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
        /// <summary>
        /// 审核其它收货单
        /// </summary>
        /// <param name="send"></param>
        /// <param name="e"></param>
        private void UCStockCheckManager_VerifyEvent(object send, EventArgs e)
        {
            try
            {
                List<string> listField = GetVerifyRecord();//获取需要核实的记录行

                if (listField.Count == 0 && gvCheckBillList.SelectedRows.Count == 0)
                {
                    MessageBoxEx.Show("请选择符合审核条件的单据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                UCVerify UcVerify = new UCVerify();
                UcVerify.ShowDialog();
                string Content = UcVerify.Content;
                DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;//获取审核状态

                Dictionary<string, string> CheckBillField = new Dictionary<string, string>();
                if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                {
                    //获取其它收货单状态(已审核)
                    CheckBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                    CheckBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
                }
                else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    //获取其它收货单状态(审核不通过)
                    CheckBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                    CheckBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
                }
                bool flag = DBHelper.BatchUpdateDataByIn(CheckVerifyLogMsg, CheckTable, CheckBillField, CheckID, listField.ToArray());//批量审核获取的盘点单记录
                if (flag)
                {
                    MessageBoxEx.Show("审核成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    string QueryWhere = " order_status_name='已审核通过' ";
                    GetCheckBillList(QueryWhere);//刷新盘点单列表

                }
                else
                {
                    MessageBoxEx.Show("审核失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
        //审核
        void VerifyData()
        {
            string files = string.Empty;
            foreach (DataGridViewRow dgvr in dgvBillReceivable.Rows)
            {
                if (Convert.ToBoolean(dgvr.Cells[colCheck.Name].EditedFormattedValue))
                {
                    files += string.Format("'{0}',", dgvr.Cells[colPayableSingleID.Name].Value);
                }
            }
            if (files.Length == 0)
            {
                MessageBoxEx.Show("请选择要审核的数据!");
                return;
            }
            UCVerify frmVerify = new UCVerify();
            if (frmVerify.ShowDialog() == DialogResult.OK)
            {
                files = files.TrimEnd(',');
                SysSQLString sql = new SysSQLString();
                sql.cmdType = CommandType.Text;
                sql.sqlString = string.Format("update tb_bill_receivable set order_status='{0}',Verify_advice='{1}' where payable_single_id in ({2}) and order_status='{3}';",
                    (int)frmVerify.auditStatus, frmVerify.Content, files, (int)DataSources.EnumAuditStatus.SUBMIT);
                sql.Param = new Dictionary<string, string>();
                List<SysSQLString> listSql = new List<SysSQLString>();
                listSql.Add(sql);
                //如果是审核不通过,则将没有提交或审核状态的单据设为正常
                if (frmVerify.auditStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    #region 将没有提交或审核状态的单据设为正常
                    if (orderType == DataSources.EnumOrderType.RECEIVABLE)
                    {
                        SysSQLString receivableSql = new SysSQLString();
                        receivableSql.cmdType = CommandType.Text;
                        receivableSql.sqlString = string.Format(@"update tb_parts_sale_billing set is_lock=@is_lock where sale_billing_id in (select documents_id from tb_balance_documents where order_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =sale_billing_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=sale_billing_id
);
update tb_parts_sale_order set is_lock=@is_lock where sale_order_id in (select documents_id from tb_balance_documents where order_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =sale_order_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=sale_order_id
);
update tb_maintain_settlement_info set is_lock=@is_lock where settlement_id in (select documents_id from tb_balance_documents where order_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =settlement_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=settlement_id
);
update tb_maintain_three_guaranty_settlement set is_lock=@is_lock where st_id in (select documents_id from tb_balance_documents where order_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =st_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=st_id
);", files);
                        receivableSql.Param = new Dictionary<string, string>();
                        receivableSql.Param.Add("is_lock", ((int)DataSources.EnumImportStaus.OPEN).ToString());
                        //receivableSql.Param.Add("@id", files);
                        listSql.Add(receivableSql);
                    }
                    else
                    {
                        SysSQLString purchaseBillingSql = new SysSQLString();
                        purchaseBillingSql.cmdType = CommandType.Text;
                        purchaseBillingSql.sqlString = string.Format(@"update tb_parts_purchase_billing set is_lock=@is_lock where purchase_billing_id in (select documents_id from tb_balance_documents where order_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =purchase_billing_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=purchase_billing_id
);
                                                  update tb_parts_purchase_order set is_lock=@is_lock where order_id in (select documents_id from tb_balance_documents where order_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =order_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=order_id
);  ", files);
                        purchaseBillingSql.Param = new Dictionary<string, string>();
                        purchaseBillingSql.Param.Add("is_lock", ((int)DataSources.EnumImportStaus.OPEN).ToString());
                        //purchaseBillingSql.Param.Add("@id", files);
                        listSql.Add(purchaseBillingSql);
                    }
                    #endregion
                    //审核失败需重新计算已结算/预收付金额
                    foreach (DataGridViewRow dgvr in dgvBillReceivable.Rows)
                    {
                        if (Convert.ToBoolean(dgvr.Cells[colCheck.Name].EditedFormattedValue))
                        {
                            int strOrderType = Convert.ToInt32(dgvr.Cells[colOrderType.Name].Tag);
                            string order_id = dgvr.Cells[colPayableSingleID.Name].Value.ToString();
                            //如果是应收付,则计算已结算金额
                            if (strOrderType == 1)
                            {
                                Financial.DocumentSettlementByBill(orderType, order_id, listSql);
                            }
                            //预收付,则计算预收付金额
                            else if (strOrderType == 0)
                            {
                                Financial.DocumentAdvanceByBill(orderType, order_id, listSql);
                            }
                        }
                    }
                }
                if (DBHelper.BatchExeSQLStringMultiByTrans("审核应收应付", listSql))
                {
                    MessageBoxEx.Show("审核成功!");
                    BindData();
                }
                else
                {
                    MessageBoxEx.Show("审核失败!");
                }
            }
        }
 void UCRepairRescueView_VerifyEvent(object sender, EventArgs e)
 {
     if (MessageBoxEx.Show("确认要审核吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
     {
         return;
     }
     verify = new UCVerify();
     if (verify.ShowDialog() == DialogResult.OK)
     {
         List<SQLObj> listSql = new List<SQLObj>();
         SQLObj obj = new SQLObj();
         obj.cmdType = CommandType.Text;
         Dictionary<string, ParamObj> dicParam = new Dictionary<string, ParamObj>();
         dicParam.Add("rescue_id", new ParamObj("rescue_id", strRescueId, SysDbType.VarChar, 40));//单据ID
         dicParam.Add("document_status", new ParamObj("document_status", verify.auditStatus, SysDbType.VarChar, 40));//单据状态
         dicParam.Add("Verify_advice", new ParamObj("Verify_advice", verify.Content, 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_rescue_info set document_status=@document_status,Verify_advice=@Verify_advice,update_by=@update_by,update_name=@update_name,update_time=@update_time where rescue_id=@rescue_id";
         obj.Param = dicParam;
         listSql.Add(obj);
         if (DBHelper.BatchExeSQLMultiByTrans("更新单据状态为审核", listSql))
         {
             MessageBoxEx.Show("审核成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             uc.BindPageData();
             deleteMenuByTag(this.Tag.ToString(), "UCRepairRescueView");
         }
     }
 }
 void UCFetchMaterialManager_VerifyEvent(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["fetch_id"].Value.ToString());
         }
     }
     if (listField.Count <= 0)
     {
         MessageBoxEx.Show("请选择需要审核的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     if (MessageBoxEx.Show("确认要审核吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
     {
         return;
     }
     Dictionary<string, long> OrderIDDateDic = new Dictionary<string, long>();//获取需要核实的记录行
     verify = new UCVerify();
     if (verify.ShowDialog() == DialogResult.OK)
     {
         List<SQLObj> listSql = new List<SQLObj>();
         foreach (DataGridViewRow dr in dgvRData.Rows)
         {
             object isCheck = dr.Cells["colCheck"].EditedFormattedValue;
             if (isCheck != null && (bool)isCheck)
             {
                 SQLObj obj = new SQLObj();
                 obj.cmdType = CommandType.Text;
                 Dictionary<string, ParamObj> dicParam = new Dictionary<string, ParamObj>();
                 dicParam.Add("fetch_id", new ParamObj("fetch_id", dr.Cells["fetch_id"].Value, SysDbType.VarChar, 40));//单据ID
                 dicParam.Add("info_status", new ParamObj("info_status", verify.auditStatus, SysDbType.VarChar, 40));//单据状态
                 dicParam.Add("Verify_advice", new ParamObj("Verify_advice", verify.Content, 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_fetch_material set info_status=@info_status,Verify_advice=@Verify_advice,update_by=@update_by,update_name=@update_name,update_time=@update_time where fetch_id=@fetch_id";
                 obj.Param = dicParam;
                 listSql.Add(obj);
                 long OrdeDate = (long)dr.Cells["fetch_time"].Value;
                 OrderIDDateDic.Add(dr.Cells["fetch_id"].Value.ToString(), OrdeDate);//添加已审核单据主键ID和单据日期键值对
             }
         }
        
         if (DBHelper.BatchExeSQLMultiByTrans("更新单据状态为审核", listSql))
         {                  
             string strMsg = string.Empty;
             if (verify.auditStatus == DataSources.EnumAuditStatus.AUDIT)
             {
                 strMsg = "成功";
                 CommonFuncCall.StatisticStock(GetInoutPart(OrderIDDateDic), "领料单明细数据表");//同步更新实际库存
             }
             else
             {
                 strMsg = "不通过";
             }
             MessageBoxEx.Show("审核" + strMsg + "!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             BindPageData();
         }
     }
 }
示例#20
0
 //审核事件
 void UC_VerifyEvent(object sender, EventArgs e)
 {
     bool flag = false;
     foreach (DataGridViewRow dr in dgvRecord.Rows)
     {
         object isCheck = dr.Cells[this.columnCheck.Name].EditedFormattedValue;
         if (isCheck != null && (bool)isCheck)
         {
             flag = true;
             break;
         }
     }
     if (!flag)
     {
         MessageBoxEx.Show("请选择需要审核的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     if (MessageBoxEx.Show("确认要审核吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
     {
         return;
     }
     verify = new UCVerify();
     if (verify.ShowDialog() == DialogResult.OK)
     {
         List<SQLObj> listSql = new List<SQLObj>();               
         foreach (DataGridViewRow dr in dgvRecord.Rows)
         {
             object isCheck = dr.Cells[this.columnCheck.Name].EditedFormattedValue;
             if (isCheck != null && (bool)isCheck)
             {
                 SQLObj obj = new SQLObj();
                 obj.cmdType = CommandType.Text;
                 Dictionary<string, ParamObj> dicParam = new Dictionary<string, ParamObj>();
                 dicParam.Add("announcement_id", new ParamObj("announcement_id", dr.Cells[this.columnId.Name].Value, SysDbType.VarChar, 40));//单据ID
                 dicParam.Add("status", new ParamObj("status", verify.auditStatus.ToString("d"), SysDbType.VarChar, 40));//单据状态
               
                 obj.sqlString = "update sys_announcement set status=@status where announcement_id=@announcement_id";
                 obj.Param = dicParam;
                 listSql.Add(obj);
             }
         }
         if (DBHelper.BatchExeSQLMultiByTrans("", listSql))
         {
             this.BindPageData();
             MessageBoxEx.Show("撤回成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);                    
         }
     }
 }
示例#21
0
        //审核
        void VerifyData()
        {
            string files = string.Empty;

            foreach (DataGridViewRow dgvr in dgvVerification.Rows)
            {
                if (Convert.ToBoolean(dgvr.Cells[colChk.Name].EditedFormattedValue))
                {
                    files += string.Format("'{0}',", dgvr.Cells[colAccountVerificationID.Name].Value);
                }
            }
            if (files.Length == 0)
            {
                MessageBoxEx.Show("请选择要审核的数据!");
                return;
            }
            UCVerify frmVerify = new UCVerify();

            if (frmVerify.ShowDialog() == DialogResult.OK)
            {
                files = files.TrimEnd(',');
                SysSQLString sql = new SysSQLString();
                sql.cmdType   = CommandType.Text;
                sql.sqlString = string.Format("update tb_account_verification set order_status='{0}',Verify_advice='{3}' where account_verification_id in ({1}) and order_status='{2}';",
                                              ((int)frmVerify.auditStatus), files, (int)DataSources.EnumAuditStatus.SUBMIT, frmVerify.Content);
                sql.Param = new Dictionary <string, string>();
                List <SysSQLString> listSql = new List <SysSQLString>();
                listSql.Add(sql);
                //如果是审核不通过,则将没有提交或审核状态的单据设为正常
                if (frmVerify.auditStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    SysSQLString receivableSql = new SysSQLString();
                    receivableSql.cmdType   = CommandType.Text;
                    receivableSql.sqlString = string.Format(@"update tb_parts_sale_billing set is_occupy=@is_occupy where where sale_billing_id in (select order_id from tb_verificationn_documents where account_verification_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =sale_billing_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=sale_billing_id
);
update tb_maintain_settlement_info set is_occupy=@is_occupy where where settlement_id in (select order_id from tb_verificationn_documents where account_verification_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =settlement_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=settlement_id
);
update tb_maintain_three_guaranty_settlement_yt set is_occupy=@is_occupy where where st_id in (select order_id from tb_verificationn_documents where account_verification_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =st_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=st_id
);
update tb_parts_purchase_billing set is_occupy=@is_occupy where where purchase_billing_id in (select order_id from tb_verificationn_documents where account_verification_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =purchase_billing_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=purchase_billing_id
);", files);
                    receivableSql.Param     = new Dictionary <string, string>();
                    receivableSql.Param.Add("is_occupy", ((int)DataSources.EnumImportStaus.OPEN).ToString());
                    receivableSql.Param.Add("@id", files);
                }
                if (DBHelper.BatchExeSQLStringMultiByTrans("审核往来核销", listSql))
                {
                    MessageBoxEx.Show("审核成功!");
                    BindData();
                }
                else
                {
                    MessageBoxEx.Show("审核失败!");
                }
            }
        }
示例#22
0
        void UCYTManager_VerifyEvent(object sender, EventArgs e)
        {
            List<string> listField = GetVerifyRecord();
            if (listField.Count == 0)
            {
                MessageBoxEx.Show("请选择要审核的数据!");
                return;
            }
            UCVerify UcVerify = new UCVerify();
            UcVerify.ShowDialog();
            string Content = UcVerify.Content;
            SYSModel.DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;

            Dictionary<string, string> purchasePlanField = new Dictionary<string, string>();
            if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
            {
                //获取宇通采购订单状态(已审核)
                purchasePlanField.Add("apply_date_time", Common.LocalDateTimeToUtcLong(DateTime.Now).ToString());
                purchasePlanField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                purchasePlanField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
            }
            else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
            {
                //获取宇通采购订单状态(审核不通过)
                purchasePlanField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                purchasePlanField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
            }
            bool flag = DBHelper.BatchUpdateDataByIn("批量审核宇通采购订单表", "tb_parts_purchase_order_2", purchasePlanField, "purchase_order_yt_id", listField.ToArray());
            if (flag)
            {
                if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                {
                    DealPurascherToYT(listField);
                }
                BindgvYTPurchaseOrderList();
                MessageBoxEx.Show("操作成功!");
            }
            else
            {
                MessageBoxEx.Show("操作失败!");
            }
        }
        //审核
        void UCAccountVerificationAdd_VerifyEvent(object sender, EventArgs e)
        {
            if (!MessageBoxEx.ShowQuestion("确认要审核当前单据!"))
            {
                return;
            }
            UCVerify frmVerify = new UCVerify();
            if (frmVerify.ShowDialog() == DialogResult.OK)
            {
                SysSQLString sql = new SysSQLString();
                sql.cmdType = CommandType.Text;
                sql.sqlString = string.Format("update tb_account_verification set order_status='{0}',Verify_advice='{3}' where account_verification_id='{1}' and order_status='{2}';",
                    ((int)frmVerify.auditStatus), id, (int)DataSources.EnumAuditStatus.SUBMIT, frmVerify.Content);
                sql.Param = new Dictionary<string, string>();
                List<SysSQLString> listSql = new List<SysSQLString>();
                listSql.Add(sql);
                //如果是审核不通过,则将没有提交或审核状态的单据设为正常
                if (frmVerify.auditStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    SysSQLString receivableSql = new SysSQLString();
                    receivableSql.cmdType = CommandType.Text;
                    receivableSql.sqlString = string.Format(@"update tb_parts_sale_billing set is_occupy=@is_occupy where where sale_billing_id in (select order_id from tb_verificationn_documents where account_verification_id='{0}') and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =sale_billing_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=sale_billing_id
);
update tb_maintain_settlement_info set is_occupy=@is_occupy where where settlement_id in (select order_id from tb_verificationn_documents where account_verification_id='{0}') and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =settlement_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=settlement_id
);
update tb_maintain_three_guaranty_settlement_yt set is_occupy=@is_occupy where where st_id in (select order_id from tb_verificationn_documents where account_verification_id='{0}') and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =st_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=st_id
);
update tb_parts_purchase_billing set is_occupy=@is_occupy where where purchase_billing_id in (select order_id from tb_verificationn_documents where account_verification_id='{0}') and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =purchase_billing_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=purchase_billing_id
);", id);
                    receivableSql.Param = new Dictionary<string, string>();
                    receivableSql.Param.Add("is_occupy", ((int)DataSources.EnumImportStaus.OPEN).ToString());
                    receivableSql.Param.Add("@id", id);
                }
                if (DBHelper.BatchExeSQLStringMultiByTrans("审核往来核销", listSql))
                {
                    MessageBoxEx.Show("审核成功!");
                    BindData();
                }
                else
                {
                    MessageBoxEx.Show("审核失败!");
                }
            }
        }
        /// <summary> 审核事件 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void UCPurchaseBillManang_VerifyEvent(object sender, EventArgs e)
        {
            List<string> listField = GetVerifyRecord();
            if (listField.Count == 0)
            {
                MessageBoxEx.Show("请选择要审核的数据!");
                return;
            }
            UCVerify UcVerify = new UCVerify();
            if (UcVerify.ShowDialog() == DialogResult.OK)
            {
                string Content = UcVerify.Content;
                SYSModel.DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;

                List<SysSQLString> list_sql = new List<SysSQLString>();
                for (int i = 0; i < listField.Count; i++)
                {
                    SysSQLString sysStringSql = new SysSQLString();
                    sysStringSql.cmdType = CommandType.Text;
                    Dictionary<string, string> dic = new Dictionary<string, string>();
                    if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                    {
                        //获取采购开单状态(已审核)
                        dic.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                        dic.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
                    }
                    else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                    {
                        //获取采购开单状态(审核不通过)
                        dic.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                        dic.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
                    }
                    dic.Add("update_by", GlobalStaticObj.UserID);//修改人Id
                    dic.Add("update_name", GlobalStaticObj.UserName);//修改人姓名
                    dic.Add("update_time", Common.LocalDateTimeToUtcLong(DateTime.Now).ToString());//修改时间  
                    dic.Add("purchase_billing_id", listField[i]);
                    sysStringSql.sqlString = @"update tb_parts_purchase_billing set 
                                               order_status=@order_status,order_status_name=@order_status_name,
                                               update_by=@update_by,update_name=@update_name,update_time=@update_time 
                                               where purchase_billing_id=@purchase_billing_id";
                    sysStringSql.Param = dic;
                    list_sql.Add(sysStringSql);
                }
                if (DBHelper.BatchExeSQLStringMultiByTrans("采购开单审核操作", list_sql))
                {
                    if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                    {
                        CreateBill(listField);
                    }
                    BindgvPurchaseOrderList();
                    MessageBoxEx.Show("操作成功!");
                }
                else
                {
                    MessageBoxEx.Show("操作失败!");
                }
            }
        }
示例#25
0
        void UCFMaterialReturnManager_VerifyEvent(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["refund_id"].Value.ToString());
                }
            }
            if (listField.Count <= 0)
            {
                MessageBoxEx.Show("请选择需要审核的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            //if (MessageBoxEx.Show("确认要审核吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
            //{
            //    return;
            //}
            Dictionary <string, long> OrderIDDateDic = new Dictionary <string, long>();//获取需要核实的记录行

            verify = new UCVerify();
            if (verify.ShowDialog() == DialogResult.OK)
            {
                List <SQLObj> listSql = new List <SQLObj>();
                foreach (DataGridViewRow dr in dgvRData.Rows)
                {
                    object isCheck = dr.Cells["colCheck"].EditedFormattedValue;
                    if (isCheck != null && (bool)isCheck)
                    {
                        SQLObj obj = new SQLObj();
                        obj.cmdType = CommandType.Text;
                        Dictionary <string, ParamObj> dicParam = new Dictionary <string, ParamObj>();
                        dicParam.Add("refund_id", new ParamObj("refund_id", dr.Cells["refund_id"].Value, SysDbType.VarChar, 40));                                                          //单据ID
                        dicParam.Add("info_status", new ParamObj("info_status", verify.auditStatus, SysDbType.VarChar, 40));                                                               //单据状态
                        dicParam.Add("Verify_advice", new ParamObj("Verify_advice", verify.Content, 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_refund_material set info_status=@info_status,Verify_advice=@Verify_advice,update_by=@update_by,update_name=@update_name,update_time=@update_time where refund_id=@refund_id";
                        obj.Param     = dicParam;
                        listSql.Add(obj);
                        long OrdeDate = (long)dr.Cells["refund_time"].Value;
                        OrderIDDateDic.Add(dr.Cells["refund_id"].Value.ToString(), OrdeDate);//添加已审核单据主键ID和单据日期键值对
                    }
                }
                if (DBHelper.BatchExeSQLMultiByTrans("更新单据状态为审核", listSql))
                {
                    string strMsg = string.Empty;
                    if (verify.auditStatus == DataSources.EnumAuditStatus.AUDIT)
                    {
                        strMsg = "成功";
                        CommonFuncCall.StatisticStock(GetInoutPart(OrderIDDateDic), "领料单明细数据表");//同步更新实际库存
                    }
                    else
                    {
                        strMsg = "不通过";
                    }
                    MessageBoxEx.Show("审核" + strMsg + "!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    BindPageData();
                }
            }
        }
示例#26
0
 void UCReceiveView_VerifyEvent(object sender, EventArgs e)
 {
     if (MessageBoxEx.Show("确认要审核吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
     {
         return;
     }
     verify = new UCVerify(); 
     if (verify.ShowDialog() == DialogResult.OK)
     {
         List<SQLObj> listSql = new List<SQLObj>();
         SQLObj obj = new SQLObj();
         obj.cmdType = CommandType.Text;
         Dictionary<string, ParamObj> dicParam = new Dictionary<string, ParamObj>();
         dicParam.Add("maintain_id", new ParamObj("maintain_id", strReceiveId, SysDbType.VarChar, 40));//单据ID
         dicParam.Add("info_status", new ParamObj("info_status", verify.auditStatus, SysDbType.VarChar, 40));//单据状态
         dicParam.Add("Verify_advice", new ParamObj("Verify_advice", verify.Content, 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 info_status=@info_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);
         UpdateMaintainInfo(listSql, strBeforOrderId, strBeforSource, "0");
         if (DBHelper.BatchExeSQLMultiByTrans("更新单据状态为审核", listSql))
         {
             string strMsg = string.Empty;
             if (verify.auditStatus == DataSources.EnumAuditStatus.AUDIT)
             {
                 strMsg = "成功";
             }
             else
             {
                 strMsg = "不通过";
             }
             MessageBoxEx.Show("审核" + strMsg + "!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);                 
             uc.BindPageData();
             deleteMenuByTag(this.Tag.ToString(), uc.Name);
         }
     }
 }
        /// <summary>
        /// 审核事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void UCPurchasePlanOrderManager_VerifyEvent(object sender, EventArgs e)
        {
            List<string> listField = GetVerifyRecord();
            if (listField.Count == 0)
            {
                MessageBoxEx.Show("请选择要审核的数据!");
                return;
            }
            UCVerify UcVerify= new UCVerify();
            if (UcVerify.ShowDialog() == DialogResult.OK)
            {
                string Content = UcVerify.Content;
                SYSModel.DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;

                Dictionary<string, string> purchasePlanField = new Dictionary<string, string>();
                if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                {
                    //获取采购计划单状态(已审核)
                    purchasePlanField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                    purchasePlanField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));

                    //生成预支付单
                }
                else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    //获取采购计划单状态(审核不通过)
                    purchasePlanField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                    purchasePlanField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
                }
                bool flag = DBHelper.BatchUpdateDataByIn("批量审核采购计划单表", "tb_parts_purchase_plan", purchasePlanField, "plan_id", listField.ToArray());
                if (flag)
                {
                    BindgvPurchasePlanOrderList();
                    MessageBoxEx.Show("操作成功!");
                }
                else
                {
                    MessageBoxEx.Show("操作失败!");
                }
            }
        }
 void UCFetchMaterialView_VerifyEvent(object sender, EventArgs e)
 {
     //if (MessageBoxEx.Show("确认要审核吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
     //{
     //    return;
     //}
     verify = new UCVerify();
     if (verify.ShowDialog() == DialogResult.OK)
     {
         Dictionary<string, long> OrderIDDateDic = new Dictionary<string, long>();//获取需要核实的记录行
         List<SQLObj> listSql = new List<SQLObj>();
         SQLObj obj = new SQLObj();
         obj.cmdType = CommandType.Text;
         Dictionary<string, ParamObj> dicParam = new Dictionary<string, ParamObj>();
         dicParam.Add("fetch_id", new ParamObj("fetch_id",strRescueId, SysDbType.VarChar, 40));//单据ID
         dicParam.Add("info_status", new ParamObj("info_status", verify.auditStatus, SysDbType.VarChar, 40));//单据状态
         dicParam.Add("Verify_advice", new ParamObj("Verify_advice", verify.Content, 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_fetch_material set info_status=@info_status,Verify_advice=@Verify_advice,update_by=@update_by,update_name=@update_name,update_time=@update_time where fetch_id=@fetch_id";
         obj.Param = dicParam;
         listSql.Add(obj);
         long OrdeDate = (long)Convert.ToInt64(strFetchTime);
         OrderIDDateDic.Add(strRescueId, OrdeDate);//添加已审核单据主键ID和单据日期键值对
         if (DBHelper.BatchExeSQLMultiByTrans("更新单据状态为审核", listSql))
         {
             string strMsg = string.Empty;
             if (verify.auditStatus == DataSources.EnumAuditStatus.AUDIT)
             {
                 strMsg = "成功";
                 CommonFuncCall.StatisticStock(GetInoutPart(OrderIDDateDic), "领料单明细数据表");//同步更新实际库存
             }
             else
             {
                 strMsg = "不通过";
             }
             MessageBoxEx.Show("审核" + strMsg + "!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             uc.BindPageData();
             deleteMenuByTag(this.Tag.ToString(), uc.Name);
         }
     }
 }
        //审核
        void VerifyData()
        {
            string files = string.Empty;
            foreach (DataGridViewRow dgvr in dgvVerification.Rows)
            {
                if (Convert.ToBoolean(dgvr.Cells[colChk.Name].EditedFormattedValue))
                {
                    files += string.Format("'{0}',", dgvr.Cells[colAccountVerificationID.Name].Value);
                }
            }
            if (files.Length == 0)
            {
                MessageBoxEx.Show("请选择要审核的数据!");
                return;
            }
            UCVerify frmVerify = new UCVerify();
            if (frmVerify.ShowDialog() == DialogResult.OK)
            {
                files = files.TrimEnd(',');
                SysSQLString sql = new SysSQLString();
                sql.cmdType = CommandType.Text;
                sql.sqlString = string.Format("update tb_account_verification set order_status='{0}',Verify_advice='{3}' where account_verification_id in ({1}) and order_status='{2}';",
                    ((int)frmVerify.auditStatus), files, (int)DataSources.EnumAuditStatus.SUBMIT, frmVerify.Content);
                sql.Param = new Dictionary<string, string>();
                List<SysSQLString> listSql = new List<SysSQLString>();
                listSql.Add(sql);
                //如果是审核不通过,则将没有提交或审核状态的单据设为正常
                if (frmVerify.auditStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    SysSQLString receivableSql = new SysSQLString();
                    receivableSql.cmdType = CommandType.Text;
                    receivableSql.sqlString = string.Format(@"update tb_parts_sale_billing set is_occupy=@is_occupy where where sale_billing_id in (select order_id from tb_verificationn_documents where account_verification_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =sale_billing_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=sale_billing_id
);
update tb_maintain_settlement_info set is_occupy=@is_occupy where where settlement_id in (select order_id from tb_verificationn_documents where account_verification_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =settlement_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=settlement_id
);
update tb_maintain_three_guaranty_settlement_yt set is_occupy=@is_occupy where where st_id in (select order_id from tb_verificationn_documents where account_verification_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =st_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=st_id
);
update tb_parts_purchase_billing set is_occupy=@is_occupy where where purchase_billing_id in (select order_id from tb_verificationn_documents where account_verification_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =purchase_billing_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=purchase_billing_id
);", files);
                    receivableSql.Param = new Dictionary<string, string>();
                    receivableSql.Param.Add("is_occupy", ((int)DataSources.EnumImportStaus.OPEN).ToString());
                    receivableSql.Param.Add("@id", files);
                }
                if (DBHelper.BatchExeSQLStringMultiByTrans("审核往来核销", listSql))
                {
                    MessageBoxEx.Show("审核成功!");
                    BindData();
                }
                else
                {
                    MessageBoxEx.Show("审核失败!");
                }
            }
        }
        /// <summary>
        /// 审核操作
        /// </summary>
        /// <param name="send"></param>
        /// <param name="e"></param>
        private void UCAllocationBillManager_VerifyEvent(object send, EventArgs e)
        {
            try
            {

                Dictionary<string,long> OrderIDDateDic = GetVerifyRecord();//获取需要核实的记录行
                if (InoutIDValuelist.Count == 0)
                {
                    MessageBoxEx.Show("请选择符合审核条件的单据!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
                    return;
                }

                UCVerify UcVerify = new UCVerify();
                UcVerify.ShowDialog();
                string Content = UcVerify.Content;
                DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;//获取审核状态

                Dictionary<string, string> AllocBillField = new Dictionary<string, string>();
                if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                {
                    //获取出入库单状态(已审核)
                    AllocBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                    AllocBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
                }
                else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    //获取出入库单状态(审核不通过)
                    AllocBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                    AllocBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
                }
                bool flag = DBHelper.BatchUpdateDataByIn(InOutVerifyLogMsg, InOutTable, AllocBillField, InOutID, InoutIDValuelist.ToArray());//批量审核获取的出入库单记录
                if (flag)
                {
                    CommonFuncCall.StatisticStock(OrderIDDateDic, InOutID, PartCount, InOutPartTable);//同步更新实际库存
                    MessageBoxEx.Show("审核成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    string QueryWhere = " order_status_name='已审核通过' ";
                    GetInOutBillList(QueryWhere);//刷新出入库单列表
                    
                }
                else
                {
                    MessageBoxEx.Show("审核失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
 void UCOldPartsPalautusManager_VerifyEvent(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["return_id"].Value.ToString());
         }
     }
     if (listField.Count <= 0)
     {
         MessageBoxEx.Show("请选择需要审核的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     //if (MessageBoxEx.Show("确认要审核吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
     //{
     //    return;
     //}
     verify = new UCVerify();
     if (verify.ShowDialog() == DialogResult.OK)
     {
         List<SQLObj> listSql = new List<SQLObj>();
         foreach (DataGridViewRow dr in dgvRData.Rows)
         {
             object isCheck = dr.Cells["colCheck"].EditedFormattedValue;
             if (isCheck != null && (bool)isCheck)
             {
                 SQLObj obj = new SQLObj();
                 obj.cmdType = CommandType.Text;
                 Dictionary<string, ParamObj> dicParam = new Dictionary<string, ParamObj>();
                 dicParam.Add("return_id", new ParamObj("return_id", dr.Cells["return_id"].Value, SysDbType.VarChar, 40));//单据ID
                 dicParam.Add("info_status", new ParamObj("info_status", verify.auditStatus, SysDbType.VarChar, 40));//单据状态
                 dicParam.Add("verify_advice", new ParamObj("verify_advice", verify.Content, 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_oldpart_recycle set info_status=@info_status,verify_advice=@verify_advice,update_by=@update_by,update_name=@update_name,update_time=@update_time where return_id=@return_id";
                 obj.Param = dicParam;
                 listSql.Add(obj);
             }
         }
         if (DBHelper.BatchExeSQLMultiByTrans("更新单据状态为审核", listSql))
         {
             string strMsg = string.Empty;
             if (verify.auditStatus == DataSources.EnumAuditStatus.AUDIT)
             {
                 strMsg = "成功";
             }
             else
             {
                 strMsg = "不通过";
             }
             MessageBoxEx.Show("审核" + strMsg + "!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             BindPageData();
         }
     }
 }
示例#32
0
        //审核
        void VerifyData()
        {
            string files = string.Empty;

            foreach (DataGridViewRow dgvr in dgvBillReceivable.Rows)
            {
                if (Convert.ToBoolean(dgvr.Cells[colCheck.Name].EditedFormattedValue))
                {
                    files += string.Format("'{0}',", dgvr.Cells[colPayableSingleID.Name].Value);
                }
            }
            if (files.Length == 0)
            {
                MessageBoxEx.Show("请选择要审核的数据!");
                return;
            }
            UCVerify frmVerify = new UCVerify();

            if (frmVerify.ShowDialog() == DialogResult.OK)
            {
                files = files.TrimEnd(',');
                SysSQLString sql = new SysSQLString();
                sql.cmdType   = CommandType.Text;
                sql.sqlString = string.Format("update tb_bill_receivable set order_status='{0}',Verify_advice='{1}' where payable_single_id in ({2}) and order_status='{3}';",
                                              (int)frmVerify.auditStatus, frmVerify.Content, files, (int)DataSources.EnumAuditStatus.SUBMIT);
                sql.Param = new Dictionary <string, string>();
                List <SysSQLString> listSql = new List <SysSQLString>();
                listSql.Add(sql);
                //如果是审核不通过,则将没有提交或审核状态的单据设为正常
                if (frmVerify.auditStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    #region 将没有提交或审核状态的单据设为正常
                    if (orderType == DataSources.EnumOrderType.RECEIVABLE)
                    {
                        SysSQLString receivableSql = new SysSQLString();
                        receivableSql.cmdType   = CommandType.Text;
                        receivableSql.sqlString = string.Format(@"update tb_parts_sale_billing set is_lock=@is_lock where sale_billing_id in (select documents_id from tb_balance_documents where order_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =sale_billing_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=sale_billing_id
);
update tb_parts_sale_order set is_lock=@is_lock where sale_order_id in (select documents_id from tb_balance_documents where order_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =sale_order_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=sale_order_id
);
update tb_maintain_settlement_info set is_lock=@is_lock where settlement_id in (select documents_id from tb_balance_documents where order_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =settlement_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=settlement_id
);
update tb_maintain_three_guaranty_settlement set is_lock=@is_lock where st_id in (select documents_id from tb_balance_documents where order_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =st_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=st_id
);", files);
                        receivableSql.Param     = new Dictionary <string, string>();
                        receivableSql.Param.Add("is_lock", ((int)DataSources.EnumImportStaus.OPEN).ToString());
                        //receivableSql.Param.Add("@id", files);
                        listSql.Add(receivableSql);
                    }
                    else
                    {
                        SysSQLString purchaseBillingSql = new SysSQLString();
                        purchaseBillingSql.cmdType   = CommandType.Text;
                        purchaseBillingSql.sqlString = string.Format(@"update tb_parts_purchase_billing set is_lock=@is_lock where purchase_billing_id in (select documents_id from tb_balance_documents where order_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =purchase_billing_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=purchase_billing_id
);
                                                  update tb_parts_purchase_order set is_lock=@is_lock where order_id in (select documents_id from tb_balance_documents where order_id in ({0})) and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =order_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=order_id
);  ", files);
                        purchaseBillingSql.Param     = new Dictionary <string, string>();
                        purchaseBillingSql.Param.Add("is_lock", ((int)DataSources.EnumImportStaus.OPEN).ToString());
                        //purchaseBillingSql.Param.Add("@id", files);
                        listSql.Add(purchaseBillingSql);
                    }
                    #endregion
                    //审核失败需重新计算已结算/预收付金额
                    foreach (DataGridViewRow dgvr in dgvBillReceivable.Rows)
                    {
                        if (Convert.ToBoolean(dgvr.Cells[colCheck.Name].EditedFormattedValue))
                        {
                            int    strOrderType = Convert.ToInt32(dgvr.Cells[colOrderType.Name].Tag);
                            string order_id     = dgvr.Cells[colPayableSingleID.Name].Value.ToString();
                            //如果是应收付,则计算已结算金额
                            if (strOrderType == 1)
                            {
                                Financial.DocumentSettlementByBill(orderType, order_id, listSql);
                            }
                            //预收付,则计算预收付金额
                            else if (strOrderType == 0)
                            {
                                Financial.DocumentAdvanceByBill(orderType, order_id, listSql);
                            }
                        }
                    }
                }
                if (DBHelper.BatchExeSQLStringMultiByTrans("审核应收应付", listSql))
                {
                    MessageBoxEx.Show("审核成功!");
                    BindData();
                }
                else
                {
                    MessageBoxEx.Show("审核失败!");
                }
            }
        }
        //审核
        void VerifyData()
        {
            UCVerify frmVerify = new UCVerify();
            if (frmVerify.ShowDialog() == DialogResult.OK)
            {
                SysSQLString sql = new SysSQLString();
                sql.cmdType = CommandType.Text;
                sql.sqlString = string.Format("update tb_account_verification set order_status='{0}',Verify_advice='{3}' where account_verification_id='{1}' and order_status='{2}';",
                    ((int)frmVerify.auditStatus), id, (int)DataSources.EnumAuditStatus.SUBMIT, frmVerify.Content);
                sql.Param = new Dictionary<string, string>();
                List<SysSQLString> listSql = new List<SysSQLString>();
                listSql.Add(sql);
                //如果是审核不通过,则将没有提交或审核状态的单据设为正常
                if (frmVerify.auditStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    #region 将没有提交或审核状态的单据设为正常
                    SysSQLString receivableSql = new SysSQLString();
                    receivableSql.cmdType = CommandType.Text;
                    receivableSql.sqlString = string.Format(@"update tb_parts_sale_billing set is_lock=@is_lock where sale_billing_id in (select order_id from tb_verificationn_documents where account_verification_id='{0}') and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =sale_billing_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=sale_billing_id
);
update tb_maintain_settlement_info set is_lock=@is_lock where settlement_id in (select order_id from tb_verificationn_documents where account_verification_id='{0}') and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =settlement_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=settlement_id
);
update tb_maintain_three_guaranty_settlement set is_lock=@is_lock where st_id in (select order_id from tb_verificationn_documents where account_verification_id='{0}') and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =st_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=st_id
);
update tb_parts_purchase_billing set is_lock=@is_lock where purchase_billing_id in (select order_id from tb_verificationn_documents where account_verification_id='{0}') and  exists (
select a.documents_id from tb_balance_documents a inner join tb_bill_receivable b on a.order_id=b.payable_single_id
where order_status in ('1','2') and a.documents_id =purchase_billing_id
union all
select b.order_id from tb_account_verification a inner join tb_verificationn_documents b on a.account_verification_id=b.account_verification_id
where a.order_status in ('1','2') and b.order_id=purchase_billing_id
);", id);
                    receivableSql.Param = new Dictionary<string, string>();
                    receivableSql.Param.Add("is_lock", ((int)DataSources.EnumImportStaus.OPEN).ToString());
                    //receivableSql.Param.Add("@id", id);
                    listSql.Add(receivableSql);
                    #endregion
                    //审核失败需重新计算已结算金额
                    DataSources.EnumAccountVerification enumAccount = (DataSources.EnumAccountVerification)Convert.ToInt32(cboOrderType.SelectedValue);
                    Financial.DocumentSettlementByVerification(enumAccount, id, listSql);
                }
                if (DBHelper.BatchExeSQLStringMultiByTrans("审核往来核销", listSql))
                {
                    MessageBoxEx.Show("审核成功!");
                    if (uc != null)
                    {
                        uc.BindData(id);
                        isAutoClose = true;
                        deleteMenuByTag(this.Tag.ToString(), uc.Name);
                    }
                }
                else
                {
                    MessageBoxEx.Show("审核失败!");
                }
            }
        }
        void UCBulletinAddOrEdit_VerifyEvent(object sender, EventArgs e)
        {
            if (MessageBoxEx.Show("确认要审核吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return;
            }
            verify = new UCVerify();
            if (verify.ShowDialog() == DialogResult.OK)
            {
                List<SQLObj> listSql = new List<SQLObj>();

                SQLObj obj = new SQLObj();
                obj.cmdType = CommandType.Text;

                Dictionary<string, ParamObj> dicParam = new Dictionary<string, ParamObj>();

                dicParam.Add("announcement_id", new ParamObj("announcement_id", id, SysDbType.VarChar, 40));//单据ID
                dicParam.Add("status", new ParamObj("status", verify.auditStatus, SysDbType.VarChar, 40));//单据状态
                dicParam.Add("Verify_advice", new ParamObj("Verify_advice", verify.Content, SysDbType.VarChar, 200));//审核意见
                obj.sqlString = "update sys_announcement set status=@status,Verify_advice=@Verify_advice where announcement_id=@announcement_id";
                obj.Param = dicParam;
                listSql.Add(obj);
                if (DBHelper.BatchExeSQLMultiByTrans("更新单据状态为提交", listSql))
                {
                    if (this.RefreshDataStart != null)
                    {
                        this.RefreshDataStart();
                    }
                    MessageBoxEx.Show("审核成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    deleteMenuByTag(this.Tag.ToString(), this.parentName);
                    //deleteMenuByTag(this.Tag.ToString(), "UCBulletinAddOrEdit");
                }
            }
        }
        /// <summary>
        /// 审核操作
        /// </summary>
        /// <param name="send"></param>
        /// <param name="e"></param>
        private void UCAllocationBillManager_VerifyEvent(object send, EventArgs e)
        {
            try
            {

                Dictionary<string, long> OrderIDDateDic = GetVerifyRecord();//获取需要核实的记录行
                if (InoutIDValuelist.Count == 0)
                {
                    MessageBoxEx.Show("请选择符合审核条件的单据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                UCVerify UcVerify = new UCVerify();
                UcVerify.ShowDialog();
                string Content = UcVerify.Content;
                DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;//获取审核状态

                Dictionary<string, string> AllocBillField = new Dictionary<string, string>();
                if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                {
                    //获取出入库单状态(已审核)
                    AllocBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                    AllocBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
                }
                else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                {
                    //获取出入库单状态(审核不通过)
                    AllocBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                    AllocBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
                }
                bool flag = DBHelper.BatchUpdateDataByIn(InOutVerifyLogMsg, InOutTable, AllocBillField, InOutID, InoutIDValuelist.ToArray());//批量审核获取的出入库单记录
                if (flag)
                {
                    CommonFuncCall.StatisticStock(GetInoutPart(OrderIDDateDic), "出入库单配件表");//同步更新实际库存
                    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 order_status_name='已审核通过' and IOBillTb.order_date between  " + StartDate + " and " + EndDate;//默认查询条件
                    GetInOutBillList(DefaultWhere);//刷新出入库单列表

                }
                else
                {
                    MessageBoxEx.Show("审核失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
        /// <summary>
        /// 审核报损单
        /// </summary>
        /// <param name="send"></param>
        /// <param name="e"></param>
        private void UCReportedLossBillManager_VerifyEvent(object send, EventArgs e)
        {
            try
            {
                Dictionary<string, long> OrderIDDateDic = GetVerifyRecord();//获取需要核实的记录行
                if (LossIDValuelist.Count == 0 && gvLossBillList.SelectedRows.Count == 0)
                {
                    MessageBoxEx.Show("请选择符合审核条件的单据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                UCVerify UcVerify = new UCVerify();
                UcVerify.ShowDialog();
                if (UcVerify.DialogResult == DialogResult.OK)
                {
                    string Content = UcVerify.Content;
                    DataSources.EnumAuditStatus UcVerifyStatus = UcVerify.auditStatus;//获取审核状态
               
                    Dictionary<string, string> ShippingBillField = new Dictionary<string, string>();
                    if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                    {
                        //获取报损单状态(已审核)
                        ShippingBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.AUDIT).ToString());
                        ShippingBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.AUDIT, true));
                    }
                    else if (UcVerifyStatus == DataSources.EnumAuditStatus.NOTAUDIT)
                    {
                        //获取报损单状态(审核不通过)
                        ShippingBillField.Add("order_status", Convert.ToInt32(DataSources.EnumAuditStatus.NOTAUDIT).ToString());
                        ShippingBillField.Add("order_status_name", DataSources.GetDescription(DataSources.EnumAuditStatus.NOTAUDIT, true));
                    }
                    bool flag = DBHelper.BatchUpdateDataByIn(LossVerifyLogMsg, LossTable, ShippingBillField, StockLossID, LossIDValuelist.ToArray());//批量审核获取的报损单记录
                    if (flag)
                    {
                        if (UcVerifyStatus == DataSources.EnumAuditStatus.AUDIT)
                        {
                            CommonFuncCall.StatisticStock(GetLossPart(OrderIDDateDic), "报损单配件表");//同步更新报损单账面库存
                        }
                        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 LsBillTb.order_date between  " + StartDate + " and " + EndDate;//默认查询条件
                        GetRepLossBillList(DefaultWhere);//刷新报损单列表

                    }
                    else
                    {
                        MessageBoxEx.Show("审核失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }

            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }