Esempio n. 1
0
        /// <summary>
        /// 对应报价单审核通过
        /// </summary>
        /// <param name="offerSheetID">报价单ID</param>
        /// <param name="offerSheetCode">报价单编号</param>
        private void PassOfferSheet(string offerSheetID, string offerSheetCode)
        {
            AccessDB adb = new AccessDB();

            string    query = "select sum(HW_TOTALPRICE) as REQUIRE_PAYMENT from OSM_HW where OFFERSHEET_CODE = '" + offerSheetCode + "'";
            DataTable dt    = adb.SQLTableQuery(query);

            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                double  require_payment = 0;
                try
                {
                    require_payment = double.Parse(dr["REQUIRE_PAYMENT"].ToString());
                }
                catch (Exception exception)
                {
                    MessageBox.Show("该报价单没有对应的货物列表,无法通过审核!" + exception.ToString(), "警告");
                    return;
                }

                FormOSM_PayMode_Select fps = new FormOSM_PayMode_Select();
                fps.setOfferForm(this);
                fps.StartPosition = FormStartPosition.CenterParent;
                fps.ShowDialog();

                if (!string.IsNullOrWhiteSpace(pay_mode))
                {
                    //生成订单存入数据库
                    string insertSQL = "insert into OSM_ORDER_SHEET(OFFERSHEET_ID,ORDER_STATE,REQUIRE_PAYMENT,ORDER_DATE,PAY_STATE,PAY_MODE) values ('";
                    insertSQL += offerSheetID + "','1'," + require_payment + ",#" + DateTime.Now.ToString("yyyy-MM-dd") + "#,'1','" + pay_mode + "')";
                    if (adb.SQLExecute(insertSQL))
                    {
                        MessageBox.Show("已将审核通过的报价单生成订单", "消息");

                        string sql = "update OSM_OFFER_SHEET set OFFERSHEET_STATE = '2' where ID = " + offerSheetID;
                        if (adb.SQLExecute(sql))
                        {
                            main_form.TSMItem_offer_aduit_Refresh();
                        }
                    }
                }
                else
                {
                    MessageBox.Show("请确定付款方式!", "警告");
                }
            }
            else
            {
                MessageBox.Show("该报价单没有对应的货物列表,无法通过审核!", "警告");
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 对应报价单审核通过
        /// </summary>
        /// <param name="offerSheetID">报价单ID</param>
        /// <param name="offerSheetCode">报价单编号</param>
        private void PassOfferSheet(string offerSheetID, string offerSheetCode)
        {
            AccessDB adb = new AccessDB();

            string query = "select sum(HW_TOTALPRICE) as REQUIRE_PAYMENT from OSM_HW where OFFERSHEET_CODE = '" + offerSheetCode + "'";
            DataTable dt = adb.SQLTableQuery(query);
            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                double require_payment = 0;
                try
                {
                    require_payment = double.Parse(dr["REQUIRE_PAYMENT"].ToString());
                }
                catch (Exception exception)
                {
                    MessageBox.Show("该报价单没有对应的货物列表,无法通过审核!" + exception.ToString(), "警告");
                    return;
                }

                FormOSM_PayMode_Select fps = new FormOSM_PayMode_Select();
                fps.setOfferForm(this);
                fps.StartPosition = FormStartPosition.CenterParent;
                fps.ShowDialog();

                if (!string.IsNullOrWhiteSpace(pay_mode))
                {
                    //生成订单存入数据库
                    string insertSQL = "insert into OSM_ORDER_SHEET(OFFERSHEET_ID,ORDER_STATE,REQUIRE_PAYMENT,ORDER_DATE,PAY_STATE,PAY_MODE) values ('";
                    insertSQL += offerSheetID + "','1'," + require_payment + ",#" + DateTime.Now.ToString("yyyy-MM-dd") + "#,'1','" + pay_mode + "')";
                    if (adb.SQLExecute(insertSQL))
                    {
                        MessageBox.Show("已将审核通过的报价单生成订单", "消息");

                        string sql = "update OSM_OFFER_SHEET set OFFERSHEET_STATE = '2' where ID = " + offerSheetID;
                        if (adb.SQLExecute(sql))
                        {
                            main_form.TSMItem_offer_aduit_Refresh();
                        }
                    }
                }
                else
                {
                    MessageBox.Show("请确定付款方式!", "警告");
                }
            }
            else
            {
                MessageBox.Show("该报价单没有对应的货物列表,无法通过审核!", "警告");
            }
        }