Exemplo n.º 1
0
        public bool UpdateState()
        {
            try
            {
                //验证中间件版本
                string ser_ver = GetServerVer();
                if (ser_ver.Equals(GlobalData.ser_var))
                {
                    //验证数据库版本
                    IBLL.ISys bll    = new BLL.SysBLL();
                    string    db_ver = bll.Read("db_ver");
                    if (!db_ver.Equals(GlobalData.db_var))
                    {
                        throw new Exception("数据库版本错误");
                    }
                }
                else
                {
                    throw new Exception("中间件版本错误");
                }

                return(true);
            }
            catch (Exception ex)
            {
                LogHelper.writeLog(ex);
                return(false);
            }
        }
Exemplo n.º 2
0
        void IOrder.Save()
        {
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                if (txtpay_way.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("付款方式必填!");
                }
                if (txtbranch.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("机构必填!");
                }
                if (txtoper_date.Text.Trim() == "")
                {
                    throw new Exception("单据日期必填!");
                }
                if (this.txtvisa.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("转出账户必填!");
                }
                if (this.txtvisa2.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("转入账户必填!");
                }
                if (Helper.Conv.ToDecimal(txtcash.Text.Trim()) <= 0)
                {
                    throw new Exception("转账金额不正确!");
                }
                Model.bank_t_cash_master ord = new Model.bank_t_cash_master();
                ord.sheet_no     = txtsheet_no.Text.Trim();
                ord.branch_no    = txtbranch.Text.Trim().Split('/')[0];
                ord.voucher_no   = txtold_no.Text.Trim();
                ord.visa_id      = txtvisa.Text.Trim().Split('/')[0];
                ord.visa_in      = txtvisa2.Text.Trim().Split('/')[0];
                ord.pay_way      = txtpay_way.Text.Split('/')[0];
                ord.coin_no      = "RMB";
                ord.coin_rate    = 1;
                ord.deal_man     = txtpeople.Text.Trim().Split('/')[0];
                ord.oper_id      = txtoper_man.Text.Trim().Split('/')[0];
                ord.oper_date    = Helper.Conv.ToDateTime(txtoper_date.Text);
                ord.bill_total   = Helper.Conv.ToDecimal(txtcash.Text.Trim());
                ord.bill_flag    = "B";
                ord.cm_branch    = "00";
                ord.approve_flag = "0";
                ord.approve_man  = "";
                ord.approve_date = System.DateTime.MinValue;
                ord.other1       = txtmemo.Text.Trim();
                ord.other2       = "";
                ord.other3       = "";
                ord.num1         = 0;
                ord.num2         = 0;
                ord.num3         = 0;

                if (runType == 1)
                {
                    IBLL.ICashOrder bll      = new BLL.CashOrder();
                    string          sheet_no = "";
                    bll.Add(ord, out sheet_no);
                    IOrder ins = this;
                    ins.ShowOrder(sheet_no);
                }
                else if (runType == 2)
                {
                    IBLL.ICashOrder bll = new BLL.CashOrder();
                    bll.Change(ord);

                    IOrder ins = this;
                    ins.ShowOrder(ord.sheet_no);
                }

                Dictionary <string, object> dic = this.Tag as Dictionary <string, object>;
                this.Tag = Conv.ControlsAdds(this, dic);

                IBLL.ISys sys       = new BLL.SysBLL();
                string    isApprove = sys.Read("approve_at_ones");
                if ("1".Equals(isApprove))
                {
                    if (YesNoForm.ShowFrom("保存成功!是否立即审核") == DialogResult.Yes)
                    {
                        tsbCheck_Click(new object(), new EventArgs());
                    }
                }
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Exemplo n.º 3
0
        void IOrder.Save()
        {
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                if (txtsup.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("货商必填!");
                }
                if (txtbranch.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("机构必填!");
                }
                if (txtoper_date.Text.Trim() == "")
                {
                    throw new Exception("单据日期必填!");
                }
                if (txtpay_way.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("付款方式必填");
                }
                if (txtvisa.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("账户必填");
                }
                Model.rp_t_recpay_record_info ord = new Model.rp_t_recpay_record_info();
                ord.sheet_no     = txtsheet_no.Text.Trim();
                ord.supcust_no   = txtsup.Text.Split('/')[0];
                ord.supcust_flag = "S";
                ord.flag_post    = "1";
                ord.total_amount = Helper.Conv.ToDecimal(txttotal_amount.Text.Trim());
                ord.free_money   = Helper.Conv.ToDecimal(txtfree_money.Text.Trim());
                ord.coin_no      = "RMB";
                ord.coin_rate    = 1;
                ord.pay_way      = txtpay_way.Text.Split('/')[0];
                ord.approve_flag = "0";
                ord.oper_id      = txtoper_man.Text.Trim().Split('/')[0];
                ord.oper_date    = Helper.Conv.ToDateTime(txtoper_date.Text.Trim());
                ord.deal_man     = txtpeople.Text.Split('/')[0];
                ord.approve_man  = "";
                ord.approve_date = DateTime.MinValue;
                ord.other1       = txtmemo.Text.Trim();
                ord.other2       = "";
                ord.other3       = "";
                ord.visa_id      = txtvisa.Text.Split('/')[0];
                ord.num1         = 0;
                ord.num2         = 0;
                ord.num3         = 0;
                ord.cm_branch    = "00";
                ord.branch_no    = txtbranch.Text.Split('/')[0];
                ord.from_date    = DateTime.MinValue;
                ord.to_date      = DateTime.MinValue;
                ord.rc_sheet_no  = "";
                int flag = 0;
                List <Model.rp_t_recpay_record_detail> lines = new List <Model.rp_t_recpay_record_detail>();
                int     index      = 0;
                decimal pay_amt    = ord.total_amount;
                decimal free_money = ord.free_money;
                decimal get_amt    = 0;
                //应还客户金额
                foreach (DataRow row in editGrid1.DataSource.Rows)
                {
                    if (row["voucher_no"].ToString() != "" && row["select_flag"].ToString() == "1" && row["path"].ToString() == "-1")
                    {
                        get_amt += Conv.ToDecimal(row["pay_amount"]);
                    }
                }
                pay_amt += get_amt;
                foreach (DataRow row in editGrid1.DataSource.Rows)
                {
                    index++;
                    if (row["voucher_no"].ToString() != "" && pay_amt >= 0 && row["select_flag"].ToString() == "1")
                    {
                        /*
                         * if (Helper.Conv.ToDecimal(row["pay_amount"].ToString()) < 0)
                         * {
                         *  throw new Exception("第i行付款金额不正确!".Replace("i", index.ToString()));
                         * }
                         * if (Helper.Conv.ToDecimal(row["pay_free"].ToString()) < 0)
                         * {
                         *  throw new Exception("第i行免付金额不正确!".Replace("i", index.ToString()));
                         * }
                         */
                        decimal need_pay  = Conv.ToDecimal(row["pay_amount"]);
                        decimal repay_amt = 0;
                        decimal pay_fee   = 0;
                        if (row["path"].ToString() == "-1")
                        {
                            repay_amt = need_pay;
                            pay_fee   = 0;
                        }
                        else
                        {
                            if (free_money > need_pay)
                            {
                                pay_fee = need_pay;
                            }
                            else
                            {
                                pay_fee = free_money;
                                if (pay_amt > need_pay - pay_fee)
                                {
                                    repay_amt = need_pay - pay_fee;
                                }
                                else
                                {
                                    repay_amt = pay_amt;
                                }
                            }
                            free_money -= pay_fee;
                            pay_amt    -= repay_amt;
                        }
                        Model.rp_t_recpay_record_detail line = new Model.rp_t_recpay_record_detail();
                        lines.Add(line);
                        line.sheet_no       = ord.sheet_no;
                        line.voucher_no     = row["voucher_no"].ToString();
                        line.sheet_amount   = Helper.Conv.ToDecimal(row["sheet_amount"].ToString());
                        line.pay_amount     = repay_amt; // Helper.Conv.ToDecimal(row["pay_amount"].ToString());
                        line.pay_free       = pay_fee;   // Helper.Conv.ToDecimal(row["pay_free"].ToString());
                        line.memo           = row["memo"].ToString();
                        line.other1         = "";
                        line.other2         = "";
                        line.other3         = "";
                        line.num1           = 0;
                        line.num2           = 0;
                        line.num3           = 0;
                        line.pay_date       = System.DateTime.Now;
                        line.item_no        = "";
                        line.path           = ((row["path"].ToString() == "1" || row["path"].ToString() == "+") ? "+" : "-");
                        line.select_flag    = row["select_flag"].ToString();
                        line.voucher_type   = row["voucher_type"].ToString();
                        line.oper_date      = DateTime.Now;
                        line.voucher_other1 = "";
                        line.voucher_other2 = "";
                        line.order_no       = "";
                        flag = 1;
                    }
                }
                if (flag == 0)
                {
                    throw new Exception("无可结算明细!");
                }
                if (runType == 1)
                {
                    IBLL.ISupSettle bll      = new BLL.SupSettle();
                    string          sheet_no = "";
                    bll.Add(ord, lines, out sheet_no);
                    IOrder ins = this;
                    ins.ShowOrder(sheet_no);
                }
                else if (runType == 2)
                {
                    IBLL.ISupSettle bll = new BLL.SupSettle();
                    bll.Change(ord, lines);
                    IOrder ins = this;
                    ins.ShowOrder(ord.sheet_no);
                }

                Dictionary <string, object> dic = this.Tag as Dictionary <string, object>;
                this.Tag = Helper.Conv.ControlsAdds(this, dic);

                IBLL.ISys sys       = new BLL.SysBLL();
                string    isApprove = sys.Read("approve_at_ones");
                if ("1".Equals(isApprove))
                {
                    if (YesNoForm.ShowFrom("保存成功!是否立即审核") == DialogResult.Yes)
                    {
                        tsbCheck_Click(new object(), new EventArgs());
                    }
                }
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Exemplo n.º 4
0
        void IOrder.Save()
        {
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                if (txt_trans_no.Text.Trim().Contains("/") == false)
                {
                    MsgForm.ShowFrom("业务类型必填!");
                    return;
                }
                if (txtbranch.Text.Trim().Contains("/") == false)
                {
                    MsgForm.ShowFrom("机构必填!");
                    return;
                }
                if (txtoper_date.Text.Trim() == "")
                {
                    MsgForm.ShowFrom("单据日期必填!");
                    return;
                }

                ic_t_inout_store_master        ord   = new ic_t_inout_store_master();
                List <ic_t_inout_store_detail> lines = new List <ic_t_inout_store_detail>();
                ord.sheet_no     = txtsheet_no.Text.Trim();
                ord.trans_no     = txt_trans_no.Text.Trim().Split('/')[0];
                ord.branch_no    = txtbranch.Text.Trim().Split('/')[0];
                ord.voucher_no   = "";
                ord.supcust_no   = "";
                ord.pay_way      = "";
                ord.discount     = 1;
                ord.coin_no      = "RMB";
                ord.tax_amount   = 0;
                ord.oper_date    = Helper.Conv.ToDateTime(txtoper_date.Text.Trim());
                ord.oper_id      = txtoper_man.Text.Split('/')[0];
                ord.deal_man     = txt_deal_man.Text.Split('/')[0];
                ord.cm_branch    = "00";
                ord.other1       = txt_other3.Text.Trim();
                ord.other2       = "";
                ord.other3       = txt_other3.Text.Trim();
                ord.old_no       = txt_old_no.Text;
                ord.num1         = 0;
                ord.num2         = 0;
                ord.num3         = 0;
                ord.sale_no      = "";
                ord.approve_flag = "0";
                ord.approve_man  = txtapprove_man.Text.Split('/')[0];
                ord.approve_date = System.DateTime.MinValue;
                ord.pay_date     = System.DateTime.MinValue;
                ord.update_time  = update_time;

                int     flag      = 0;
                int     index     = 0;
                decimal total_amt = 0;
                foreach (DataRow row in editGrid1.DataSource.Rows)
                {
                    ++index;
                    if (row["item_no"].ToString() != "")
                    {
                        ic_t_inout_store_detail line = new ic_t_inout_store_detail();
                        lines.Add(line);
                        line.sheet_no    = ord.sheet_no;
                        line.item_no     = row["item_no"].ToString();
                        line.item_name   = row["item_name"].ToString();
                        line.unit_no     = row["unit_no"].ToString();
                        line.barcode     = row["barcode"].ToString();
                        line.unit_factor = 1;
                        line.in_qty      = Helper.Conv.ToDecimal(row["in_qty"].ToString());
                        line.orgi_price  = 0;
                        line.valid_price = Helper.Conv.ToDecimal(row["valid_price"].ToString());
                        line.cost_price  = 0;
                        line.sub_amount  = Helper.Conv.ToDecimal(row["sub_amount"].ToString());
                        line.discount    = 1;
                        line.tax         = 0;
                        line.is_tax      = "0";
                        line.valid_date  = DateTime.MinValue;
                        line.other1      = row["other1"].ToString();
                        line.other2      = "";
                        line.other3      = "";
                        line.voucher_no  = "";
                        line.sheet_sort  = index;
                        line.ret_qnty    = 0;
                        line.num1        = 0;
                        line.num2        = 0;
                        line.num3        = 0;
                        line.num4        = 0;
                        line.num5        = 0;
                        line.num6        = 0;
                        line.cost_notax  = 0;
                        line.packqty     = 0;
                        line.sgqty       = 0;
                        flag             = 1;
                        total_amt       += line.in_qty * line.valid_price;
                    }
                }
                if (flag == 0)
                {
                    MsgForm.ShowFrom("请输入表单明细");
                    return;
                }
                ord.inout_amount = total_amt;
                ord.total_amount = total_amt;
                IBLL.IInOutBLL bll = new BLL.InOutBLL();
                if (runType == 1)
                {
                    var sheet_no = "";
                    bll.AddInOut(ord, lines, out sheet_no);
                    IOrder ins = this;
                    ins.ShowOrder(sheet_no);
                }
                else if (runType == 2)
                {
                    bll.ChangeInOut(ord, lines);
                    IOrder ins = this;
                    ins.ShowOrder(ord.sheet_no);
                }

                Dictionary <string, object> dic = this.Tag as Dictionary <string, object>;
                this.Tag = Helper.Conv.ControlsAdds(this, dic);

                IBLL.ISys sys       = new BLL.SysBLL();
                string    isApprove = sys.Read("approve_at_ones");
                if ("1".Equals(isApprove))
                {
                    if (YesNoForm.ShowFrom("保存成功!是否立即审核") == DialogResult.Yes)
                    {
                        tsbCheck_Click(new object(), new EventArgs());
                    }
                }
            }
            catch (Exception ex)
            {
                Helper.LogHelper.writeLog("frmOtherInOutSheet->Save()", ex.ToString(), txtsheet_no.Text);
                MsgForm.ShowFrom("其它出入单保存异常[" + ex.Message + "]");
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Exemplo n.º 5
0
        void IOrder.Save()
        {
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                if (txtbranch.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("机构必填!");
                }
                if (txtoper_date.Text.Trim() == "")
                {
                    throw new Exception("单据日期必填!");
                }
                pm_t_flow_main ord = new pm_t_flow_main();
                List <pm_t_price_flow_detial> lines = new List <pm_t_price_flow_detial>();
                ord.sheet_no     = txtsheet_no.Text.Trim();
                ord.branch_no    = txtbranch.Text.Trim().Split('/')[0];
                ord.vip_type     = "";
                ord.price_type   = "1";
                ord.oper_date    = Helper.Conv.ToDateTime(txtoper_date.Text.Trim());
                ord.oper_id      = txtoper_man.Text.Split('/')[0];
                ord.approve_flag = "0";
                ord.memo         = txtmemo.Text.Trim();
                ord.other1       = "";
                ord.other2       = "";
                ord.other3       = "";
                ord.cm_branch    = "00";
                ord.start_date   = System.DateTime.MinValue;
                ord.end_date     = System.DateTime.MinValue;
                ord.start_time   = "";
                ord.end_time     = "";
                ord.buy_amt      = 0;
                ord.add_amt      = 0;
                ord.deal_man     = txtpeople.Text.Split('/')[0];
                ord.approve_man  = txtapprove_man.Text.Split('/')[0];
                ord.approve_date = System.DateTime.MinValue;
                ord.num1         = 0;
                ord.num2         = 0;
                ord.num3         = 0;
                int flag = 0;
                foreach (DataRow row in editGrid1.DataSource.Rows)
                {
                    if (row["item_no"].ToString() != "")
                    {
                        pm_t_price_flow_detial line = new pm_t_price_flow_detial();
                        lines.Add(line);
                        line.sheet_no   = ord.sheet_no;
                        line.item_no    = row["item_no"].ToString();
                        line.price_type = ord.price_type;
                        line.start_date = ord.start_date;
                        line.end_date   = ord.end_date;
                        line.discount   = 0;
                        line.buy_qnty   = 0;
                        line.other1     = "";
                        line.other2     = "";
                        line.other3     = "";
                        line.start_time = "";
                        line.end_time   = "";
                        line.stock_qty  = 0;
                        line.num1       = 0;
                        line.num2       = 0;
                        line.num3       = 0;

                        line.old_price  = Helper.Conv.ToDecimal(row["old_price"].ToString());
                        line.old_price2 = Helper.Conv.ToDecimal(row["old_price2"].ToString());
                        line.old_price3 = Helper.Conv.ToDecimal(row["old_price3"].ToString());

                        line.new_price  = string.IsNullOrEmpty(row["new_price"].ToString()) ? line.old_price : Helper.Conv.ToDecimal(row["new_price"].ToString());
                        line.new_price2 = string.IsNullOrEmpty(row["new_price2"].ToString()) ? line.old_price2 : Helper.Conv.ToDecimal(row["new_price2"].ToString());
                        line.new_price3 = string.IsNullOrEmpty(row["new_price3"].ToString()) ? line.old_price3 : Helper.Conv.ToDecimal(row["new_price3"].ToString());

                        flag = 1;
                    }
                }
                if (flag == 0)
                {
                    throw new Exception("表体无合法数据!");
                }
                if (runType == 1)
                {
                    IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
                    string sheet_no;
                    bll.Add(ord, lines, out sheet_no);
                    IOrder ins = this;
                    ins.ShowOrder(sheet_no);
                }
                else if (runType == 2)
                {
                    IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
                    bll.Change(ord, lines);
                    IOrder ins = this;
                    ins.ShowOrder(ord.sheet_no);
                }

                Dictionary <string, object> dic = this.Tag as Dictionary <string, object>;
                this.Tag = Helper.Conv.ControlsAdds(this, dic);

                IBLL.ISys sys       = new BLL.SysBLL();
                string    isApprove = sys.Read("approve_at_ones");
                if ("1".Equals(isApprove))
                {
                    if (YesNoForm.ShowFrom("保存成功!是否立即审核") == DialogResult.Yes)
                    {
                        tsbCheck_Click(new object(), new EventArgs());
                    }
                }
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Exemplo n.º 6
0
        void IOrder.Save()
        {
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                if (txt_sup.Text.Trim().Contains("/") == false)
                {
                    MsgForm.ShowFrom("客户编码必填!");
                    return;
                }
                if (txtbranch.Text.Trim().Contains("/") == false)
                {
                    MsgForm.ShowFrom("机构必填!");
                    return;
                }
                if (txtoper_date.Text.Trim() == "")
                {
                    MsgForm.ShowFrom("单据日期必填!");
                    return;
                }

                co_t_order_main         ord   = new co_t_order_main();
                List <co_t_order_child> lines = new List <co_t_order_child>();
                ord.sheet_no     = txtsheet_no.Text.Trim();
                ord.branch_no    = txtbranch.Text.Trim().Split('/')[0];
                ord.sup_no       = txt_sup.Text.Trim().Split('/')[0];
                ord.coin_code    = lbl_coin_no.Text.Trim();
                ord.paid_amount  = Helper.Conv.ToDecimal(txt_paid_amount.Text);
                ord.oper_date    = Helper.Conv.ToDateTime(txtoper_date.Text.Trim());
                ord.oper_id      = txtoper_man.Text.Split('/')[0];
                ord.order_man    = txt_order_man.Text.Split('/')[0];
                ord.trans_no     = "S";
                ord.order_status = "0";
                ord.sale_way     = "A";
                ord.p_sheet_no   = "";
                ord.approve_flag = "0";
                ord.other1       = "";
                ord.cm_branch    = "00";
                ord.approve_man  = txtapprove_man.Text.Split('/')[0];
                ord.approve_date = System.DateTime.MinValue;
                ord.num1         = 0;
                ord.num2         = 0;
                ord.num3         = 0;
                ord.valid_date   = dtvalid_date.Text.ToDateTime();
                ord.memo         = txtmemo1.Text;
                ord.other2       = txtmemo2.Text;

                int     flag      = 0;
                int     index     = 0;
                decimal total_amt = 0;
                foreach (DataRow row in editGrid1.DataSource.Rows)
                {
                    ++index;
                    if (row["item_no"].ToString() != "")
                    {
                        co_t_order_child line = new co_t_order_child();
                        lines.Add(line);
                        line.sheet_no    = ord.sheet_no;
                        line.item_no     = row["item_no"].ToString();
                        line.unit_no     = row["unit_no"].ToString();
                        line.barcode     = row["barcode"].ToString();
                        line.unit_factor = 1;
                        line.discount    = row["discount"].ToDecimal();
                        line.in_price    = Helper.Conv.ToDecimal(row["in_price"].ToString());
                        line.order_qnty  = Helper.Conv.ToDecimal(row["order_qnty"].ToString());
                        line.sub_amount  = Helper.Conv.ToDecimal(row["sub_amount"].ToString());
                        line.discount    = 1;
                        line.other1      = row["other1"].ToString();
                        line.other2      = "";
                        line.voucher_no  = "";
                        line.sheet_sort  = index;
                        line.num1        = 0;
                        line.num2        = 0;
                        line.num3        = 0;
                        line.packqty     = 0;
                        line.sgqty       = 0;
                        flag             = 1;
                        total_amt       += line.order_qnty * line.in_price;
                    }
                }
                if (flag == 0)
                {
                    MsgForm.ShowFrom("请输入表单明细");
                    return;
                }
                ord.total_amount = total_amt;

                if (runType == 1)
                {
                    IBLL.IInOutBLL bll      = new BLL.InOutBLL();
                    var            sheet_no = "";
                    bll.AddSaleSSSheet(ord, lines, out sheet_no);
                    IOrder ins = this;
                    ins.ShowOrder(sheet_no);
                }
                else if (runType == 2)
                {
                    IBLL.IInOutBLL bll = new BLL.InOutBLL();
                    bll.ChangeSaleSSSheet(ord, lines);
                    IOrder ins = this;
                    ins.ShowOrder(ord.sheet_no);
                }

                Dictionary <string, object> dic = this.Tag as Dictionary <string, object>;
                this.Tag = Helper.Conv.ControlsAdds(this, dic);

                IBLL.ISys sys       = new BLL.SysBLL();
                string    isApprove = sys.Read("approve_at_ones");
                if ("1".Equals(isApprove))
                {
                    if (YesNoForm.ShowFrom("保存成功!是否立即审核") == DialogResult.Yes)
                    {
                        tsbCheck_Click(new object(), new EventArgs());
                    }
                }
            }
            catch (Exception ex)
            {
                Helper.LogHelper.writeLog("frmSaleSheet->Save()", ex.ToString(), txtsheet_no.Text);
                MsgForm.ShowFrom("销售订单保存异常[" + ex.Message + "]");
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Exemplo n.º 7
0
        void IOrder.Save()
        {
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                if (txtcus.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("客户必填!");
                }
                if (txtbranch.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("机构必填!");
                }
                if (txtoper_date.Text.Trim() == "")
                {
                    throw new Exception("单据日期必填!");
                }
                this.editGrid1.DataSource.ClearTable("kk_no");
                if (this.editGrid1.DataSource.Rows.Count > 1)
                {
                    throw new Exception("只允许录入一行!");
                }

                Model.rp_t_supcust_fy_master ord = new Model.rp_t_supcust_fy_master();
                ord.sheet_no     = txtsheet_no.Text.Trim();
                ord.supcust_no   = txtcus.Text.Trim().Split('/')[0];
                ord.supcust_flag = "S";
                ord.pay_date     = System.DateTime.Now;
                ord.old_no       = txtold_no.Text.Trim();
                ord.oper_id      = this.txtoper_man.Text.Trim().Split('/')[0];
                ord.oper_date    = Helper.Conv.ToDateTime(this.txtoper_date.Text);
                ord.approve_flag = "0";
                ord.approve_man  = "";
                ord.approve_date = System.DateTime.MinValue;
                ord.is_payed     = "0";
                ord.sale_man     = txtpeople.Text.Trim().Split('/')[0];
                ord.branch_no    = txtbranch.Text.Trim().Split('/')[0];
                ord.cm_branch    = "00";
                ord.other1       = txtmemo.Text.Trim();
                ord.other2       = "";
                ord.other3       = "";
                ord.num1         = 0;
                ord.num2         = 0;
                ord.num3         = 0;
                ord.visa_id      = txtvisa.Text.Trim().Split('/')[0];
                ord.is_over      = "0";
                ord.total_amount = 0;
                ord.paid_amount  = 0;
                ord.pay_way      = "";
                ord.pay_name     = "";
                int flag = 0;
                List <Model.rp_t_supcust_fy_detail> lines = new List <Model.rp_t_supcust_fy_detail>();
                int index = 0;
                foreach (DataRow row in editGrid1.DataSource.Rows)
                {
                    index++;
                    if (row["kk_no"].ToString() != "")
                    {
                        if (Helper.Conv.ToDecimal(row["kk_cash"].ToString()) <= 0)
                        {
                            throw new Exception("第i行费用金额不正确!".Replace("i", index.ToString()));
                        }
                        Model.rp_t_supcust_fy_detail line = new Model.rp_t_supcust_fy_detail();
                        lines.Add(line);
                        line.sheet_no    = ord.sheet_no;
                        line.kk_no       = row["kk_no"].ToString();
                        line.kk_cash     = Helper.Conv.ToDecimal(row["kk_cash"].ToString());
                        line.other1      = row["other1"].ToString();
                        line.other2      = "";
                        line.other3      = "";
                        line.num1        = 0;
                        line.num2        = 0;
                        line.num3        = 0;
                        ord.total_amount = line.kk_cash;
                        if (row["pay_kind"].ToString() == "0" || row["pay_kind"].ToString() == "-")
                        {
                            ord.pay_type = "-";
                        }
                        else
                        {
                            ord.pay_type = "+";
                        }
                        flag = 1;
                    }
                }
                if (flag == 0)
                {
                    throw new Exception("表体无合法数据!");
                }
                if (runType == 1)
                {
                    IBLL.ISupFY bll = new BLL.SupFY();
                    string      sheet_no;
                    bll.Add(ord, lines, out sheet_no);
                    IOrder ins = this;
                    ins.ShowOrder(sheet_no);
                }
                else if (runType == 2)
                {
                    IBLL.ISupFY bll = new BLL.SupFY();
                    bll.Change(ord, lines);
                    IOrder ins = this;
                    ins.ShowOrder(ord.sheet_no);
                }

                Dictionary <string, object> dic = this.Tag as Dictionary <string, object>;
                this.Tag = Helper.Conv.ControlsAdds(this, dic);

                IBLL.ISys sys       = new BLL.SysBLL();
                string    isApprove = sys.Read("approve_at_ones");
                if ("1".Equals(isApprove))
                {
                    if (YesNoForm.ShowFrom("保存成功!是否立即审核") == DialogResult.Yes)
                    {
                        tsbCheck_Click(new object(), new EventArgs());
                    }
                }
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Exemplo n.º 8
0
        void IOrder.Save()
        {
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                if (txtpay_way.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("付款方式必填!");
                }
                if (txtbranch.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("机构必填!");
                }
                if (txtoper_date.Text.Trim() == "")
                {
                    throw new Exception("单据日期必填!");
                }
                if (this.txtvisa.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("账户必填!");
                }
                Model.bank_t_cash_master ord = new Model.bank_t_cash_master();
                ord.sheet_no     = txtsheet_no.Text.Trim();
                ord.branch_no    = txtbranch.Text.Trim().Split('/')[0];
                ord.voucher_no   = txtold_no.Text.Trim();
                ord.visa_id      = txtvisa.Text.Trim().Split('/')[0];
                ord.visa_in      = "";
                ord.pay_way      = txtpay_way.Text.Split('/')[0];
                ord.coin_no      = "RMB";
                ord.coin_rate    = 1;
                ord.deal_man     = txtpeople.Text.Trim().Split('/')[0];
                ord.oper_id      = txtoper_man.Text.Trim().Split('/')[0];
                ord.oper_date    = Helper.Conv.ToDateTime(txtoper_date.Text);
                ord.bill_flag    = "S";
                ord.cm_branch    = "00";
                ord.approve_flag = "0";
                ord.approve_man  = "";
                ord.approve_date = System.DateTime.MinValue;
                ord.other1       = txtmemo.Text.Trim();
                ord.other2       = "";
                ord.other3       = "";
                ord.num1         = 0;
                ord.num2         = 0;
                ord.num3         = 0;
                int flag = 0;
                List <Model.bank_t_cash_detail> lines = new List <Model.bank_t_cash_detail>();
                int index = 0;
                foreach (DataRow row in editGrid1.DataSource.Rows)
                {
                    index++;
                    if (row["type_no"].ToString() != "")
                    {
                        if (Helper.Conv.ToDecimal(row["bill_cash"].ToString()) <= 0)
                        {
                            throw new Exception("第i行费用金额不正确!".Replace("i", index.ToString()));
                        }
                        Model.bank_t_cash_detail line = new Model.bank_t_cash_detail();
                        lines.Add(line);
                        line.sheet_no  = ord.sheet_no;
                        line.type_no   = row["type_no"].ToString();
                        line.bill_cash = Helper.Conv.ToDecimal(row["bill_cash"].ToString());
                        line.memo      = row["memo"].ToString();

                        ord.bill_total = line.bill_cash;

                        flag = 1;
                        break;
                    }
                }
                if (flag == 0)
                {
                    throw new Exception("表体无合法数据!");
                }
                if (runType == 1)
                {
                    IBLL.IFYOrder bll = new BLL.FYOrder();
                    string        sheet_no;
                    bll.Add(ord, lines, out sheet_no);
                    IOrder ins = this;
                    ins.ShowOrder(sheet_no);
                }
                else if (runType == 2)
                {
                    IBLL.IFYOrder bll = new BLL.FYOrder();
                    bll.Change(ord, lines);
                    IOrder ins = this;
                    ins.ShowOrder(ord.sheet_no);
                }

                Dictionary <string, object> dic = this.Tag as Dictionary <string, object>;
                this.Tag = Helper.Conv.ControlsAdds(this, dic);

                IBLL.ISys sys       = new BLL.SysBLL();
                string    isApprove = sys.Read("approve_at_ones");
                if ("1".Equals(isApprove))
                {
                    if (YesNoForm.ShowFrom("保存成功!是否立即审核") == DialogResult.Yes)
                    {
                        tsbCheck_Click(new object(), new EventArgs());
                    }
                }
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }