コード例 #1
0
        DataTable IRep单品汇总表.GetData(string key, int pageSize, int pageIndex, out int total, string field, string fields)
        {
            var req = new Request();

            ReadWriteContext.IWriteContext write = new ReadWriteContext.WriteContextByJson();
            write.Append("key", key);
            write.Append("pageSize", pageSize.ToString());
            write.Append("pageIndex", pageIndex.ToString());
            write.Append("field", field);
            write.Append("fields", fields);
            var json = req.request("/pager?t=get_data_with_total", write.ToString());

            ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json);
            if (read.Read("errId") != "0")
            {
                throw new Exception(read.Read("errMsg"));
            }
            //
            total = Conv.ToInt(read.Read("total"));
            //
            var dt = new DataTable();

            dt.Columns.Add("编号");
            dt.Columns.Add("品名");
            dt.Columns.Add("单数");
            dt.Columns.Add("数量");
            dt.Columns.Add("金额");
            if (read.Read("data") != "")
            {
                foreach (ReadWriteContext.IReadContext r in read.ReadList("data"))
                {
                    dt.Rows.Add(r.Read("编号"), r.Read("品名"), r.Read("单数"), r.Read("数量"), r.Read("金额"));
                }
            }
            return(dt);
        }
コード例 #2
0
        DataTable IBLL.ICheckBLL.GetBranchStockList(string branch_no)
        {
            Helper.IRequest req = new Helper.Request();
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("branch_no", branch_no);
            var json = req.request("/check?t=get_branch_stock_list", w.ToString());

            ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(json);
            if (r.Read("errId") != "0")
            {
                throw new Exception(r.Read("errMsg"));
            }
            else
            {
                if (r.Read("data").Length < 10)
                {
                    return(new DataTable());
                }
                IBLL.ICommonBLL bll = new BLL.CommonBLL();
                var             tb  = bll.GetDataTable(r.ReadList("data"));

                return(tb);
            }
        }
コード例 #3
0
ファイル: FYOrder.cs プロジェクト: zanderphh/IvyBack_GuiZhou
        void IBLL.IFYOrder.GetOrder(string sheet_no, out System.Data.DataTable tb1, out System.Data.DataTable tb2)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("sheet_no", sheet_no);

            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/fy_order?t=get_order", w.ToString());

            ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(json);
            if (r.Read("errId") != "0")
            {
                throw new Exception(r.Read("errMsg"));
            }
            else
            {
                if (r.Read("tb1").Length < 10)
                {
                    throw new Exception("不存在单据!");
                }

                tb1 = GetDataTable(r.ReadList("tb1"));
                tb2 = GetDataTable(r.ReadList("tb2"));
            }
        }
コード例 #4
0
        void IBLL.IInOutBLL.GetSaleSheet(string sheet_no, out DataTable tb1, out DataTable tb2)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("sheet_no", sheet_no);

            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/inout?t=get_salesheet", w.ToString());

            ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(json);
            if (r.Read("errId") != "0")
            {
                throw new Exception(r.Read("errMsg"));
            }
            else
            {
                if (r.Read("tb1").Length < 10)
                {
                    throw new Exception("不存在单据!");
                }
                IBLL.ICommonBLL bll = new BLL.CommonBLL();
                tb1 = bll.GetDataTable(r.ReadList("tb1"));
                tb2 = bll.GetDataTable(r.ReadList("tb2"));
            }
        }
コード例 #5
0
        DataTable IBLL.ICusSettle.GetFYList(string supcust_no, string supcust_flag)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("supcust_no", supcust_no);
            w.Append("supcust_flag", supcust_flag);
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/cus_settle?t=GetFYList", w.ToString());

            ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(json);
            if (r.Read("errId") != "0")
            {
                throw new Exception(r.Read("errMsg"));
            }
            else
            {
                if (r.Read("data").Length < 10)
                {
                    return(new DataTable());
                }
                var tb = GetDataTable(r.ReadList("data"));

                return(tb);
            }
        }
コード例 #6
0
ファイル: SupFY.cs プロジェクト: zanderphh/IvyBack_GuiZhou
        void IBLL.ISupFY.Change(Model.rp_t_supcust_fy_master ord, List <Model.rp_t_supcust_fy_detail> lines)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("sheet_no", ord.sheet_no);
            w.Append("supcust_no", ord.supcust_no);
            w.Append("supcust_flag", ord.supcust_flag);
            w.Append("pay_type", ord.pay_type);
            w.Append("pay_date", ord.pay_date.ToString("yyyy-MM-dd HH:mm:ss"));
            w.Append("old_no", ord.old_no);
            w.Append("oper_id", ord.oper_id);
            w.Append("oper_date", ord.oper_date.ToString("yyyy-MM-dd HH:mm:ss"));
            w.Append("approve_flag", ord.approve_flag);
            w.Append("approve_man", ord.approve_man);
            w.Append("approve_date", "");
            w.Append("is_payed", ord.is_payed);
            w.Append("sale_man", ord.sale_man);
            w.Append("branch_no", ord.branch_no);
            w.Append("cm_branch", ord.cm_branch);
            w.Append("other1", ord.other1);
            w.Append("other2", ord.other2);
            w.Append("other3", ord.other3);
            w.Append("num1", ord.num1.ToString());
            w.Append("num2", ord.num2.ToString());
            w.Append("num3", ord.num3.ToString());
            w.Append("visa_id", ord.visa_id);
            w.Append("total_amount", ord.total_amount.ToString());
            w.Append("paid_amount", ord.paid_amount.ToString());
            w.Append("pay_way", ord.pay_way);
            w.Append("pay_name", ord.pay_name);
            var tb = new DataTable();

            tb.Columns.Add("sheet_no");
            tb.Columns.Add("kk_no");
            tb.Columns.Add("kk_cash", typeof(decimal));
            tb.Columns.Add("other1");
            tb.Columns.Add("other2");
            tb.Columns.Add("other3");
            tb.Columns.Add("num1", typeof(decimal));
            tb.Columns.Add("num2", typeof(decimal));
            tb.Columns.Add("num3", typeof(decimal));

            foreach (Model.rp_t_supcust_fy_detail line in lines)
            {
                tb.Rows.Add(
                    line.sheet_no,
                    line.kk_no,
                    line.kk_cash,
                    line.other1,
                    line.other2,
                    line.other3,
                    line.num1,
                    line.num2,
                    line.num3

                    );
            }
            w.Append("lines", tb);
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/sup_fy?t=change", w.ToString());

            ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(json);
            if (r.Read("errId") != "0")
            {
                throw new Exception(r.Read("errMsg"));
            }
        }
コード例 #7
0
ファイル: Order.cs プロジェクト: zanderphh/IvyBack_GuiZhou
        bool IOrder.GetFirstNewOrder(out body.wm_order ord, out List <body.wm_order_item> lines, out int un_read_num)
        {
            var req  = new Request();
            var json = req.request("/order?t=get_first_new_order", "");

            ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json);

            if (read.Read("errId") == "-8")
            {
                ord         = null;
                lines       = null;
                un_read_num = 0;
                return(false);
            }
            else if (read.Read("errId") != "0")
            {
                throw new Exception(read.Read("errMsg"));
            }

            //
            ord               = new body.wm_order();
            un_read_num       = Conv.ToInt(read.Read("un_read_num"));
            ord.ord_id        = read.Read("ord_id");
            ord.create_time   = read.Read("create_time");
            ord.mobile        = read.Read("mobile");
            ord.mobile_is_new = read.Read("mobile_is_new");
            ord.sname         = read.Read("sname");
            ord.sex           = read.Read("sex");
            ord.address       = read.Read("address");
            ord.qty           = read.Read("qty");
            ord.amount        = read.Read("amount");
            ord.enable_qty    = read.Read("enable_qty");
            ord.enable_amount = read.Read("enable_amount");
            ord.status        = read.Read("status");
            ord.build_status  = read.Read("build_status");
            ord.send_status   = read.Read("send_status");
            ord.pay_type      = read.Read("pay_type");
            ord.reach_time    = read.Read("reach_time");
            ord.cus_remark    = read.Read("cus_remark");
            ord.cus_no        = read.Read("cus_no");
            ord.salesman_id   = read.Read("salesman_id");
            ord.is_pay        = read.Read("is_pay");
            ord.take_fee      = Conv.ToDecimal(read.Read("take_fee"));
            ord.discount_amt  = Conv.ToDecimal(read.Read("discount_amt"));
            //
            lines = new List <body.wm_order_item>();
            if (read.Read("lines") != "")
            {
                foreach (ReadWriteContext.IReadContext r in read.ReadList("lines"))
                {
                    var line = new body.wm_order_item();
                    lines.Add(line);
                    line.ord_id     = r.Read("ord_id");
                    line.row_index  = r.Read("row_index");
                    line.goods_id   = r.Read("goods_id");
                    line.goods_no   = r.Read("goods_no");
                    line.goods_name = r.Read("goods_name");
                    line.price      = r.Read("price");
                    line.qty        = r.Read("qty");
                    line.amount     = r.Read("amount");
                    line.enable     = r.Read("enable");
                }
            }
            //
            return(true);
        }
コード例 #8
0
ファイル: settle.cs プロジェクト: zanderphh/IvyBack_GuiZhou
        public void upload_cgrk(WebHelper w, Dictionary <string, object> kv)
        {
            if (ExistsKeys(kv, "branch_no", "inout_master", "inout_detail", "pay_data") == false)
            {
                throw new Exception("参数错误");
            }
            var branch_no = w.Read("branch_no");
            var json      = w.Read("inout_master");

            ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json);
            var lst1 = new List <Model.ic_t_inout_store_master>();

            if (read.Read("datas") != null)
            {
                foreach (ReadWriteContext.IReadContext r in read.ReadList("datas"))
                {
                    var ord = new Model.ic_t_inout_store_master();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.trans_no     = r.Read("trans_no");//A采购入库; D销售退货入库
                    ord.db_no        = "+";
                    ord.branch_no    = r.Read("branch_no");
                    ord.d_branch_no  = "";
                    ord.voucher_no   = "";
                    ord.supcust_no   = r.Read("supcust_no");
                    ord.total_amount = Conv.ToDecimal(r.Read("total_amount"));
                    ord.inout_amount = Conv.ToDecimal(r.Read("total_amount"));
                    ord.coin_no      = "RMB";
                    ord.pay_way      = r.Read("pay_way");
                    ord.tax_amount   = 0m;
                    ord.discount     = 0m;
                    ord.pay_date     = DateTime.MinValue;
                    ord.approve_flag = "0";
                    ord.oper_date    = Conv.ToDateTime(r.Read("oper_date"));
                    ord.oper_id      = r.Read("oper_id");
                    ord.display_flag = "1";
                    ord.other1       = "";
                    ord.other2       = "";
                    ord.other3       = "";
                    ord.cm_branch    = ""; //不确定
                    ord.deal_man     = "";
                    ord.old_no       = "";
                    ord.approve_man  = "";
                    ord.approve_date = DateTime.MinValue;
                    ord.num1         = 0m;
                    ord.num2         = 0m;
                    ord.num3         = 0m;
                    ord.max_change   = 0m; //不确定
                    ord.sale_no      = "A";
                    ord.lock_man     = "";
                    ord.lock_date    = DateTime.MinValue;

                    lst1.Add(ord);
                }
            }

            json = w.Read("inout_detail");
            read = new ReadWriteContext.ReadContextByJson(json);
            var lst2 = new List <Model.ic_t_inout_store_detail>();

            if (read.Read("datas") != null)
            {
                foreach (ReadWriteContext.IReadContext r in read.ReadList("datas"))
                {
                    var item = new Model.ic_t_inout_store_detail();
                    item.sheet_no    = r.Read("sheet_no");
                    item.item_no     = r.Read("item_no");
                    item.item_name   = r.Read("item_name");
                    item.unit_no     = r.Read("unit_no");
                    item.unit_factor = 1m;
                    item.in_qty      = Conv.ToDecimal(r.Read("in_qty"));
                    item.orgi_price  = Conv.ToDecimal(r.Read("orgi_price"));
                    item.valid_price = Conv.ToDecimal(r.Read("valid_price"));
                    item.cost_price  = Conv.ToDecimal(r.Read("cost_price"));
                    item.sub_amount  = 0m;
                    item.tax         = 0m;
                    item.is_tax      = "0";
                    item.valid_date  = Conv.ToDateTime(r.Read("valid_date"));
                    item.other1      = "";
                    item.other2      = "";
                    item.other3      = "";
                    item.num1        = 0m;
                    item.num2        = 0m;
                    item.num3        = 0m;
                    item.num4        = 0m;
                    item.num5        = 0m;
                    item.num6        = 0m;
                    item.barcode     = r.Read("barcode");
                    item.sheet_sort  = Conv.ToInt(r.Read("sheet_sort"));
                    item.ret_qnty    = 0m;
                    item.discount    = 1m;
                    item.voucher_no  = "";
                    item.cost_notax  = 0m; //不确定
                    item.packqty     = 0;
                    item.sgqty       = 0m;
                    item.branch_no_d = "";
                    item.ly_sup_no   = "";
                    item.ly_rate     = 0m;
                    lst2.Add(item);
                }
            }
            json = w.Read("pay_data");
            read = new ReadWriteContext.ReadContextByJson(json);
            var lst3 = new List <Model.ot_pay_flow>();

            if (read.Read("datas") != null)
            {
                foreach (ReadWriteContext.IReadContext r in read.ReadList("datas"))
                {
                    var item = new Model.ot_pay_flow();
                    item.sheet_no    = r.Read("sheet_no");
                    item.flow_id     = Conv.ToInt(r.Read("flow_id"));
                    item.cus_no      = r.Read("cus_no");
                    item.oper_id     = r.Read("oper_id");
                    item.oper_date   = Conv.ToDateTime(r.Read("oper_date"));
                    item.pay_way     = r.Read("pay_way");
                    item.sale_amount = Conv.ToDecimal(r.Read("sale_amount"));
                    item.pay_amount  = Conv.ToDecimal(r.Read("pay_amount"));
                    item.old_amount  = Conv.ToDecimal(r.Read("old_amount"));
                    item.ml          = Conv.ToDecimal(r.Read("ml"));
                    item.jh          = r.Read("jh");
                    item.remark      = r.Read("remark");
                    lst3.Add(item);
                }
            }
            if (lst1.Count > 0 || lst2.Count > 0)
            {
                bll.WriteCGRK(lst1, lst2, lst3);
            }
        }
コード例 #9
0
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var             kv  = r.ToDictionary();
                IBLL.ICashOrder bll = new BLL.CashOrder();
                if (t == "get_list")
                {
                    DateTime date1   = Helper.Conv.ToDateTime(r.Read("date1"));
                    DateTime date2   = Helper.Conv.ToDateTime(r.Read("date2"));
                    string   visa_id = r.Read("visa_id");
                    var      tb      = bll.GetList(date1, date2, visa_id);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);

                    res = w.ToString();
                }
                else if (t == "get_order")
                {
                    string sheet_no = r.Read("sheet_no");
                    System.Data.DataTable tb1;

                    bll.GetOrder(sheet_no, out tb1);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("tb1", tb1);

                    res = w.ToString();
                }
                else if (t == "max_code")
                {
                    string code = bll.MaxCode();
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("code", code);
                    res = w.ToString();
                }
                else if (t == "add")
                {
                    Model.bank_t_cash_master ord = new Model.bank_t_cash_master();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.branch_no    = r.Read("branch_no");
                    ord.voucher_no   = r.Read("voucher_no");
                    ord.visa_id      = r.Read("visa_id");
                    ord.visa_in      = r.Read("visa_in");
                    ord.pay_way      = r.Read("pay_way");
                    ord.coin_no      = "RMB";
                    ord.coin_rate    = 1;
                    ord.deal_man     = r.Read("deal_man");
                    ord.oper_id      = r.Read("oper_id");
                    ord.oper_date    = Helper.Conv.ToDateTime(r.Read("oper_date"));
                    ord.bill_flag    = r.Read("bill_flag");
                    ord.bill_total   = Helper.Conv.ToDecimal(r.Read("bill_total"));
                    ord.cm_branch    = "00";
                    ord.approve_flag = "0";
                    ord.approve_man  = "";
                    ord.approve_date = System.DateTime.MinValue;
                    ord.other1       = r.Read("other1");
                    ord.other2       = r.Read("other2");
                    ord.other3       = r.Read("other3");
                    ord.num1         = Helper.Conv.ToDecimal(r.Read("num1"));
                    ord.num2         = Helper.Conv.ToDecimal(r.Read("num2"));
                    ord.num3         = Helper.Conv.ToDecimal(r.Read("num3"));

                    string sheet_no;
                    bll.Add(ord, out sheet_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("sheet_no", sheet_no);
                    res = w.ToString();
                }
                else if (t == "change")
                {
                    Model.bank_t_cash_master ord = new Model.bank_t_cash_master();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.branch_no    = r.Read("branch_no");
                    ord.voucher_no   = r.Read("voucher_no");
                    ord.visa_id      = r.Read("visa_id");
                    ord.visa_in      = r.Read("visa_in");
                    ord.pay_way      = r.Read("pay_way");
                    ord.coin_no      = "RMB";
                    ord.coin_rate    = 1;
                    ord.deal_man     = r.Read("deal_man");
                    ord.oper_id      = r.Read("oper_id");
                    ord.oper_date    = Helper.Conv.ToDateTime(r.Read("oper_date"));
                    ord.bill_total   = Helper.Conv.ToDecimal(r.Read("bill_total"));
                    ord.cm_branch    = "00";
                    ord.approve_flag = "0";
                    ord.approve_man  = "";
                    ord.approve_date = System.DateTime.MinValue;
                    ord.other1       = r.Read("other1");
                    ord.other2       = r.Read("other2");
                    ord.other3       = r.Read("other3");
                    ord.num1         = Helper.Conv.ToDecimal(r.Read("num1"));
                    ord.num2         = Helper.Conv.ToDecimal(r.Read("num2"));
                    ord.num3         = Helper.Conv.ToDecimal(r.Read("num3"));

                    bll.Change(ord);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete")
                {
                    string sheet_no = r.Read("sheet_no");
                    bll.Delete(sheet_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "check")
                {
                    string sheet_no    = r.Read("sheet_no");
                    string approve_man = r.Read("approve_man");
                    bll.Check(sheet_no, approve_man);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else
                {
                    throw new Exception("未找到方法" + t);
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                LogHelper.writeLog("", ex.ToString());
                res = w.ToString();
            }
        }
コード例 #10
0
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                WebHelper web = new WebHelper(pars);
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var            kv  = r.ToDictionary();
                IBLL.ICheckBLL bll = new BLL.CheckBLL();
                if (t == "get_checksheet_list")
                {
                    string date1 = r.Read("date1");
                    string date2 = r.Read("date2");

                    var tb = bll.GetCheckSheetList(date1, date2);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);

                    res = w.ToString();
                }
                else if (t == "get_check_init_list")
                {
                    var tb = bll.GetCheckInitList();
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);

                    res = w.ToString();
                }
                else if (t == "get_branch_stock_list")
                {
                    string branch_no = r.Read("branch_no");
                    var    tb        = bll.GetBranchStockList(branch_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);

                    res = w.ToString();
                }
                else if (t == "get_checksheet")
                {
                    string sheet_no = r.Read("sheet_no");
                    System.Data.DataTable tb1;
                    System.Data.DataTable tb2;
                    bll.GetCheckSheet(sheet_no, out tb1, out tb2);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("tb1", tb1);
                    w.Append("tb2", tb2);
                    res = w.ToString();
                }
                else if (t == "add_checksheet")
                {
                    var ord = new Model.ic_t_check_master();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.branch_no    = r.Read("branch_no");
                    ord.oper_id      = r.Read("oper_id");
                    ord.oper_date    = Helper.Conv.ToDateTime(r.Read("oper_date"));
                    ord.meno         = r.Read("meno");
                    ord.approve_flag = "0";
                    ord.cm_branch    = r.Read("cm_branch");
                    ord.deal_man     = r.Read("deal_man");
                    ord.max_change   = 0;
                    ord.check_no     = r.Read("check_no");

                    List <Model.ic_t_check_detail> lines = new List <Model.ic_t_check_detail>();
                    foreach (ReadWriteContext.IReadContext r2 in r.ReadList("lines"))
                    {
                        var item = new Model.ic_t_check_detail();
                        item.sheet_no    = r2.Read("sheet_no");
                        item.item_no     = r2.Read("item_no");
                        item.in_price    = Helper.Conv.ToDecimal(r2.Read("in_price"));
                        item.sale_price  = Helper.Conv.ToDecimal(r2.Read("sale_price"));
                        item.stock_qty   = Helper.Conv.ToDecimal(r2.Read("stock_qty"));
                        item.real_qty    = Helper.Conv.ToDecimal(r2.Read("real_qty"));
                        item.balance_qty = Helper.Conv.ToDecimal(r2.Read("balance_qty"));
                        item.memo        = r2.Read("memo");
                        item.other1      = r2.Read("other1");
                        item.other2      = r2.Read("other2");
                        item.num1        = Helper.Conv.ToDecimal(r2.Read("num1"));
                        item.num2        = Helper.Conv.ToDecimal(r2.Read("num2"));
                        item.num3        = Helper.Conv.ToDecimal(r2.Read("num3"));
                        item.packqty     = Helper.Conv.ToInt(r2.Read("packqty"));
                        item.sgqty       = Helper.Conv.ToDecimal(r2.Read("sgqty"));

                        lines.Add(item);
                    }
                    string sheet_no = "";
                    bll.AddCheckSheet(ord, lines, out sheet_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("sheet_no", sheet_no);
                    res = w.ToString();
                }
                else if (t == "change_checksheet")
                {
                    var ord = new Model.ic_t_check_master();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.branch_no    = r.Read("branch_no");
                    ord.oper_id      = r.Read("oper_id");
                    ord.oper_date    = Helper.Conv.ToDateTime(r.Read("oper_date"));
                    ord.meno         = r.Read("meno");
                    ord.approve_flag = "0";
                    ord.cm_branch    = r.Read("cm_branch");
                    ord.deal_man     = r.Read("deal_man");
                    ord.max_change   = 0;
                    ord.update_time  = Helper.Conv.ToDateTime(r.Read("update_time"));
                    ord.check_no     = r.Read("check_no");

                    List <Model.ic_t_check_detail> lines = new List <Model.ic_t_check_detail>();
                    foreach (ReadWriteContext.IReadContext r2 in r.ReadList("lines"))
                    {
                        var item = new Model.ic_t_check_detail();
                        item.sheet_no    = r2.Read("sheet_no");
                        item.item_no     = r2.Read("item_no");
                        item.in_price    = Helper.Conv.ToDecimal(r2.Read("in_price"));
                        item.sale_price  = Helper.Conv.ToDecimal(r2.Read("sale_price"));
                        item.stock_qty   = Helper.Conv.ToDecimal(r2.Read("stock_qty"));
                        item.real_qty    = Helper.Conv.ToDecimal(r2.Read("real_qty"));
                        item.balance_qty = Helper.Conv.ToDecimal(r2.Read("balance_qty"));
                        item.memo        = r2.Read("memo");
                        item.other1      = r2.Read("other1");
                        item.other2      = r2.Read("other2");
                        item.num1        = Helper.Conv.ToDecimal(r2.Read("num1"));
                        item.num2        = Helper.Conv.ToDecimal(r2.Read("num2"));
                        item.num3        = Helper.Conv.ToDecimal(r2.Read("num3"));
                        item.packqty     = Helper.Conv.ToInt(r2.Read("packqty"));
                        item.sgqty       = Helper.Conv.ToDecimal(r2.Read("sgqty"));
                        lines.Add(item);
                    }
                    bll.ChangeCheckSheet(ord, lines);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete_checksheet")
                {
                    string sheet_no    = r.Read("sheet_no");
                    var    update_time = Helper.Conv.ToDateTime(r.Read("update_time"));
                    bll.DeleteCheckSheet(sheet_no, update_time);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else
                {
                    web.ReflectionMethod(bll, t);
                    res = web.NmJson();
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                if (ex.InnerException != null)
                {
                    w.Append("errMsg", ex.InnerException.Message);
                    LogHelper.writeLog("check()", ex.InnerException.ToString(), t, pars);
                }
                else
                {
                    w.Append("errMsg", ex.Message);
                    LogHelper.writeLog("check()", ex.ToString(), t, pars);
                }
                res = w.ToString();
            }
        }
コード例 #11
0
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var             kv  = r.ToDictionary();
                IBLL.ISupSettle bll = new BLL.SupSettle();
                if (t == "get_list")
                {
                    DateTime date1  = Helper.Conv.ToDateTime(r.Read("date1"));
                    DateTime date2  = Helper.Conv.ToDateTime(r.Read("date2"));
                    string   sup_no = r.Read("sup_no");
                    var      tb     = bll.GetList(date1, date2, sup_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);

                    res = w.ToString();
                }
                else if (t == "get_order")
                {
                    string sheet_no = r.Read("sheet_no");
                    System.Data.DataTable tb1;
                    System.Data.DataTable tb2;
                    bll.GetOrder(sheet_no, out tb1, out tb2);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("tb1", tb1);
                    w.Append("tb2", tb2);
                    res = w.ToString();
                }
                else if (t == "max_code")
                {
                    string code = bll.MaxCode();
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("code", code);
                    res = w.ToString();
                }
                else if (t == "add")
                {
                    Model.rp_t_recpay_record_info ord = new Model.rp_t_recpay_record_info();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.supcust_no   = r.Read("supcust_no");
                    ord.supcust_flag = "S";
                    ord.flag_post    = "1";
                    ord.total_amount = Helper.Conv.ToDecimal(r.Read("total_amount"));
                    ord.free_money   = Helper.Conv.ToDecimal(r.Read("free_money"));
                    ord.coin_no      = "RMB";
                    ord.coin_rate    = 1;
                    ord.pay_way      = r.Read("pay_way");
                    ord.approve_flag = "0";
                    ord.oper_id      = r.Read("oper_id");
                    ord.oper_date    = Helper.Conv.ToDateTime(r.Read("oper_date"));
                    ord.deal_man     = r.Read("deal_man");
                    ord.approve_man  = "";
                    ord.approve_date = System.DateTime.MinValue;
                    ord.other1       = r.Read("other1");
                    ord.other2       = r.Read("other2");
                    ord.other3       = r.Read("other3");
                    ord.visa_id      = r.Read("visa_id");
                    ord.num1         = Helper.Conv.ToDecimal(r.Read("num1"));
                    ord.num2         = Helper.Conv.ToDecimal(r.Read("num2"));
                    ord.num3         = Helper.Conv.ToDecimal(r.Read("num3"));
                    ord.cm_branch    = "00";
                    ord.branch_no    = r.Read("branch_no");
                    ord.from_date    = System.DateTime.MinValue;
                    ord.to_date      = System.DateTime.MinValue;
                    ord.rc_sheet_no  = r.Read("rc_sheet_no");

                    List <Model.rp_t_recpay_record_detail> lines = new List <Model.rp_t_recpay_record_detail>();
                    foreach (ReadWriteContext.IReadContext r2 in r.ReadList("lines"))
                    {
                        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     = r2.Read("voucher_no");
                        line.sheet_amount   = Helper.Conv.ToDecimal(r2.Read("sheet_amount"));
                        line.paid_amount    = Helper.Conv.ToDecimal(r2.Read("paid_amount"));
                        line.paid_free      = Helper.Conv.ToDecimal(r2.Read("paid_free"));
                        line.pay_amount     = Helper.Conv.ToDecimal(r2.Read("pay_amount"));
                        line.pay_free       = Helper.Conv.ToDecimal(r2.Read("pay_free"));
                        line.memo           = r2.Read("memo");
                        line.other1         = r2.Read("other1");
                        line.other2         = r2.Read("other2");
                        line.other3         = r2.Read("other3");
                        line.num1           = Helper.Conv.ToDecimal(r2.Read("num1"));
                        line.num2           = Helper.Conv.ToDecimal(r2.Read("num2"));
                        line.num3           = Helper.Conv.ToDecimal(r2.Read("num3"));
                        line.pay_date       = Helper.Conv.ToDateTime(r2.Read("pay_date"));
                        line.item_no        = r2.Read("item_no");
                        line.path           = r2.Read("path");
                        line.select_flag    = r2.Read("select_flag");
                        line.voucher_type   = r2.Read("voucher_type");
                        line.oper_date      = Helper.Conv.ToDateTime(r2.Read("oper_date"));
                        line.voucher_other1 = r2.Read("voucher_other1");
                        line.voucher_other2 = r2.Read("voucher_other2");
                        line.order_no       = r2.Read("order_no");
                    }
                    string sheet_no = "";
                    bll.Add(ord, lines, out sheet_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("sheet_no", sheet_no);

                    res = w.ToString();
                }
                else if (t == "change")
                {
                    Model.rp_t_recpay_record_info ord = new Model.rp_t_recpay_record_info();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.supcust_no   = r.Read("supcust_no");
                    ord.supcust_flag = "S";
                    ord.flag_post    = "1";
                    ord.total_amount = Helper.Conv.ToDecimal(r.Read("total_amount"));
                    ord.free_money   = Helper.Conv.ToDecimal(r.Read("free_money"));
                    ord.coin_no      = "RMB";
                    ord.coin_rate    = 1;
                    ord.pay_way      = r.Read("pay_way");
                    ord.approve_flag = "0";
                    ord.oper_id      = r.Read("oper_id");
                    ord.oper_date    = Helper.Conv.ToDateTime(r.Read("oper_date"));
                    ord.deal_man     = r.Read("deal_man");
                    ord.approve_man  = "";
                    ord.approve_date = System.DateTime.MinValue;
                    ord.other1       = r.Read("other1");
                    ord.other2       = r.Read("other2");
                    ord.other3       = r.Read("other3");
                    ord.visa_id      = r.Read("visa_id");
                    ord.num1         = Helper.Conv.ToDecimal(r.Read("num1"));
                    ord.num2         = Helper.Conv.ToDecimal(r.Read("num2"));
                    ord.num3         = Helper.Conv.ToDecimal(r.Read("num3"));
                    ord.cm_branch    = "00";
                    ord.branch_no    = r.Read("branch_no");
                    ord.from_date    = System.DateTime.MinValue;
                    ord.to_date      = System.DateTime.MinValue;
                    ord.rc_sheet_no  = r.Read("rc_sheet_no");

                    List <Model.rp_t_recpay_record_detail> lines = new List <Model.rp_t_recpay_record_detail>();
                    foreach (ReadWriteContext.IReadContext r2 in r.ReadList("lines"))
                    {
                        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     = r2.Read("voucher_no");
                        line.sheet_amount   = Helper.Conv.ToDecimal(r2.Read("sheet_amount"));
                        line.paid_amount    = Helper.Conv.ToDecimal(r2.Read("paid_amount"));
                        line.paid_free      = Helper.Conv.ToDecimal(r2.Read("paid_free"));
                        line.pay_amount     = Helper.Conv.ToDecimal(r2.Read("pay_amount"));
                        line.pay_free       = Helper.Conv.ToDecimal(r2.Read("pay_free"));
                        line.memo           = r2.Read("memo");
                        line.other1         = r2.Read("other1");
                        line.other2         = r2.Read("other2");
                        line.other3         = r2.Read("other3");
                        line.num1           = Helper.Conv.ToDecimal(r2.Read("num1"));
                        line.num2           = Helper.Conv.ToDecimal(r2.Read("num2"));
                        line.num3           = Helper.Conv.ToDecimal(r2.Read("num3"));
                        line.pay_date       = Helper.Conv.ToDateTime(r2.Read("pay_date"));
                        line.item_no        = r2.Read("item_no");
                        line.path           = r2.Read("path");
                        line.select_flag    = r2.Read("select_flag");
                        line.voucher_type   = r2.Read("voucher_type");
                        line.oper_date      = Helper.Conv.ToDateTime(r2.Read("oper_date"));
                        line.voucher_other1 = r2.Read("voucher_other1");
                        line.voucher_other2 = r2.Read("voucher_other2");
                        line.order_no       = r2.Read("order_no");
                    }
                    bll.Change(ord, lines);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete")
                {
                    string sheet_no = r.Read("sheet_no");
                    bll.Delete(sheet_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "check")
                {
                    string sheet_no    = r.Read("sheet_no");
                    string approve_man = r.Read("approve_man");
                    bll.Check(sheet_no, approve_man);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else
                {
                    throw new Exception("未找到方法" + t);
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                LogHelper.writeLog("", ex.ToString());
                res = w.ToString();
            }
        }
コード例 #12
0
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var kv = r.ToDictionary();
                IBLL.ICusPriceOrder bll = new BLL.CusPriceOrder();
                if (t == "get_list")
                {
                    DateTime date1 = Helper.Conv.ToDateTime(r.Read("date1"));
                    DateTime date2 = Helper.Conv.ToDateTime(r.Read("date2"));

                    var tb = bll.GetList(date1, date2);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);

                    res = w.ToString();
                }
                else if (t == "get_order")
                {
                    string sheet_no = r.Read("sheet_no");
                    System.Data.DataTable tb1;
                    System.Data.DataTable tb2;
                    bll.GetOrder(sheet_no, out tb1, out tb2);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("tb1", tb1);
                    w.Append("tb2", tb2);
                    res = w.ToString();
                }
                else if (t == "max_code")
                {
                    string code = bll.MaxCode();
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("code", code);
                    res = w.ToString();
                }
                else if (t == "add")
                {
                    Model.pm_t_flow_main ord = new Model.pm_t_flow_main();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.branch_no    = r.Read("branch_no");
                    ord.vip_type     = r.Read("vip_type");
                    ord.price_type   = "1";
                    ord.oper_date    = Helper.Conv.ToDateTime(r.Read("oper_date"));
                    ord.oper_id      = r.Read("oper_id");
                    ord.approve_flag = "0";
                    ord.memo         = r.Read("memo");
                    ord.other1       = r.Read("other1");
                    ord.other2       = r.Read("other2");
                    ord.other3       = r.Read("other3");
                    ord.cm_branch    = r.Read("cm_branch");
                    ord.start_date   = Helper.Conv.ToDateTime(r.Read("start_date"));
                    ord.end_date     = Helper.Conv.ToDateTime(r.Read("end_date"));
                    ord.start_time   = r.Read("start_time");
                    ord.end_time     = r.Read("end_time");
                    ord.buy_amt      = Helper.Conv.ToDecimal(r.Read("buy_amt"));
                    ord.add_amt      = Helper.Conv.ToDecimal(r.Read("add_amt"));
                    ord.deal_man     = r.Read("deal_man");
                    ord.approve_man  = "";
                    ord.approve_date = System.DateTime.MinValue;
                    ord.num1         = Helper.Conv.ToDecimal(r.Read("num1"));
                    ord.num2         = Helper.Conv.ToDecimal(r.Read("num2"));
                    ord.num3         = Helper.Conv.ToDecimal(r.Read("num3"));
                    List <Model.pm_t_price_flow_detial> lines = new List <Model.pm_t_price_flow_detial>();
                    foreach (ReadWriteContext.IReadContext r2 in r.ReadList("lines"))
                    {
                        Model.pm_t_price_flow_detial line = new Model.pm_t_price_flow_detial();
                        lines.Add(line);
                        line.sheet_no   = ord.sheet_no;
                        line.item_no    = r2.Read("item_no");
                        line.price_type = ord.price_type;
                        line.start_date = ord.start_date;
                        line.old_price  = Helper.Conv.ToDecimal(r2.Read("old_price"));
                        line.new_price  = Helper.Conv.ToDecimal(r2.Read("new_price"));
                        line.discount   = Helper.Conv.ToDecimal(r2.Read("discount"));
                        line.buy_qnty   = Helper.Conv.ToDecimal(r2.Read("buy_qnty"));
                        line.other1     = r2.Read("other1");
                        line.other2     = r2.Read("other2");
                        line.other3     = r2.Read("other3");
                        line.start_time = ord.start_time;
                        line.end_time   = ord.end_time;
                        line.stock_qty  = Helper.Conv.ToDecimal(r2.Read("stock_qty"));
                        line.num1       = Helper.Conv.ToDecimal(r2.Read("num1"));
                        line.num2       = Helper.Conv.ToDecimal(r2.Read("num2"));
                        line.num3       = Helper.Conv.ToDecimal(r2.Read("num3"));
                        line.old_price2 = Helper.Conv.ToDecimal(r2.Read("old_price2"));
                        line.old_price3 = Helper.Conv.ToDecimal(r2.Read("old_price3"));

                        line.new_price2 = Helper.Conv.ToDecimal(r2.Read("new_price2"));
                        line.new_price3 = Helper.Conv.ToDecimal(r2.Read("new_price3"));
                    }

                    string sheet_no = "";
                    bll.Add(ord, lines, out sheet_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("sheet_no", sheet_no);
                    res = w.ToString();
                }
                else if (t == "change")
                {
                    Model.pm_t_flow_main ord = new Model.pm_t_flow_main();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.branch_no    = r.Read("branch_no");
                    ord.vip_type     = r.Read("vip_type");
                    ord.price_type   = "1";
                    ord.oper_date    = Helper.Conv.ToDateTime(r.Read("oper_date"));
                    ord.oper_id      = r.Read("oper_id");
                    ord.approve_flag = "0";
                    ord.memo         = r.Read("memo");
                    ord.other1       = r.Read("other1");
                    ord.other2       = r.Read("other2");
                    ord.other3       = r.Read("other3");
                    ord.cm_branch    = r.Read("cm_branch");
                    ord.start_date   = Helper.Conv.ToDateTime(r.Read("start_date"));
                    ord.end_date     = Helper.Conv.ToDateTime(r.Read("end_date"));
                    ord.start_time   = r.Read("start_time");
                    ord.end_time     = r.Read("end_time");
                    ord.buy_amt      = Helper.Conv.ToDecimal(r.Read("buy_amt"));
                    ord.add_amt      = Helper.Conv.ToDecimal(r.Read("add_amt"));
                    ord.deal_man     = r.Read("deal_man");
                    ord.approve_man  = "";
                    ord.approve_date = System.DateTime.MinValue;
                    ord.num1         = Helper.Conv.ToDecimal(r.Read("num1"));
                    ord.num2         = Helper.Conv.ToDecimal(r.Read("num2"));
                    ord.num3         = Helper.Conv.ToDecimal(r.Read("num3"));
                    List <Model.pm_t_price_flow_detial> lines = new List <Model.pm_t_price_flow_detial>();
                    foreach (ReadWriteContext.IReadContext r2 in r.ReadList("lines"))
                    {
                        Model.pm_t_price_flow_detial line = new Model.pm_t_price_flow_detial();
                        lines.Add(line);
                        line.sheet_no   = ord.sheet_no;
                        line.item_no    = r2.Read("item_no");
                        line.price_type = ord.price_type;
                        line.start_date = ord.start_date;
                        line.old_price  = Helper.Conv.ToDecimal(r2.Read("old_price"));
                        line.new_price  = Helper.Conv.ToDecimal(r2.Read("new_price"));
                        line.discount   = Helper.Conv.ToDecimal(r2.Read("discount"));
                        line.buy_qnty   = Helper.Conv.ToDecimal(r2.Read("buy_qnty"));
                        line.other1     = r2.Read("other1");
                        line.other2     = r2.Read("other2");
                        line.other3     = r2.Read("other3");
                        line.start_time = ord.start_time;
                        line.end_time   = ord.end_time;
                        line.stock_qty  = Helper.Conv.ToDecimal(r2.Read("stock_qty"));
                        line.num1       = Helper.Conv.ToDecimal(r2.Read("num1"));
                        line.num2       = Helper.Conv.ToDecimal(r2.Read("num2"));
                        line.num3       = Helper.Conv.ToDecimal(r2.Read("num3"));
                        line.old_price2 = Helper.Conv.ToDecimal(r2.Read("old_price2"));
                        line.old_price3 = Helper.Conv.ToDecimal(r2.Read("old_price3"));

                        line.new_price2 = Helper.Conv.ToDecimal(r2.Read("new_price2"));
                        line.new_price3 = Helper.Conv.ToDecimal(r2.Read("new_price3"));
                    }
                    bll.Change(ord, lines);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete")
                {
                    string sheet_no = r.Read("sheet_no");
                    bll.Delete(sheet_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "check")
                {
                    string sheet_no    = r.Read("sheet_no");
                    string approve_man = r.Read("approve_man");
                    bll.Check(sheet_no, approve_man);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else
                {
                    throw new Exception("未找到方法" + t);
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                LogHelper.writeLog("", ex.ToString());
                res = w.ToString();
            }
        }
コード例 #13
0
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var           kv  = r.ToDictionary();
                IBLL.IItemCls bll = new BLL.ItemCls();
                if (t == "get_list")
                {
                    var tb = bll.GetList();
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    res = w.ToString();
                }
                else if (t == "get_item")
                {
                    string item_clsno = r.Read("item_clsno");
                    var    tb         = bll.GetItem(item_clsno);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    res = w.ToString();
                }
                else if (t == "max_code")
                {
                    string par_code = r.Read("par_code");
                    string code     = bll.MaxCode(par_code);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("code", code);
                    res = w.ToString();
                }
                else if (t == "add")
                {
                    Model.bi_t_item_cls item = new Model.bi_t_item_cls();
                    item.item_clsno   = r.Read("item_clsno");
                    item.item_flag    = r.Read("item_flag");
                    item.item_clsname = r.Read("item_clsname");
                    item.display_flag = r.Read("display_flag");
                    bll.Add(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "change")
                {
                    Model.bi_t_item_cls item = new Model.bi_t_item_cls();
                    item.item_clsno   = r.Read("item_clsno");
                    item.item_flag    = r.Read("item_flag");
                    item.item_clsname = r.Read("item_clsname");
                    item.display_flag = r.Read("display_flag");
                    bll.Change(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete")
                {
                    string item_clsno = r.Read("item_clsno");
                    bll.Delete(item_clsno);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else
                {
                    throw new Exception("未找到方法" + t);
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                res = w.ToString();
            }
        }
コード例 #14
0
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var           kv  = r.ToDictionary();
                IBLL.IPayment bll = new BLL.Payment();
                if (t == "get_list")
                {
                    var tb = bll.GetList( );
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);

                    res = w.ToString();
                }
                else if (t == "get_item")
                {
                    string pay_way = r.Read("pay_way");
                    var    tb      = bll.GetItem(pay_way);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    res = w.ToString();
                }
                else if (t == "add")
                {
                    Model.bi_t_payment_info item = new Model.bi_t_payment_info();
                    item.pay_way  = r.Read("pay_way");
                    item.pay_name = r.Read("pay_name");
                    item.pay_flag = r.Read("pay_flag");
                    item.display  = r.Read("display");
                    item.visa_id  = r.Read("visa_id");
                    bll.Add(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "change")
                {
                    Model.bi_t_payment_info item = new Model.bi_t_payment_info();
                    item.pay_way  = r.Read("pay_way");
                    item.pay_name = r.Read("pay_name");
                    item.pay_flag = r.Read("pay_flag");
                    item.display  = r.Read("display");
                    item.visa_id  = r.Read("visa_id");
                    bll.Change(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete")
                {
                    string pay_way = r.Read("pay_way");
                    bll.Delete(pay_way);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else
                {
                    throw new Exception("未找到方法" + t);
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                res = w.ToString();
            }
        }
コード例 #15
0
ファイル: oper.cs プロジェクト: zanderphh/IvyBack_GuiZhou
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var        kv  = r.ToDictionary();
                IBLL.IOper bll = new BLL.Oper();
                if (t == "login")
                {
                    string oper_id = r.Read("oper_id");
                    string pwd     = r.Read("pwd");
                    string oper_name;
                    string oper_type;
                    bll.Login(oper_id, pwd, out oper_name, out oper_type);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("oper_name", oper_name);
                    w.Append("oper_type", oper_type);

                    IBLL.IMyDestop desbll = new BLL.MyDestop();
                    var            tbs    = desbll.GetAll();
                    w.Append("data", tbs);

                    //我的权限
                    IBLL.ISys sysbll = new BLL.Sys();
                    tbs = sysbll.GetAllGrant(new global::Model.sa_t_oper_grant()
                    {
                        oper_id = oper_type
                    });
                    w.Append("data2", tbs);

                    res = w.ToString();
                }
                else if (t == "change_pwd")
                {
                    string oper_id = r.Read("oper_id");
                    string old_pwd = r.Read("old_pwd");
                    string new_pwd = r.Read("new_pwd");
                    bll.ChangePWD(oper_id, old_pwd, new_pwd);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t.Equals("add"))
                {
                    WebHelper web = new WebHelper(pars);

                    Model.sa_t_operator_i oper = web.GetObject <Model.sa_t_operator_i>();

                    bll.Add(oper);

                    web.WriteSuccess();
                    res = web.NmJson();
                }
                else if (t.Equals("GetMaxCode"))
                {
                    WebHelper web  = new WebHelper(pars);
                    string    code = bll.GetMaxCode();

                    web.Write("code", code);
                    web.WriteSuccess();
                    res = web.NmJson();
                }
                else if (t.Equals("GetOperType"))
                {
                    WebHelper web = new WebHelper(pars);
                    var       tb  = bll.GetOperType();

                    web.Write(tb);
                    web.WriteSuccess();
                    res = web.NmJson();
                }
                else if (t.Equals("GetOpers"))
                {
                    WebHelper web = new WebHelper(pars);
                    var       tb  = bll.GetOpers();

                    web.Write(tb);
                    web.WriteSuccess();
                    res = web.NmJson();
                }
                else if (t.Equals("Upload"))
                {
                    WebHelper web = new WebHelper(pars);

                    var oper = web.GetObject <Model.sa_t_operator_i>();
                    bll.Upload(oper);

                    web.WriteSuccess();
                    res = web.NmJson();
                }
                else if (t.Equals("Del"))
                {
                    WebHelper web = new WebHelper(pars);

                    var oper = web.GetObject <Model.sa_t_operator_i>();
                    bll.Del(oper.oper_id);

                    web.WriteSuccess();
                    res = web.NmJson();
                }
                else if (t == "reset_pwd")
                {
                    string oper_id = r.Read("oper_id");

                    string new_pwd = r.Read("new_pwd");
                    bll.ResetPWD(oper_id, new_pwd);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else
                {
                    WebHelper web = new WebHelper(pars);
                    web.ReflectionMethod(bll, t);
                    res = web.NmJson();
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                res = w.ToString();
            }
        }
コード例 #16
0
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var       kv  = r.ToDictionary();
                IBLL.IDep bll = new BLL.Dep();
                if (t == "get_list")
                {
                    var tb = bll.GetList();
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    res = w.ToString();
                }
                else if (t == "get_item")
                {
                    string dep_no = r.Read("dept_no");
                    var    tb     = bll.GetItem(dep_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    res = w.ToString();
                }
                else if (t == "max_code")
                {
                    string par_code = r.Read("par_code");
                    string code     = bll.MaxCode(par_code);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("code", code);
                    res = w.ToString();
                }
                else if (t == "add")
                {
                    Model.bi_t_dept_info item = new Model.bi_t_dept_info();
                    item.dept_no     = r.Read("dept_no");
                    item.dept_name   = r.Read("dept_name");
                    item.manager     = r.Read("manager");
                    item.meno        = r.Read("meno");
                    item.update_time = DateTime.Now;
                    bll.Add(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "change")
                {
                    Model.bi_t_dept_info item = new Model.bi_t_dept_info();
                    item.dept_no     = r.Read("dept_no");
                    item.dept_name   = r.Read("dept_name");
                    item.manager     = r.Read("manager");
                    item.meno        = r.Read("meno");
                    item.update_time = DateTime.Now;
                    bll.Change(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete")
                {
                    string dep_no = r.Read("dept_no");
                    bll.Delete(dep_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else
                {
                    throw new Exception("未找到方法" + t);
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                res = w.ToString();
            }
        }
コード例 #17
0
ファイル: settle.cs プロジェクト: zanderphh/IvyBack_GuiZhou
        public void upload_fhd(WebHelper w, Dictionary <string, object> kv)
        {
            if (ExistsKeys(kv, "branch_no", "sale_master", "sale_detail", "pay_data") == false)
            {
                throw new Exception("参数错误");
            }
            var branch_no = w.Read("branch_no");
            var json      = w.Read("sale_master");

            ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json);
            var lst1 = new List <Model.sm_t_salesheet>();

            if (read.Read("datas") != null)
            {
                foreach (ReadWriteContext.IReadContext r in read.ReadList("datas"))
                {
                    var ord = new Model.sm_t_salesheet();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.voucher_no   = "";
                    ord.branch_no    = r.Read("branch_no");
                    ord.cust_no      = r.Read("cust_no");
                    ord.pay_way      = r.Read("pay_way");
                    ord.discount     = Conv.ToDecimal(r.Read("discount"));
                    ord.coin_no      = r.Read("coin_no");
                    ord.real_amount  = Conv.ToDecimal(r.Read("total_amount"));
                    ord.total_amount = Conv.ToDecimal(r.Read("total_amount"));
                    ord.paid_amount  = Conv.ToDecimal(r.Read("paid_amount"));
                    ord.approve_flag = "0";
                    ord.source_flag  = "";
                    ord.oper_id      = r.Read("oper_id");
                    ord.sale_man     = r.Read("sale_man");
                    ord.oper_date    = Conv.ToDateTime(r.Read("oper_date"));
                    ord.pay_date     = Conv.ToDateTime(r.Read("pay_date"));
                    ord.other1       = "";
                    ord.other2       = "";
                    ord.other3       = "";
                    ord.cm_branch    = "";
                    ord.approve_man  = "";
                    ord.approve_date = DateTime.MinValue;
                    ord.num1         = 0m;
                    ord.num2         = 0m;
                    ord.num3         = 0m;
                    ord.payfee_memo  = "";
                    ord.old_no       = "";
                    ord.psheet_no    = "";
                    ord.pay_nowmark  = "";
                    ord.if_back      = "";
                    ord.cust_cls     = "";
                    ord.other4       = "";
                    lst1.Add(ord);
                }
            }

            json = w.Read("sale_detail");
            read = new ReadWriteContext.ReadContextByJson(json);
            var lst2 = new List <Model.sm_t_salesheet_detail>();

            if (read.Read("datas") != null)
            {
                foreach (ReadWriteContext.IReadContext r in read.ReadList("datas"))
                {
                    var item = new Model.sm_t_salesheet_detail();
                    item.sheet_no    = r.Read("sheet_no");
                    item.item_no     = r.Read("item_no");
                    item.item_name   = r.Read("item_name");
                    item.unit_no     = r.Read("unit_no");
                    item.unit_factor = 1m;
                    item.sale_qnty   = Conv.ToDecimal(r.Read("sale_qnty"));
                    item.sale_price  = Conv.ToDecimal(r.Read("sale_price"));
                    item.real_price  = Conv.ToDecimal(r.Read("real_price"));
                    item.cost_price  = Conv.ToDecimal(r.Read("cost_price"));
                    item.sale_money  = Conv.ToDecimal(r.Read("sale_money"));
                    item.sale_tax    = 0m;
                    item.is_tax      = "0";
                    item.other1      = "";
                    item.other2      = "";
                    item.other3      = "";
                    item.other4      = "";
                    item.num1        = 0m;
                    item.num2        = 0m;
                    item.num3        = 0m;
                    item.num4        = 0m;
                    item.num5        = 0m;
                    item.num6        = 0m;
                    item.barcode     = r.Read("barcode");
                    item.sheet_sort  = Conv.ToInt(r.Read("sheet_sort"));
                    item.ret_qnty    = 0m;
                    item.discount    = 0m;
                    item.voucher_no  = "";
                    item.cost_notax  = 0m;
                    item.packqty     = 0;
                    item.sgqty       = 0m;
                    item.branch_no_d = "";
                    item.ly_sup_no   = "";
                    item.ly_rate     = 0m;
                    item.num7        = 0m;
                    item.other5      = "";
                    item.num8        = 0m;
                    item.produce_day = DateTime.MinValue;
                    lst2.Add(item);
                }
            }
            json = w.Read("pay_data");
            read = new ReadWriteContext.ReadContextByJson(json);
            var lst3 = new List <Model.ot_pay_flow>();

            if (read.Read("datas") != null)
            {
                foreach (ReadWriteContext.IReadContext r in read.ReadList("datas"))
                {
                    var item = new Model.ot_pay_flow();
                    item.sheet_no    = r.Read("sheet_no");
                    item.flow_id     = Conv.ToInt(r.Read("flow_id"));
                    item.cus_no      = r.Read("cus_no");
                    item.oper_id     = r.Read("oper_id");
                    item.oper_date   = Conv.ToDateTime(r.Read("oper_date"));
                    item.pay_way     = r.Read("pay_way");
                    item.sale_amount = Conv.ToDecimal(r.Read("sale_amount"));
                    item.pay_amount  = Conv.ToDecimal(r.Read("pay_amount"));
                    item.old_amount  = Conv.ToDecimal(r.Read("old_amount"));
                    item.ml          = Conv.ToDecimal(r.Read("ml"));
                    item.jh          = r.Read("jh");
                    item.remark      = r.Read("remark");
                    lst3.Add(item);
                }
            }
            if (lst1.Count > 0 || lst2.Count > 0)
            {
                bll.WriteFHD(lst1, lst2, lst3);
            }
        }
コード例 #18
0
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                WebHelper web = new WebHelper(pars);
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var          kv  = r.ToDictionary();
                IBLL.IPeople bll = new BLL.People();
                if (t == "get_list")
                {
                    string dep_no      = r.Read("dep_no");
                    string keyword     = r.Read("keyword");
                    int    show_stop   = Helper.Conv.ToInt32(r.Read("show_stop"));
                    int    page_index  = Helper.Conv.ToInt32(r.Read("page_index"));
                    int    page_size   = Helper.Conv.ToInt32(r.Read("page_size"));
                    int    total_count = 0;

                    var tb = bll.GetList(dep_no, keyword, show_stop, page_index, page_size, out total_count);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    w.Append("total_count", total_count.ToString());
                    res = w.ToString();
                }
                else if (t == "get_item")
                {
                    string oper_id = r.Read("oper_id");
                    var    tb      = bll.GetItem(oper_id);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    res = w.ToString();
                }
                else if (t == "max_code")
                {
                    string code = bll.MaxCode();
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("code", code);
                    res = w.ToString();
                }
                else if (t == "add")
                {
                    Model.bi_t_people_info item = new Model.bi_t_people_info();
                    item.oper_id     = r.Read("oper_id");
                    item.oper_name   = r.Read("oper_name");
                    item.oper_status = r.Read("oper_status");
                    item.dept_no     = r.Read("dept_no");
                    if (r.Read("birthday") != "")
                    {
                        item.birthday = Helper.Conv.ToDateTime(r.Read("birthday"));
                    }
                    item.tel = r.Read("tel");
                    if (r.Read("in_date") != "")
                    {
                        item.in_date = Helper.Conv.ToDateTime(r.Read("in_date"));
                    }
                    bll.Add(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "change")
                {
                    Model.bi_t_people_info item = new Model.bi_t_people_info();
                    item.oper_id     = r.Read("oper_id");
                    item.oper_name   = r.Read("oper_name");
                    item.oper_status = r.Read("oper_status");
                    item.dept_no     = r.Read("dept_no");
                    if (r.Read("birthday") != "")
                    {
                        item.birthday = Helper.Conv.ToDateTime(r.Read("birthday"));
                    }
                    item.tel = r.Read("tel");
                    if (r.Read("in_date") != "")
                    {
                        item.in_date = Helper.Conv.ToDateTime(r.Read("in_date"));
                    }
                    bll.Change(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete")
                {
                    string oper_id = r.Read("oper_id");
                    bll.Delete(oper_id);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else
                {
                    web.ReflectionMethod(bll, t);
                    res = web.NmJson();
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                res = w.ToString();
            }
        }
コード例 #19
0
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                WebHelper web = new WebHelper(pars);
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var       kv  = r.ToDictionary();
                IBLL.ISup bll = new BLL.Sup();
                if (t == "get_list")
                {
                    string region_no   = r.Read("region_no");
                    string keyword     = r.Read("keyword");
                    int    show_stop   = Helper.Conv.ToInt32(r.Read("show_stop"));
                    int    page_index  = Helper.Conv.ToInt32(r.Read("page_index"));
                    int    page_size   = Helper.Conv.ToInt32(r.Read("page_size"));
                    int    total_count = 0;

                    var tb = bll.GetList(region_no, keyword, show_stop, page_index, page_size, out total_count);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    w.Append("total_count", total_count.ToString());
                    res = w.ToString();
                }
                else if (t == "get_item")
                {
                    string supcust_no = r.Read("supcust_no");
                    var    tb         = bll.GetItem(supcust_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    res = w.ToString();
                }
                else if (t == "max_code")
                {
                    string code = bll.MaxCode();
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("code", code);
                    res = w.ToString();
                }
                else if (t == "add")
                {
                    Model.bi_t_supcust_info item = new Model.bi_t_supcust_info();
                    item.supcust_no   = r.Read("supcust_no");
                    item.supcust_flag = r.Read("supcust_flag");
                    item.sup_name     = r.Read("sup_name");
                    item.region_no    = r.Read("region_no");
                    item.sup_type     = r.Read("sup_type");
                    item.sup_man      = r.Read("sup_man");
                    item.sup_addr     = r.Read("sup_addr");

                    item.sup_email = r.Read("sup_email");
                    item.sup_tel   = r.Read("sup_tel");

                    item.display_flag = r.Read("display_flag");
                    item.credit_amt   = Helper.Conv.ToDecimal(r.Read("credit_amt"));
                    item.sale_man     = r.Read("sale_man");
                    item.sup_pyname   = r.Read("sup_pyname");
                    bll.Add(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "change")
                {
                    Model.bi_t_supcust_info item = new Model.bi_t_supcust_info();
                    item.supcust_no   = r.Read("supcust_no");
                    item.supcust_flag = r.Read("supcust_flag");
                    item.sup_name     = r.Read("sup_name");
                    item.region_no    = r.Read("region_no");
                    item.sup_type     = r.Read("sup_type");
                    item.sup_man      = r.Read("sup_man");
                    item.sup_addr     = r.Read("sup_addr");

                    item.sup_email = r.Read("sup_email");
                    item.sup_tel   = r.Read("sup_tel");

                    item.display_flag = r.Read("display_flag");
                    item.credit_amt   = Helper.Conv.ToDecimal(r.Read("credit_amt"));
                    item.sale_man     = r.Read("sale_man");
                    item.sup_pyname   = r.Read("sup_pyname");
                    bll.Change(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete")
                {
                    string supcust_no = r.Read("supcust_no");
                    bll.Delete(supcust_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else
                {
                    web.ReflectionMethod(bll, t);
                    res = web.NmJson();
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                res = w.ToString();
            }
        }
コード例 #20
0
        void IBLL.IInOutBLL.ChangeInOut(Model.ic_t_inout_store_master ord, List <Model.ic_t_inout_store_detail> lines)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("sheet_no", ord.sheet_no);
            w.Append("trans_no", ord.trans_no);
            w.Append("branch_no", ord.branch_no);
            w.Append("voucher_no", ord.voucher_no);
            w.Append("supcust_no", ord.supcust_no);
            w.Append("pay_way", ord.pay_way);
            w.Append("db_no", ord.db_no);
            w.Append("discount", ord.discount.ToString());
            w.Append("coin_no", ord.coin_no);
            w.Append("total_amount", ord.total_amount.ToString());
            w.Append("inout_amount", ord.inout_amount.ToString());
            w.Append("tax_amount", ord.tax_amount.ToString());
            w.Append("oper_id", ord.oper_id);
            w.Append("deal_man", ord.deal_man);
            w.Append("cm_branch", ord.cm_branch);
            w.Append("oper_date", ord.oper_date.ToString("yyyy-MM-dd HH:mm:ss"));
            w.Append("other1", ord.other1);
            w.Append("other2", ord.other2);
            w.Append("other3", ord.other3);
            w.Append("old_no", ord.old_no);
            w.Append("num1", ord.num1.ToString());
            w.Append("num2", ord.num2.ToString());
            w.Append("num3", ord.num3.ToString());
            w.Append("sale_no", ord.sale_no);
            w.Append("update_time", ord.update_time.ToString("yyyy-MM-dd HH:mm:ss"));

            var tb = new DataTable();

            tb.Columns.Add("sheet_no");
            tb.Columns.Add("item_no");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("unit_factor", typeof(decimal));
            tb.Columns.Add("in_qty", typeof(decimal));
            tb.Columns.Add("orgi_price", typeof(decimal));
            tb.Columns.Add("valid_price", typeof(decimal));
            tb.Columns.Add("cost_price", typeof(decimal));
            tb.Columns.Add("sub_amount", typeof(decimal));
            tb.Columns.Add("tax", typeof(decimal));
            tb.Columns.Add("is_tax");
            tb.Columns.Add("valid_date", typeof(DateTime));
            tb.Columns.Add("other1");
            tb.Columns.Add("other2");
            tb.Columns.Add("other3");
            tb.Columns.Add("num1", typeof(decimal));
            tb.Columns.Add("num2", typeof(decimal));
            tb.Columns.Add("num3", typeof(decimal));
            tb.Columns.Add("num4", typeof(decimal));
            tb.Columns.Add("num5", typeof(decimal));
            tb.Columns.Add("num6", typeof(decimal));
            tb.Columns.Add("barcode");
            tb.Columns.Add("voucher_no");
            tb.Columns.Add("sheet_sort", typeof(int));
            tb.Columns.Add("ret_qnty", typeof(decimal));
            tb.Columns.Add("discount", typeof(decimal));
            tb.Columns.Add("packqty", typeof(int));
            tb.Columns.Add("sgqty", typeof(decimal));

            foreach (Model.ic_t_inout_store_detail line in lines)
            {
                tb.Rows.Add(line.sheet_no, line.item_no, line.item_name, line.unit_no, line.unit_factor, line.in_qty, line.orgi_price,
                            line.valid_price, line.cost_price, line.sub_amount, line.tax, line.is_tax, line.valid_date, line.other1, line.other2,
                            line.other3, line.num1, line.num2, line.num3, line.num4, line.num5, line.num6,
                            line.barcode, line.voucher_no, line.sheet_sort, line.ret_qnty, line.discount, line.packqty, line.sgqty);
            }
            w.Append("lines", tb);
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/inout?t=change_inout", w.ToString());

            ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(json);
            if (r.Read("errId") != "0")
            {
                throw new Exception(r.Read("errMsg"));
            }
        }
コード例 #21
0
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                ReadWriteContext.IReadContext rm = new ReadWriteContext.ReadContextByJson(pars);
                var          kv  = rm.ToDictionary();
                IBLL.ISettle bll = new BLL.Settle();
                if (t == "upload_fhd")
                {
                    if (CommonHelper.ExistsKeys(kv, "branch_no", "sale_master", "sale_detail", "pay_data") == false)
                    {
                        throw new Exception("参数错误");
                    }
                    var branch_no = rm.Read("branch_no");
                    var json      = rm.Read("sale_master");
                    ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json);
                    var lst1 = new List <Model.sm_t_salesheet>();
                    if (read.Read("datas") != null)
                    {
                        foreach (ReadWriteContext.IReadContext r in read.ReadList("datas"))
                        {
                            var ord = new Model.sm_t_salesheet();
                            ord.sheet_no     = r.Read("sheet_no");
                            ord.voucher_no   = "";
                            ord.branch_no    = r.Read("branch_no");
                            ord.cust_no      = r.Read("cust_no");
                            ord.pay_way      = r.Read("pay_way");
                            ord.discount     = Conv.ToDecimal(r.Read("discount"));
                            ord.coin_no      = r.Read("coin_no");
                            ord.real_amount  = Conv.ToDecimal(r.Read("total_amount"));
                            ord.total_amount = Conv.ToDecimal(r.Read("total_amount"));
                            ord.paid_amount  = Conv.ToDecimal(r.Read("paid_amount"));
                            ord.approve_flag = "0";
                            ord.source_flag  = "";
                            ord.oper_id      = r.Read("oper_id");
                            ord.sale_man     = r.Read("sale_man");
                            ord.oper_date    = Conv.ToDateTime(r.Read("oper_date"));
                            ord.pay_date     = Conv.ToDateTime(r.Read("pay_date"));
                            ord.other1       = "";
                            ord.other2       = "";
                            ord.other3       = "";
                            ord.cm_branch    = "";
                            ord.approve_man  = "";
                            ord.approve_date = DateTime.MinValue;
                            ord.num1         = 0m;
                            ord.num2         = 0m;
                            ord.num3         = 0m;
                            ord.payfee_memo  = "";
                            ord.old_no       = "";
                            ord.psheet_no    = "";
                            ord.pay_nowmark  = "";
                            ord.if_back      = "";
                            ord.cust_cls     = "";
                            ord.other4       = "";
                            lst1.Add(ord);
                        }
                    }

                    json = rm.Read("sale_detail");
                    read = new ReadWriteContext.ReadContextByJson(json);
                    var lst2 = new List <Model.sm_t_salesheet_detail>();
                    if (read.Read("datas") != null)
                    {
                        foreach (ReadWriteContext.IReadContext r in read.ReadList("datas"))
                        {
                            var item = new Model.sm_t_salesheet_detail();
                            item.sheet_no    = r.Read("sheet_no");
                            item.item_no     = r.Read("item_no");
                            item.item_name   = r.Read("item_name");
                            item.unit_no     = r.Read("unit_no");
                            item.unit_factor = 1m;
                            item.sale_qnty   = Conv.ToDecimal(r.Read("sale_qnty"));
                            item.sale_price  = Conv.ToDecimal(r.Read("sale_price"));
                            item.real_price  = Conv.ToDecimal(r.Read("real_price"));
                            item.cost_price  = Conv.ToDecimal(r.Read("cost_price"));
                            item.sale_money  = Conv.ToDecimal(r.Read("sale_money"));
                            item.sale_tax    = 0m;
                            item.is_tax      = "0";
                            item.other1      = "";
                            item.other2      = "";
                            item.other3      = "";
                            item.other4      = "";
                            item.num1        = 0m;
                            item.num2        = 0m;
                            item.num3        = 0m;
                            item.num4        = 0m;
                            item.num5        = 0m;
                            item.num6        = 0m;
                            item.barcode     = r.Read("barcode");
                            item.sheet_sort  = Conv.ToInt(r.Read("sheet_sort"));
                            item.ret_qnty    = 0m;
                            item.discount    = 0m;
                            item.voucher_no  = "";
                            item.cost_notax  = 0m;
                            item.packqty     = 0;
                            item.sgqty       = 0m;
                            item.branch_no_d = "";
                            item.ly_sup_no   = "";
                            item.ly_rate     = 0m;
                            item.num7        = 0m;
                            item.other5      = "";
                            item.num8        = 0m;
                            item.produce_day = DateTime.MinValue;
                            lst2.Add(item);
                        }
                    }
                    json = rm.Read("pay_data");
                    read = new ReadWriteContext.ReadContextByJson(json);
                    var lst3 = new List <Model.ot_pay_flow>();
                    if (read.Read("datas") != null)
                    {
                        foreach (ReadWriteContext.IReadContext r in read.ReadList("datas"))
                        {
                            var item = new Model.ot_pay_flow();
                            item.sheet_no    = r.Read("sheet_no");
                            item.flow_id     = Conv.ToInt(r.Read("flow_id"));
                            item.cus_no      = r.Read("cus_no");
                            item.oper_id     = r.Read("oper_id");
                            item.oper_date   = Conv.ToDateTime(r.Read("oper_date"));
                            item.pay_way     = r.Read("pay_way");
                            item.sale_amount = Conv.ToDecimal(r.Read("sale_amount"));
                            item.pay_amount  = Conv.ToDecimal(r.Read("pay_amount"));
                            item.old_amount  = Conv.ToDecimal(r.Read("old_amount"));
                            item.ml          = Conv.ToDecimal(r.Read("ml"));
                            item.jh          = r.Read("jh");
                            item.remark      = r.Read("remark");
                            lst3.Add(item);
                        }
                    }
                    if (lst1.Count > 0 || lst2.Count > 0)
                    {
                        bll.WriteFHD(lst1, lst2, lst3);
                    }
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    res = w.ToString();
                }
                else if (t == "upload_cgrk")
                {
                    if (CommonHelper.ExistsKeys(kv, "branch_no", "inout_master", "inout_detail", "pay_data") == false)
                    {
                        throw new Exception("参数错误");
                    }
                    var branch_no = rm.Read("branch_no");
                    var json      = rm.Read("inout_master");
                    ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json);
                    var lst1 = new List <Model.ic_t_inout_store_master>();
                    if (read.Read("datas") != null)
                    {
                        foreach (ReadWriteContext.IReadContext r in read.ReadList("datas"))
                        {
                            var ord = new Model.ic_t_inout_store_master();
                            ord.sheet_no     = r.Read("sheet_no");
                            ord.trans_no     = r.Read("trans_no");//A采购入库; D销售退货入库
                            ord.db_no        = "+";
                            ord.branch_no    = r.Read("branch_no");
                            ord.d_branch_no  = "";
                            ord.voucher_no   = "";
                            ord.supcust_no   = r.Read("supcust_no");
                            ord.total_amount = Conv.ToDecimal(r.Read("total_amount"));
                            ord.inout_amount = Conv.ToDecimal(r.Read("total_amount"));
                            ord.coin_no      = "RMB";
                            ord.pay_way      = r.Read("pay_way");
                            ord.tax_amount   = 0m;
                            ord.discount     = 0m;
                            ord.pay_date     = DateTime.MinValue;
                            ord.approve_flag = "0";
                            ord.oper_date    = Conv.ToDateTime(r.Read("oper_date"));
                            ord.oper_id      = r.Read("oper_id");
                            ord.display_flag = "1";
                            ord.other1       = "";
                            ord.other2       = "";
                            ord.other3       = "";
                            ord.cm_branch    = ""; //不确定
                            ord.deal_man     = "";
                            ord.old_no       = "";
                            ord.approve_man  = "";
                            ord.approve_date = DateTime.MinValue;
                            ord.num1         = 0m;
                            ord.num2         = 0m;
                            ord.num3         = 0m;
                            ord.max_change   = 0m; //不确定
                            ord.sale_no      = "A";
                            ord.lock_man     = "";
                            ord.lock_date    = DateTime.MinValue;

                            lst1.Add(ord);
                        }
                    }

                    json = rm.Read("inout_detail");
                    read = new ReadWriteContext.ReadContextByJson(json);
                    var lst2 = new List <Model.ic_t_inout_store_detail>();
                    if (read.Read("datas") != null)
                    {
                        foreach (ReadWriteContext.IReadContext r in read.ReadList("datas"))
                        {
                            var item = new Model.ic_t_inout_store_detail();
                            item.sheet_no    = r.Read("sheet_no");
                            item.item_no     = r.Read("item_no");
                            item.item_name   = r.Read("item_name");
                            item.unit_no     = r.Read("unit_no");
                            item.unit_factor = 1m;
                            item.in_qty      = Conv.ToDecimal(r.Read("in_qty"));
                            item.orgi_price  = Conv.ToDecimal(r.Read("orgi_price"));
                            item.valid_price = Conv.ToDecimal(r.Read("valid_price"));
                            item.cost_price  = Conv.ToDecimal(r.Read("cost_price"));
                            item.sub_amount  = 0m;
                            item.tax         = 0m;
                            item.is_tax      = "0";
                            item.valid_date  = Conv.ToDateTime(r.Read("valid_date"));
                            item.other1      = "";
                            item.other2      = "";
                            item.other3      = "";
                            item.num1        = 0m;
                            item.num2        = 0m;
                            item.num3        = 0m;
                            item.num4        = 0m;
                            item.num5        = 0m;
                            item.num6        = 0m;
                            item.barcode     = r.Read("barcode");
                            item.sheet_sort  = Conv.ToInt(r.Read("sheet_sort"));
                            item.ret_qnty    = 0m;
                            item.discount    = 1m;
                            item.voucher_no  = "";
                            item.cost_notax  = 0m; //不确定
                            item.packqty     = 0;
                            item.sgqty       = 0m;
                            item.branch_no_d = "";
                            item.ly_sup_no   = "";
                            item.ly_rate     = 0m;
                            lst2.Add(item);
                        }
                    }
                    json = rm.Read("pay_data");
                    read = new ReadWriteContext.ReadContextByJson(json);
                    var lst3 = new List <Model.ot_pay_flow>();
                    if (read.Read("datas") != null)
                    {
                        foreach (ReadWriteContext.IReadContext r in read.ReadList("datas"))
                        {
                            var item = new Model.ot_pay_flow();
                            item.sheet_no    = r.Read("sheet_no");
                            item.flow_id     = Conv.ToInt(r.Read("flow_id"));
                            item.cus_no      = r.Read("cus_no");
                            item.oper_id     = r.Read("oper_id");
                            item.oper_date   = Conv.ToDateTime(r.Read("oper_date"));
                            item.pay_way     = r.Read("pay_way");
                            item.sale_amount = Conv.ToDecimal(r.Read("sale_amount"));
                            item.pay_amount  = Conv.ToDecimal(r.Read("pay_amount"));
                            item.old_amount  = Conv.ToDecimal(r.Read("old_amount"));
                            item.ml          = Conv.ToDecimal(r.Read("ml"));
                            item.jh          = r.Read("jh");
                            item.remark      = r.Read("remark");
                            lst3.Add(item);
                        }
                    }
                    if (lst1.Count > 0 || lst2.Count > 0)
                    {
                        bll.WriteCGRK(lst1, lst2, lst3);
                    }
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    res = w.ToString();
                }
                else
                {
                    throw new Exception("未找到方法:" + t);
                }
            }
            catch (Exception ex)
            {
                LogHelper.writeLog("settle()", ex.ToString(), t, pars);
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                res = w.ToString();
            }
        }
コード例 #22
0
        void IBLL.IInOutBLL.AddSaleSheet(Model.sm_t_salesheet ord, List <Model.sm_t_salesheet_detail> lines, out string sheet_no)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("sheet_no", ord.sheet_no);
            w.Append("branch_no", ord.branch_no);
            w.Append("voucher_no", ord.voucher_no);
            w.Append("cust_no", ord.cust_no);
            w.Append("pay_way", ord.pay_way);
            w.Append("discount", ord.discount.ToString());
            w.Append("coin_no", ord.coin_no);
            w.Append("real_amount", ord.real_amount.ToString());
            w.Append("total_amount", ord.total_amount.ToString());
            w.Append("paid_amount", ord.paid_amount.ToString());
            w.Append("oper_id", ord.oper_id);
            w.Append("sale_man", ord.sale_man);
            w.Append("cm_branch", ord.cm_branch);
            w.Append("oper_date", ord.oper_date.ToString("yyyy-MM-dd HH:mm:ss"));
            w.Append("other1", ord.other1);
            w.Append("other2", ord.other2);
            w.Append("other3", ord.other3);
            w.Append("other4", ord.other4);
            w.Append("old_no", ord.old_no);
            w.Append("psheet_no", ord.psheet_no);
            w.Append("pay_nowmark", ord.pay_nowmark);
            w.Append("payfee_memo", ord.payfee_memo);
            w.Append("num1", ord.num1.ToString());
            w.Append("num2", ord.num2.ToString());
            w.Append("num3", ord.num3.ToString());
            w.Append("if_back", ord.if_back);
            w.Append("pay_date", ord.pay_date.ToString("yyyy-MM-dd HH:mm:ss"));
            w.Append("update_time", ord.update_time.ToString("yyyy-MM-dd HH:mm:ss"));

            var tb = new DataTable();

            tb.Columns.Add("sheet_no");
            tb.Columns.Add("item_no");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("unit_factor", typeof(decimal));
            tb.Columns.Add("sale_qnty", typeof(decimal));
            tb.Columns.Add("sale_price", typeof(decimal));
            tb.Columns.Add("real_price", typeof(decimal));
            tb.Columns.Add("cost_price", typeof(decimal));
            tb.Columns.Add("sale_money", typeof(decimal));
            tb.Columns.Add("sale_tax", typeof(decimal));
            tb.Columns.Add("is_tax");
            tb.Columns.Add("other1");
            tb.Columns.Add("other2");
            tb.Columns.Add("other3");
            tb.Columns.Add("other4");
            tb.Columns.Add("other5");
            tb.Columns.Add("num1", typeof(decimal));
            tb.Columns.Add("num2", typeof(decimal));
            tb.Columns.Add("num3", typeof(decimal));
            tb.Columns.Add("num4", typeof(decimal));
            tb.Columns.Add("num5", typeof(decimal));
            tb.Columns.Add("num6", typeof(decimal));
            tb.Columns.Add("num7", typeof(decimal));
            tb.Columns.Add("num8", typeof(decimal));
            tb.Columns.Add("barcode");
            tb.Columns.Add("voucher_no");
            tb.Columns.Add("sheet_sort", typeof(int));
            tb.Columns.Add("ret_qnty", typeof(decimal));
            tb.Columns.Add("discount", typeof(decimal));
            tb.Columns.Add("cost_notax", typeof(decimal));
            tb.Columns.Add("packqty", typeof(int));
            tb.Columns.Add("sgqty", typeof(decimal));

            foreach (Model.sm_t_salesheet_detail line in lines)
            {
                tb.Rows.Add(line.sheet_no, line.item_no, line.item_name, line.unit_no, line.unit_factor, line.sale_qnty, line.sale_price,
                            line.real_price, line.cost_price, line.sale_money, line.sale_tax, line.is_tax, line.other1, line.other2, line.other3,
                            line.other4, line.other5, line.num1, line.num2, line.num3, line.num4, line.num5, line.num6, line.num7, line.num8,
                            line.barcode, line.voucher_no, line.sheet_sort, line.ret_qnty, line.discount, line.cost_notax, line.packqty, line.sgqty);
            }
            w.Append("lines", tb);

            Helper.IRequest req = new Helper.Request();


            var json = req.request("/inout?t=add_salesheet", w.ToString());

            ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(json);
            if (r.Read("errId") != "0")
            {
                throw new Exception(r.Read("errMsg"));
            }
            sheet_no = r.Read("sheet_no");
        }
コード例 #23
0
ファイル: branch.cs プロジェクト: zanderphh/IvyBack_GuiZhou
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var          kv  = r.ToDictionary();
                IBLL.IBranch bll = new BLL.Branch();
                if (t == "get_list")
                {
                    int code_len = Helper.Conv.ToInt32(r.Read("code_len"));
                    var tb       = bll.GetList(code_len);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    res = w.ToString();
                }
                else if (t == "get_list_by_par_code")
                {
                    string par_code = r.Read("par_code");
                    var    tb       = bll.GetListByParCode(par_code);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    res = w.ToString();
                }
                else if (t == "get_item")
                {
                    string branch_no = r.Read("branch_no");
                    var    tb        = bll.GetItem(branch_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    res = w.ToString();
                }
                else if (t == "max_code")
                {
                    string par_code = r.Read("par_code");
                    string code     = bll.MaxCode(par_code);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("code", code);
                    res = w.ToString();
                }
                else if (t == "add")
                {
                    Model.bi_t_branch_info item = new Model.bi_t_branch_info();
                    item.branch_no    = r.Read("branch_no");
                    item.branch_name  = r.Read("branch_name");
                    item.branch_man   = r.Read("branch_man");
                    item.address      = r.Read("address");
                    item.display_flag = r.Read("display_flag");
                    bll.Add(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "change")
                {
                    Model.bi_t_branch_info item = new Model.bi_t_branch_info();
                    item.branch_no    = r.Read("branch_no");
                    item.branch_name  = r.Read("branch_name");
                    item.branch_man   = r.Read("branch_man");
                    item.address      = r.Read("address");
                    item.display_flag = r.Read("display_flag");
                    bll.Change(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete")
                {
                    string branch_no = r.Read("branch_no");
                    bll.Delete(branch_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else
                {
                    WebHelper w = new WebHelper(pars);
                    w.ReflectionMethod(bll, t);
                    res = w.NmJson();
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                res = w.ToString();
            }
        }
コード例 #24
0
        DataTable IFinanceBLL.GetSZTypeList()
        {
            try
            {
                Helper.IRequest req = new Helper.Request();

                var json = req.request("/finance?t=get_sz_list", "{\"is_show_stop\":\"1\"}");
                ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json);
                if (read.Read("errId") != "0")
                {
                    throw new Exception(read.Read("errMsg"));
                }
                System.Data.DataTable dt = new System.Data.DataTable();
                dt.Columns.Add("pay_way", typeof(string));
                dt.Columns.Add("pay_name", typeof(string));
                dt.Columns.Add("pay_flag", typeof(string));
                dt.Columns.Add("km_code", typeof(string));
                dt.Columns.Add("pay_kind", typeof(string));
                dt.Columns.Add("other1", typeof(string));
                dt.Columns.Add("other2", typeof(string));
                dt.Columns.Add("num1", typeof(decimal));
                dt.Columns.Add("num2", typeof(int));
                dt.Columns.Add("pay_memo", typeof(string));
                dt.Columns.Add("if_acc", typeof(string));
                dt.Columns.Add("path", typeof(string));
                dt.Columns.Add("is_account", typeof(string));
                dt.Columns.Add("account_flag", typeof(string));
                dt.Columns.Add("is_pay", typeof(string));
                dt.Columns.Add("is_profit", typeof(string));
                dt.Columns.Add("profit_type", typeof(string));
                dt.Columns.Add("auto_cashsheet", typeof(string));
                dt.Columns.Add("if_CtFix", typeof(string));
                if (read.Read("data") != null)
                {
                    foreach (ReadWriteContext.IReadContext r in read.ReadList("data"))
                    {
                        Model.bi_t_sz_type item = new Model.bi_t_sz_type();
                        item.pay_way        = r.Read("pay_way");
                        item.pay_name       = r.Read("pay_name");
                        item.pay_flag       = r.Read("pay_flag");
                        item.km_code        = r.Read("km_code");
                        item.pay_kind       = r.Read("pay_kind");
                        item.other1         = r.Read("other1");
                        item.other2         = r.Read("other2");
                        item.num1           = Helper.Conv.ToDecimal(r.Read("num1"));
                        item.num2           = Helper.Conv.ToInt(r.Read("num2"));
                        item.pay_memo       = r.Read("pay_memo");
                        item.if_acc         = r.Read("if_acc");
                        item.path           = r.Read("path");
                        item.is_account     = r.Read("is_account");
                        item.account_flag   = r.Read("account_flag");
                        item.is_pay         = r.Read("is_pay");
                        item.is_profit      = r.Read("is_profit");
                        item.profit_type    = r.Read("profit_type");
                        item.auto_cashsheet = r.Read("auto_cashsheet");
                        item.if_CtFix       = r.Read("if_CtFix");

                        dt.Rows.Add(item.pay_way, item.pay_name, item.pay_flag, item.km_code, item.pay_kind, item.other1, item.other2, item.num1
                                    , item.num2, item.pay_memo, item.if_acc, item.path, item.is_account, item.account_flag, item.is_pay, item.is_profit
                                    , item.profit_type, item.auto_cashsheet, item.if_CtFix);
                    }
                }
                return(dt);
            }
            catch (Exception ex)
            {
                Helper.LogHelper.writeLog("FinanceBLL.GetSZTypeList()", ex.ToString(), null);
                throw ex;
            }
        }
コード例 #25
0
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var         kv  = r.ToDictionary();
                IBLL.ICusFY bll = new BLL.CusFY();
                if (t == "get_list")
                {
                    DateTime date1  = Helper.Conv.ToDateTime(r.Read("date1"));
                    DateTime date2  = Helper.Conv.ToDateTime(r.Read("date2"));
                    string   cus_no = r.Read("cus_no");
                    var      tb     = bll.GetList(date1, date2, cus_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);

                    res = w.ToString();
                }
                else if (t == "get_order")
                {
                    string sheet_no = r.Read("sheet_no");
                    System.Data.DataTable tb1;
                    System.Data.DataTable tb2;
                    bll.GetOrder(sheet_no, out tb1, out tb2);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("tb1", tb1);
                    w.Append("tb2", tb2);
                    res = w.ToString();
                }
                else if (t == "max_code")
                {
                    string code = bll.MaxCode();
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("code", code);
                    res = w.ToString();
                }
                else if (t == "add")
                {
                    Model.rp_t_supcust_fy_master ord = new Model.rp_t_supcust_fy_master();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.supcust_no   = r.Read("supcust_no");
                    ord.supcust_flag = r.Read("supcust_flag");
                    ord.pay_type     = r.Read("pay_type");
                    ord.pay_date     = System.DateTime.Now;
                    ord.old_no       = r.Read("old_no");
                    ord.oper_id      = r.Read("oper_id");
                    ord.oper_date    = Helper.Conv.ToDateTime(r.Read("oper_date"));
                    ord.approve_flag = "0";
                    ord.approve_man  = "";
                    ord.approve_date = System.DateTime.MinValue;
                    ord.is_payed     = r.Read("is_payed");
                    ord.sale_man     = r.Read("sale_man");
                    ord.branch_no    = r.Read("branch_no");
                    ord.cm_branch    = r.Read("cm_branch");
                    ord.other1       = r.Read("other1");
                    ord.other2       = r.Read("other2");
                    ord.other3       = r.Read("other3");
                    ord.num1         = Helper.Conv.ToDecimal(r.Read("num1"));
                    ord.num2         = Helper.Conv.ToDecimal(r.Read("num2"));
                    ord.num3         = Helper.Conv.ToDecimal(r.Read("num3"));
                    ord.visa_id      = r.Read("visa_id");
                    ord.is_over      = r.Read("is_over");
                    ord.total_amount = Helper.Conv.ToDecimal(r.Read("total_amount"));
                    ord.paid_amount  = Helper.Conv.ToDecimal(r.Read("paid_amount"));
                    ord.pay_way      = r.Read("pay_way");
                    ord.pay_name     = r.Read("pay_name");
                    List <Model.rp_t_supcust_fy_detail> lines = new List <Model.rp_t_supcust_fy_detail>();
                    foreach (ReadWriteContext.IReadContext r2 in r.ReadList("lines"))
                    {
                        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    = r2.Read("kk_no");
                        line.kk_cash  = Helper.Conv.ToDecimal(r2.Read("kk_cash"));
                        line.other1   = r2.Read("other1");
                        line.other2   = r2.Read("other2");
                        line.other3   = r2.Read("other3");
                        line.num1     = Helper.Conv.ToDecimal(r2.Read("num1"));
                        line.num2     = Helper.Conv.ToDecimal(r2.Read("num2"));
                        line.num3     = Helper.Conv.ToDecimal(r2.Read("num3"));
                    }
                    string sheet_no;
                    bll.Add(ord, lines, out sheet_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("sheet_no", sheet_no);

                    res = w.ToString();
                }
                else if (t == "change")
                {
                    Model.rp_t_supcust_fy_master ord = new Model.rp_t_supcust_fy_master();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.supcust_no   = r.Read("supcust_no");
                    ord.supcust_flag = r.Read("supcust_flag");
                    ord.pay_type     = r.Read("pay_type");
                    ord.pay_date     = System.DateTime.Now;
                    ord.old_no       = r.Read("old_no");
                    ord.oper_id      = r.Read("oper_id");
                    ord.oper_date    = Helper.Conv.ToDateTime(r.Read("oper_date"));
                    ord.approve_flag = "0";
                    ord.approve_man  = "";
                    ord.approve_date = System.DateTime.MinValue;
                    ord.is_payed     = r.Read("is_payed");
                    ord.sale_man     = r.Read("sale_man");
                    ord.branch_no    = r.Read("branch_no");
                    ord.cm_branch    = r.Read("cm_branch");
                    ord.other1       = r.Read("other1");
                    ord.other2       = r.Read("other2");
                    ord.other3       = r.Read("other3");
                    ord.num1         = Helper.Conv.ToDecimal(r.Read("num1"));
                    ord.num2         = Helper.Conv.ToDecimal(r.Read("num2"));
                    ord.num3         = Helper.Conv.ToDecimal(r.Read("num3"));
                    ord.visa_id      = r.Read("visa_id");
                    ord.is_over      = r.Read("is_over");
                    ord.total_amount = Helper.Conv.ToDecimal(r.Read("total_amount"));
                    ord.paid_amount  = Helper.Conv.ToDecimal(r.Read("paid_amount"));
                    ord.pay_way      = r.Read("pay_way");
                    ord.pay_name     = r.Read("pay_name");
                    List <Model.rp_t_supcust_fy_detail> lines = new List <Model.rp_t_supcust_fy_detail>();
                    foreach (ReadWriteContext.IReadContext r2 in r.ReadList("lines"))
                    {
                        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    = r2.Read("kk_no");
                        line.kk_cash  = Helper.Conv.ToDecimal(r2.Read("kk_cash"));
                        line.other1   = r2.Read("other1");
                        line.other2   = r2.Read("other2");
                        line.other3   = r2.Read("other3");
                        line.num1     = Helper.Conv.ToDecimal(r2.Read("num1"));
                        line.num2     = Helper.Conv.ToDecimal(r2.Read("num2"));
                        line.num3     = Helper.Conv.ToDecimal(r2.Read("num3"));
                    }
                    bll.Change(ord, lines);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete")
                {
                    string sheet_no = r.Read("sheet_no");
                    bll.Delete(sheet_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "check")
                {
                    string sheet_no    = r.Read("sheet_no");
                    string approve_man = r.Read("approve_man");
                    bll.Check(sheet_no, approve_man);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else
                {
                    throw new Exception("未找到方法" + t);
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                LogHelper.writeLog("", ex.ToString());
                res = w.ToString();
            }
        }
コード例 #26
0
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var        kv  = r.ToDictionary();
                IBLL.IItem bll = new BLL.Item();
                if (t == "get_list")
                {
                    string item_clsno  = r.Read("item_clsno");
                    string keyword     = r.Read("keyword");
                    int    show_stop   = Helper.Conv.ToInt32(r.Read("show_stop"));
                    int    page_index  = Helper.Conv.ToInt32(r.Read("page_index"));
                    int    page_size   = Helper.Conv.ToInt32(r.Read("page_size"));
                    int    total_count = 0;

                    var tb = bll.GetList(item_clsno, keyword, show_stop, page_index, page_size, out total_count);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    w.Append("total_count", total_count.ToString());
                    res = w.ToString();
                }
                else if (t == "get_item")
                {
                    string item_no = r.Read("item_no");
                    var    tb      = bll.GetItem(item_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    res = w.ToString();
                }
                else if (t == "max_code")
                {
                    string code = bll.MaxCode();
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("code", code);
                    res = w.ToString();
                }
                else if (t == "add")
                {
                    Model.bi_t_item_info item = new Model.bi_t_item_info();
                    item.item_no      = r.Read("item_no");
                    item.item_subno   = r.Read("item_subno");
                    item.item_name    = r.Read("item_name");
                    item.item_subname = r.Read("item_subname");
                    item.item_clsno   = r.Read("item_clsno");
                    item.unit_no      = r.Read("unit_no");
                    item.item_size    = r.Read("item_size");
                    item.product_area = r.Read("product_area");
                    item.price        = Helper.Conv.ToDecimal(r.Read("price"));
                    item.base_price   = Helper.Conv.ToDecimal(r.Read("base_price"));
                    item.sale_price   = Helper.Conv.ToDecimal(r.Read("sale_price"));

                    item.combine_sta  = r.Read("combine_sta");
                    item.item_flag    = r.Read("item_flag");
                    item.display_flag = r.Read("display_flag");
                    item.sup_no       = r.Read("sup_no");
                    item.barcode      = r.Read("barcode");
                    item.base_price2  = Helper.Conv.ToDecimal(r.Read("base_price2"));
                    item.base_price3  = Helper.Conv.ToDecimal(r.Read("base_price3"));
                    item.valid_day    = Helper.Conv.ToDecimal(r.Read("valid_day"));

                    bll.Add(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "change")
                {
                    Model.bi_t_item_info item = new Model.bi_t_item_info();
                    item.item_no      = r.Read("item_no");
                    item.item_subno   = r.Read("item_subno");
                    item.item_name    = r.Read("item_name");
                    item.item_subname = r.Read("item_subname");
                    item.item_clsno   = r.Read("item_clsno");
                    item.unit_no      = r.Read("unit_no");
                    item.item_size    = r.Read("item_size");
                    item.product_area = r.Read("product_area");
                    item.price        = Helper.Conv.ToDecimal(r.Read("price"));
                    item.base_price   = Helper.Conv.ToDecimal(r.Read("base_price"));
                    item.sale_price   = Helper.Conv.ToDecimal(r.Read("sale_price"));

                    item.combine_sta  = r.Read("combine_sta");
                    item.item_flag    = r.Read("item_flag");
                    item.display_flag = r.Read("display_flag");
                    item.sup_no       = r.Read("sup_no");
                    item.barcode      = r.Read("barcode");
                    item.base_price2  = Helper.Conv.ToDecimal(r.Read("base_price2"));
                    item.base_price3  = Helper.Conv.ToDecimal(r.Read("base_price3"));
                    item.valid_day    = Helper.Conv.ToDecimal(r.Read("valid_day"));

                    bll.Change(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete")
                {
                    string item_no = r.Read("item_no");
                    bll.Delete(item_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "get_list_short")
                {
                    var tb = bll.GetListShort();
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("datas", tb);
                    res = w.ToString();
                }
                else if (t == "is_use")
                {
                    string item_no = r.Read("item_no");
                    var    val     = bll.IsUse(item_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("value", val.ToString());
                    res = w.ToString();
                }
                else if (t == "get_list_by_sup")
                {
                    string sup_no      = r.Read("sup_no");
                    string keyword     = r.Read("keyword");
                    int    show_stop   = Helper.Conv.ToInt32(r.Read("show_stop"));
                    int    page_index  = Helper.Conv.ToInt32(r.Read("page_index"));
                    int    page_size   = Helper.Conv.ToInt32(r.Read("page_size"));
                    int    total_count = 0;

                    var tb = bll.GetList_BySup(sup_no, keyword, show_stop, page_index, page_size, out total_count);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    w.Append("total_count", total_count.ToString());
                    res = w.ToString();
                }
                else
                {
                    WebHelper w = new WebHelper(pars);
                    w.ReflectionMethod(bll, t);
                    res = w.NmJson();
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                res = w.ToString();
            }
        }
コード例 #27
0
 void IServiceBase.Request(string t, string pars, out string res)
 {
     try
     {
         ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
         var            kv  = r.ToDictionary();
         IBLL.IPriceBLL bll = new BLL.PriceBLL();
         if (t == "get_cust_price_list")
         {
             string cust_id = r.Read("cust_id");
             var    tb      = bll.GetCustPriceList(cust_id);
             ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
             w.Append("errId", "0");
             w.Append("errMsg", "");
             w.Append("data", tb);
             res = w.ToString();
         }
         else if (t == "get_sup_price_list")
         {
             string sup_id = r.Read("sup_id");
             var    tb     = bll.GetSupPriceList(sup_id);
             ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
             w.Append("errId", "0");
             w.Append("errMsg", "");
             w.Append("data", tb);
             res = w.ToString();
         }
         else if (t == "get_cust_item_price")
         {
             string  cust_id = r.Read("cust_id");
             string  item_no = r.Read("item_no");
             string  type    = r.Read("type");
             decimal price   = bll.GetCusItemPrice(cust_id, item_no, type);
             ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
             w.Append("errId", "0");
             w.Append("errMsg", "");
             w.Append("price", price.ToString());
             res = w.ToString();
         }
         else if (t == "get_sup_item_price")
         {
             string  sup_id  = r.Read("sup_id");
             string  item_no = r.Read("item_no");
             string  type    = r.Read("type");
             decimal price   = bll.GetSupItemPrice(sup_id, item_no, type);
             ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
             w.Append("errId", "0");
             w.Append("errMsg", "");
             w.Append("price", price.ToString());
             res = w.ToString();
         }
         else if (t == "get_last_in_price")
         {
             string  item_no = r.Read("item_no");
             decimal price   = bll.GetLastInPrice(item_no);
             ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
             w.Append("errId", "0");
             w.Append("errMsg", "");
             w.Append("price", price.ToString());
             res = w.ToString();
         }
         else
         {
             throw new Exception("接口不存在[" + t + "]");
         }
     }
     catch (Exception ex)
     {
         LogHelper.writeLog("price()", ex.ToString(), t, pars);
         ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
         w.Append("errId", "-1");
         w.Append("errMsg", ex.Message);
         res = w.ToString();
     }
 }
コード例 #28
0
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var            kv  = r.ToDictionary();
                IBLL.IInOutBLL bll = new BLL.InOutBLL();
                if (t == "get_salesheet_list")
                {
                    string date1    = r.Read("date1");
                    string date2    = r.Read("date2");
                    string cust_id  = r.Read("cust_id");
                    string sale_man = r.Read("sale_man");

                    var tb = bll.GetSaleSheetList(date1, date2, cust_id, sale_man);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);

                    res = w.ToString();
                }
                else if (t == "get_simple_salesheet_list")
                {
                    string date1   = r.Read("date1");
                    string date2   = r.Read("date2");
                    string cust_id = r.Read("cust_id");

                    var tb = bll.GetSimpleSaleSheetList(date1, date2, cust_id);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);

                    res = w.ToString();
                }
                else if (t == "get_salesheet")
                {
                    string sheet_no = r.Read("sheet_no");
                    System.Data.DataTable tb1;
                    System.Data.DataTable tb2;
                    bll.GetSaleSheet(sheet_no, out tb1, out tb2);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("tb1", tb1);
                    w.Append("tb2", tb2);
                    res = w.ToString();
                }
                else if (t == "add_salesheet")
                {
                    var ord = new Model.sm_t_salesheet();

                    ord.sheet_no = r.Read("sheet_no");

                    ord.voucher_no   = r.Read("voucher_no");
                    ord.branch_no    = r.Read("branch_no");
                    ord.cust_no      = r.Read("cust_no");
                    ord.pay_way      = r.Read("pay_way");
                    ord.discount     = Helper.Conv.ToDecimal(r.Read("discount"));
                    ord.coin_no      = r.Read("coin_no");
                    ord.real_amount  = Helper.Conv.ToDecimal(r.Read("real_amount"));
                    ord.total_amount = Helper.Conv.ToDecimal(r.Read("total_amount"));
                    ord.paid_amount  = Helper.Conv.ToDecimal(r.Read("paid_amount"));
                    ord.approve_flag = "0";
                    ord.source_flag  = "";
                    ord.oper_id      = r.Read("oper_id");
                    ord.sale_man     = r.Read("sale_man");
                    ord.oper_date    = Helper.Conv.ToDateTime(r.Read("oper_date"));
                    ord.pay_date     = Helper.Conv.ToDateTime(r.Read("pay_date"));
                    ord.other1       = r.Read("other1");
                    ord.other2       = r.Read("other2");
                    ord.other3       = r.Read("other3");
                    ord.cm_branch    = r.Read("cm_branch");
                    ord.approve_man  = "";
                    ord.approve_date = DateTime.MinValue;
                    ord.num1         = Helper.Conv.ToDecimal(r.Read("num1"));
                    ord.num2         = Helper.Conv.ToDecimal(r.Read("num2"));
                    ord.num3         = Helper.Conv.ToDecimal(r.Read("num3"));
                    ord.payfee_memo  = r.Read("payfee_memo");
                    ord.old_no       = "";
                    ord.psheet_no    = r.Read("psheet_no");
                    ord.pay_nowmark  = r.Read("pay_nowmark");
                    ord.if_back      = r.Read("if_back");
                    ord.cust_cls     = "";
                    ord.other4       = r.Read("other4");

                    List <Model.sm_t_salesheet_detail> lines = new List <Model.sm_t_salesheet_detail>();
                    foreach (ReadWriteContext.IReadContext r2 in r.ReadList("lines"))
                    {
                        var item = new Model.sm_t_salesheet_detail();
                        item.sheet_no    = r2.Read("sheet_no");
                        item.item_no     = r2.Read("item_no");
                        item.item_name   = r2.Read("item_name");
                        item.unit_no     = r2.Read("unit_no");
                        item.unit_factor = Helper.Conv.ToDecimal(r2.Read("unit_factor"));
                        item.sale_qnty   = Helper.Conv.ToDecimal(r2.Read("sale_qnty"));
                        item.sale_price  = Helper.Conv.ToDecimal(r2.Read("sale_price"));
                        item.real_price  = Helper.Conv.ToDecimal(r2.Read("real_price"));
                        item.cost_price  = Helper.Conv.ToDecimal(r2.Read("cost_price"));
                        item.sale_money  = Helper.Conv.ToDecimal(r2.Read("sale_money"));
                        item.sale_tax    = Helper.Conv.ToDecimal(r2.Read("sale_tax"));
                        item.is_tax      = r2.Read("is_tax");
                        item.other1      = r2.Read("other1");
                        item.other2      = r2.Read("other2");
                        item.other3      = r2.Read("other3");
                        item.other4      = r2.Read("other4");
                        item.num1        = Helper.Conv.ToDecimal(r2.Read("num1"));
                        item.num2        = Helper.Conv.ToDecimal(r2.Read("num2"));
                        item.num3        = Helper.Conv.ToDecimal(r2.Read("num3"));
                        item.num4        = Helper.Conv.ToDecimal(r2.Read("num4"));
                        item.num5        = Helper.Conv.ToDecimal(r2.Read("num5"));
                        item.num6        = Helper.Conv.ToDecimal(r2.Read("num6"));
                        item.barcode     = r2.Read("barcode");
                        item.sheet_sort  = Helper.Conv.ToInt(r2.Read("sheet_sort"));
                        item.ret_qnty    = Helper.Conv.ToDecimal(r2.Read("ret_qnty"));
                        item.discount    = Helper.Conv.ToDecimal(r2.Read("discount"));
                        item.voucher_no  = r2.Read("voucher_no");
                        item.cost_notax  = Helper.Conv.ToDecimal(r2.Read("cost_notax"));
                        item.packqty     = Helper.Conv.ToInt(r2.Read("packqty"));
                        item.sgqty       = Helper.Conv.ToDecimal(r2.Read("sgqty"));
                        item.branch_no_d = "";
                        item.ly_sup_no   = "";
                        item.ly_rate     = 0M;
                        item.num7        = Helper.Conv.ToDecimal(r2.Read("num7"));
                        item.other5      = r2.Read("other5");
                        item.num8        = Helper.Conv.ToDecimal(r2.Read("num8"));
                        item.produce_day = DateTime.MinValue;
                        lines.Add(item);
                    }
                    string sheet_no = "";
                    bll.AddSaleSheet(ord, lines, out sheet_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("sheet_no", sheet_no);
                    res = w.ToString();
                }
                else if (t == "change_salesheet")
                {
                    var ord = new Model.sm_t_salesheet();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.voucher_no   = r.Read("voucher_no");
                    ord.branch_no    = r.Read("branch_no");
                    ord.cust_no      = r.Read("cust_no");
                    ord.pay_way      = r.Read("pay_way");
                    ord.discount     = Helper.Conv.ToDecimal(r.Read("discount"));
                    ord.coin_no      = r.Read("coin_no");
                    ord.real_amount  = Helper.Conv.ToDecimal(r.Read("real_amount"));
                    ord.total_amount = Helper.Conv.ToDecimal(r.Read("total_amount"));
                    ord.paid_amount  = Helper.Conv.ToDecimal(r.Read("paid_amount"));
                    ord.approve_flag = "0";
                    ord.source_flag  = "";
                    ord.oper_id      = r.Read("oper_id");
                    ord.sale_man     = r.Read("sale_man");
                    ord.oper_date    = Helper.Conv.ToDateTime(r.Read("oper_date"));
                    ord.pay_date     = DateTime.MinValue;
                    ord.other1       = r.Read("other1");
                    ord.other2       = r.Read("other2");
                    ord.other3       = r.Read("other3");
                    ord.cm_branch    = r.Read("cm_branch");
                    ord.approve_man  = "";
                    ord.approve_date = DateTime.MinValue;
                    ord.num1         = Helper.Conv.ToDecimal(r.Read("num1"));
                    ord.num2         = Helper.Conv.ToDecimal(r.Read("num2"));
                    ord.num3         = Helper.Conv.ToDecimal(r.Read("num3"));
                    ord.payfee_memo  = r.Read("payfee_memo");
                    ord.old_no       = "";
                    ord.psheet_no    = r.Read("psheet_no");
                    ord.pay_nowmark  = r.Read("pay_nowmark");
                    ord.if_back      = r.Read("if_back");
                    ord.cust_cls     = "";
                    ord.other4       = r.Read("other4");
                    ord.update_time  = Helper.Conv.ToDateTime(r.Read("update_time"));

                    List <Model.sm_t_salesheet_detail> lines = new List <Model.sm_t_salesheet_detail>();
                    foreach (ReadWriteContext.IReadContext r2 in r.ReadList("lines"))
                    {
                        var item = new Model.sm_t_salesheet_detail();
                        item.sheet_no    = r2.Read("sheet_no");
                        item.item_no     = r2.Read("item_no");
                        item.item_name   = r2.Read("item_name");
                        item.unit_no     = r2.Read("unit_no");
                        item.unit_factor = Helper.Conv.ToDecimal(r2.Read("unit_factor"));
                        item.sale_qnty   = Helper.Conv.ToDecimal(r2.Read("sale_qnty"));
                        item.sale_price  = Helper.Conv.ToDecimal(r2.Read("sale_price"));
                        item.real_price  = Helper.Conv.ToDecimal(r2.Read("real_price"));
                        item.cost_price  = Helper.Conv.ToDecimal(r2.Read("cost_price"));
                        item.sale_money  = Helper.Conv.ToDecimal(r2.Read("sale_money"));
                        item.sale_tax    = Helper.Conv.ToDecimal(r2.Read("sale_tax"));
                        item.is_tax      = r2.Read("is_tax");
                        item.other1      = r2.Read("other1");
                        item.other2      = r2.Read("other2");
                        item.other3      = r2.Read("other3");
                        item.other4      = r2.Read("other4");
                        item.num1        = Helper.Conv.ToDecimal(r2.Read("num1"));
                        item.num2        = Helper.Conv.ToDecimal(r2.Read("num2"));
                        item.num3        = Helper.Conv.ToDecimal(r2.Read("num3"));
                        item.num4        = Helper.Conv.ToDecimal(r2.Read("num4"));
                        item.num5        = Helper.Conv.ToDecimal(r2.Read("num5"));
                        item.num6        = Helper.Conv.ToDecimal(r2.Read("num6"));
                        item.barcode     = r2.Read("barcode");
                        item.sheet_sort  = Helper.Conv.ToInt(r2.Read("sheet_sort"));
                        item.ret_qnty    = Helper.Conv.ToDecimal(r2.Read("ret_qnty"));
                        item.discount    = Helper.Conv.ToDecimal(r2.Read("discount"));
                        item.voucher_no  = r2.Read("voucher_no");
                        item.cost_notax  = Helper.Conv.ToDecimal(r2.Read("cost_notax"));
                        item.packqty     = Helper.Conv.ToInt(r2.Read("packqty"));
                        item.sgqty       = Helper.Conv.ToDecimal(r2.Read("sgqty"));
                        item.branch_no_d = "";
                        item.ly_sup_no   = "";
                        item.ly_rate     = 0M;
                        item.num7        = Helper.Conv.ToDecimal(r2.Read("num7"));
                        item.other5      = r2.Read("other5");
                        item.num8        = Helper.Conv.ToDecimal(r2.Read("num8"));
                        item.produce_day = DateTime.MinValue;
                        lines.Add(item);
                    }
                    bll.ChangeSaleSheet(ord, lines);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete_salesheet")
                {
                    string sheet_no    = r.Read("sheet_no");
                    var    update_time = Helper.Conv.ToDateTime(r.Read("update_time"));
                    bll.DeleteSaleSheet(sheet_no, update_time);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "check_salesheet")
                {
                    string sheet_no    = r.Read("sheet_no");
                    string approve_man = r.Read("approve_man");
                    var    update_time = Helper.Conv.ToDateTime(r.Read("update_time"));
                    bll.CheckSaleSheet(sheet_no, approve_man, update_time);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "get_inout_list")
                {
                    string date1      = r.Read("date1");
                    string date2      = r.Read("date2");
                    string supcust_no = r.Read("supcust_no");
                    string trans_no   = r.Read("trans_no");

                    var tb = bll.GetInOutList(date1, date2, supcust_no, trans_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);

                    res = w.ToString();
                }
                else if (t == "get_simple_inout_list")
                {
                    string date1      = r.Read("date1");
                    string date2      = r.Read("date2");
                    string supcust_no = r.Read("supcust_no");
                    string trans_no   = r.Read("trans_no");

                    var tb = bll.GetSimpleInOutList(date1, date2, supcust_no, trans_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);

                    res = w.ToString();
                }
                else if (t == "get_other_inout_list")
                {
                    string date1    = r.Read("date1");
                    string date2    = r.Read("date2");
                    string trans_no = r.Read("trans_no");

                    var tb = bll.GetOtherInOutList(date1, date2, trans_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);

                    res = w.ToString();
                }
                else if (t == "get_inout")
                {
                    string sheet_no = r.Read("sheet_no");
                    string trans_no = r.Read("trans_no");
                    System.Data.DataTable tb1;
                    System.Data.DataTable tb2;
                    bll.GetInOut(sheet_no, trans_no, out tb1, out tb2);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("tb1", tb1);
                    w.Append("tb2", tb2);
                    res = w.ToString();
                }
                else if (t == "get_other_inout")
                {
                    string sheet_no = r.Read("sheet_no");
                    System.Data.DataTable tb1;
                    System.Data.DataTable tb2;
                    bll.GetInOut(sheet_no, out tb1, out tb2);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("tb1", tb1);
                    w.Append("tb2", tb2);
                    res = w.ToString();
                }
                else if (t == "add_inout")
                {
                    var ord = new Model.ic_t_inout_store_master();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.trans_no     = r.Read("trans_no");
                    ord.branch_no    = r.Read("branch_no");
                    ord.d_branch_no  = r.Read("d_branch_no");
                    ord.voucher_no   = r.Read("voucher_no");
                    ord.supcust_no   = r.Read("supcust_no");
                    ord.total_amount = Helper.Conv.ToDecimal(r.Read("total_amount"));
                    ord.inout_amount = Helper.Conv.ToDecimal(r.Read("inout_amount"));
                    ord.coin_no      = r.Read("coin_no");
                    ord.pay_way      = r.Read("pay_way");
                    ord.tax_amount   = Helper.Conv.ToDecimal(r.Read("tax_amount"));
                    ord.discount     = Helper.Conv.ToDecimal(r.Read("discount"));
                    ord.pay_date     = Helper.Conv.ToDateTime(r.Read("pay_date"));
                    ord.approve_flag = "0";
                    ord.oper_date    = Helper.Conv.ToDateTime(r.Read("oper_date"));
                    ord.oper_id      = r.Read("oper_id");
                    ord.display_flag = "1";
                    ord.other1       = r.Read("other1");
                    ord.other2       = r.Read("other2");
                    ord.other3       = r.Read("other3");
                    ord.cm_branch    = r.Read("cm_branch"); //不确定
                    ord.deal_man     = r.Read("deal_man");
                    ord.old_no       = "";
                    ord.approve_man  = r.Read("approve_man");
                    ord.approve_date = DateTime.MinValue;
                    ord.num1         = Helper.Conv.ToDecimal(r.Read("num1"));
                    ord.num2         = Helper.Conv.ToDecimal(r.Read("num2"));
                    ord.num3         = Helper.Conv.ToDecimal(r.Read("num3"));
                    ord.max_change   = 0m; //不确定
                    ord.sale_no      = r.Read("sale_no");
                    ord.lock_man     = "";
                    ord.lock_date    = DateTime.MinValue;

                    List <Model.ic_t_inout_store_detail> lines = new List <Model.ic_t_inout_store_detail>();
                    foreach (ReadWriteContext.IReadContext r2 in r.ReadList("lines"))
                    {
                        var item = new Model.ic_t_inout_store_detail();
                        item.sheet_no    = r2.Read("sheet_no");
                        item.item_no     = r2.Read("item_no");
                        item.item_name   = r2.Read("item_name");
                        item.unit_no     = r2.Read("unit_no");
                        item.unit_factor = Helper.Conv.ToDecimal(r2.Read("unit_factor"));
                        item.in_qty      = Helper.Conv.ToDecimal(r2.Read("in_qty"));
                        item.orgi_price  = Helper.Conv.ToDecimal(r2.Read("orgi_price"));
                        item.valid_price = Helper.Conv.ToDecimal(r2.Read("valid_price"));
                        item.cost_price  = Helper.Conv.ToDecimal(r2.Read("cost_price"));
                        item.sub_amount  = Helper.Conv.ToDecimal(r2.Read("sub_amount"));
                        item.tax         = Helper.Conv.ToDecimal(r2.Read("tax"));
                        item.is_tax      = r2.Read("is_tax");
                        item.valid_date  = Helper.Conv.ToDateTime(r2.Read("valid_date"));
                        item.other1      = r2.Read("other1");
                        item.other2      = r2.Read("other2");
                        item.other3      = r2.Read("other3");
                        item.num1        = Helper.Conv.ToDecimal(r2.Read("num1"));
                        item.num2        = Helper.Conv.ToDecimal(r2.Read("num2"));
                        item.num3        = Helper.Conv.ToDecimal(r2.Read("num3"));
                        item.num4        = Helper.Conv.ToDecimal(r2.Read("num4"));
                        item.num5        = Helper.Conv.ToDecimal(r2.Read("num5"));
                        item.num6        = Helper.Conv.ToDecimal(r2.Read("num6"));
                        item.barcode     = r2.Read("barcode");
                        item.sheet_sort  = Helper.Conv.ToInt(r2.Read("sheet_sort"));
                        item.ret_qnty    = Helper.Conv.ToDecimal(r2.Read("ret_qnty"));
                        item.discount    = Helper.Conv.ToDecimal(r2.Read("discount"));
                        item.voucher_no  = r2.Read("voucher_no");
                        item.cost_notax  = 0m; //不确定
                        item.packqty     = Helper.Conv.ToInt(r2.Read("packqty"));
                        item.sgqty       = Helper.Conv.ToDecimal(r2.Read("sgqty"));
                        item.branch_no_d = "";
                        item.ly_sup_no   = "";
                        item.ly_rate     = 0m;
                        lines.Add(item);
                    }
                    string sheet_no = "";
                    bll.AddInOut(ord, lines, out sheet_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("sheet_no", sheet_no);
                    res = w.ToString();
                }
                else if (t == "change_inout")
                {
                    var ord = new Model.ic_t_inout_store_master();
                    ord.sheet_no     = r.Read("sheet_no");
                    ord.trans_no     = r.Read("trans_no");
                    ord.branch_no    = r.Read("branch_no");
                    ord.d_branch_no  = "";
                    ord.db_no        = r.Read("db_no");
                    ord.voucher_no   = r.Read("voucher_no");
                    ord.supcust_no   = r.Read("supcust_no");
                    ord.total_amount = Helper.Conv.ToDecimal(r.Read("total_amount"));
                    ord.inout_amount = Helper.Conv.ToDecimal(r.Read("inout_amount"));
                    ord.coin_no      = "RMB";
                    ord.pay_way      = r.Read("pay_way");
                    ord.tax_amount   = Helper.Conv.ToDecimal(r.Read("tax_amount"));
                    ord.discount     = Helper.Conv.ToDecimal(r.Read("discount"));
                    ord.pay_date     = Helper.Conv.ToDateTime(r.Read("pay_date"));
                    ord.approve_flag = "0";
                    ord.oper_date    = Helper.Conv.ToDateTime(r.Read("oper_date"));
                    ord.oper_id      = r.Read("oper_id");
                    ord.display_flag = "1";
                    ord.other1       = r.Read("other1");
                    ord.other2       = r.Read("other2");
                    ord.other3       = r.Read("other3");
                    ord.cm_branch    = r.Read("cm_branch"); //不确定
                    ord.deal_man     = r.Read("deal_man");
                    ord.old_no       = "";
                    ord.approve_man  = r.Read("approve_man");
                    ord.approve_date = DateTime.MinValue;
                    ord.num1         = Helper.Conv.ToDecimal(r.Read("num1"));
                    ord.num2         = Helper.Conv.ToDecimal(r.Read("num2"));
                    ord.num3         = Helper.Conv.ToDecimal(r.Read("num3"));
                    ord.max_change   = 0m; //不确定
                    ord.sale_no      = r.Read("sale_no");
                    ord.lock_man     = "";
                    ord.lock_date    = DateTime.MinValue;
                    ord.update_time  = Helper.Conv.ToDateTime(r.Read("update_time"));

                    List <Model.ic_t_inout_store_detail> lines = new List <Model.ic_t_inout_store_detail>();
                    foreach (ReadWriteContext.IReadContext r2 in r.ReadList("lines"))
                    {
                        var item = new Model.ic_t_inout_store_detail();
                        item.sheet_no    = r2.Read("sheet_no");
                        item.item_no     = r2.Read("item_no");
                        item.item_name   = r2.Read("item_name");
                        item.unit_no     = r2.Read("unit_no");
                        item.unit_factor = Helper.Conv.ToDecimal(r2.Read("unit_factor"));
                        item.in_qty      = Helper.Conv.ToDecimal(r2.Read("in_qty"));
                        item.orgi_price  = Helper.Conv.ToDecimal(r2.Read("orgi_price"));
                        item.valid_price = Helper.Conv.ToDecimal(r2.Read("valid_price"));
                        item.cost_price  = Helper.Conv.ToDecimal(r2.Read("cost_price"));
                        item.sub_amount  = Helper.Conv.ToDecimal(r2.Read("sub_amount"));
                        item.tax         = Helper.Conv.ToDecimal(r2.Read("tax"));
                        item.is_tax      = r2.Read("is_tax");
                        item.valid_date  = Helper.Conv.ToDateTime(r2.Read("valid_date"));
                        item.other1      = r2.Read("other1");
                        item.other2      = r2.Read("other2");
                        item.other3      = r2.Read("other3");
                        item.num1        = Helper.Conv.ToDecimal(r2.Read("num1"));
                        item.num2        = Helper.Conv.ToDecimal(r2.Read("num2"));
                        item.num3        = Helper.Conv.ToDecimal(r2.Read("num3"));
                        item.num4        = Helper.Conv.ToDecimal(r2.Read("num4"));
                        item.num5        = Helper.Conv.ToDecimal(r2.Read("num5"));
                        item.num6        = Helper.Conv.ToDecimal(r2.Read("num6"));
                        item.barcode     = r2.Read("barcode");
                        item.sheet_sort  = Helper.Conv.ToInt(r2.Read("sheet_sort"));
                        item.ret_qnty    = Helper.Conv.ToDecimal(r2.Read("ret_qnty"));
                        item.discount    = Helper.Conv.ToDecimal(r2.Read("discount"));
                        item.voucher_no  = r2.Read("voucher_no");
                        item.cost_notax  = 0m; //不确定
                        item.packqty     = Helper.Conv.ToInt(r2.Read("packqty"));
                        item.sgqty       = Helper.Conv.ToDecimal(r2.Read("sgqty"));
                        item.branch_no_d = "";
                        item.ly_sup_no   = "";
                        item.ly_rate     = 0m;
                        lines.Add(item);
                    }
                    bll.ChangeInOut(ord, lines);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete_inout")
                {
                    string sheet_no    = r.Read("sheet_no");
                    var    update_time = Helper.Conv.ToDateTime(r.Read("update_time"));
                    bll.DeleteInOut(sheet_no, update_time);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "check_inout")
                {
                    string sheet_no    = r.Read("sheet_no");
                    string approve_man = r.Read("approve_man");
                    var    update_time = Helper.Conv.ToDateTime(r.Read("update_time"));
                    bll.CheckInOut(sheet_no, approve_man, update_time);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else
                {
                    throw new Exception("未找到方法[" + t + "]");
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                LogHelper.writeLog("inout()", ex.ToString(), t, pars);
                res = w.ToString();
            }
        }
コード例 #29
0
        void IBLL.ISupSettle.Change(Model.rp_t_recpay_record_info ord, List <Model.rp_t_recpay_record_detail> lines)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("sheet_no", ord.sheet_no);
            w.Append("supcust_no", ord.supcust_no);
            w.Append("supcust_flag", ord.supcust_flag);
            w.Append("flag_post", ord.flag_post);
            w.Append("total_amount", ord.total_amount.ToString());
            w.Append("free_money", ord.free_money.ToString());
            w.Append("coin_no", ord.coin_no);
            w.Append("coin_rate", ord.coin_rate.ToString());
            w.Append("pay_way", ord.pay_way);
            w.Append("approve_flag", ord.approve_flag);
            w.Append("oper_id", ord.oper_id);
            w.Append("oper_date", ord.oper_date.ToString("yyyy-MM-dd HH:mm:ss"));
            w.Append("deal_man", ord.deal_man);
            w.Append("approve_man", ord.approve_man);
            w.Append("approve_date", "");
            w.Append("other1", ord.other1);
            w.Append("other2", ord.other2);
            w.Append("other3", ord.other3);
            w.Append("visa_id", ord.visa_id);
            w.Append("num1", ord.num1.ToString());
            w.Append("num2", ord.num2.ToString());
            w.Append("num3", ord.num3.ToString());
            w.Append("cm_branch", ord.cm_branch);
            w.Append("branch_no", ord.branch_no);
            w.Append("from_date", "");
            w.Append("to_date", "");
            w.Append("rc_sheet_no", ord.rc_sheet_no);
            var tb = new DataTable();

            tb.Columns.Add("sheet_no");
            tb.Columns.Add("voucher_no");
            tb.Columns.Add("sheet_amount", typeof(decimal));
            tb.Columns.Add("paid_amount", typeof(decimal));
            tb.Columns.Add("paid_free", typeof(decimal));
            tb.Columns.Add("pay_amount", typeof(decimal));
            tb.Columns.Add("pay_free", typeof(decimal));
            tb.Columns.Add("memo");
            tb.Columns.Add("other1");
            tb.Columns.Add("other2");
            tb.Columns.Add("other3");
            tb.Columns.Add("num1");
            tb.Columns.Add("num2");
            tb.Columns.Add("num3");
            tb.Columns.Add("pay_date", typeof(DateTime));
            tb.Columns.Add("item_no");
            tb.Columns.Add("path");
            tb.Columns.Add("select_flag");
            tb.Columns.Add("voucher_type");
            tb.Columns.Add("oper_date", typeof(DateTime));
            tb.Columns.Add("voucher_other1");
            tb.Columns.Add("voucher_other2");
            tb.Columns.Add("order_no");

            foreach (Model.rp_t_recpay_record_detail line in lines)
            {
                tb.Rows.Add(
                    line.sheet_no,
                    line.voucher_no,
                    line.sheet_amount,
                    line.paid_amount,
                    line.paid_free,
                    line.pay_amount,
                    line.pay_free,
                    line.memo,
                    line.other1,
                    line.other2,
                    line.other3,
                    line.num1,
                    line.num2,
                    line.num3,
                    line.pay_date,
                    line.item_no,
                    line.path,
                    line.select_flag,
                    line.voucher_type,
                    line.oper_date,
                    line.voucher_other1,
                    line.voucher_other2,
                    line.order_no

                    );
            }
            w.Append("lines", tb);
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/sup_settle?t=change", w.ToString());

            ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(json);
            if (r.Read("errId") != "0")
            {
                throw new Exception(r.Read("errMsg"));
            }
        }
コード例 #30
0
ファイル: sys.cs プロジェクト: zanderphh/IvyBack_GuiZhou
        public void Request(string t, string pars, out string res)
        {
            WebHelper w = new WebHelper(pars);

            IBLL.ISys bll = new BLL.Sys();
            try
            {
                if (t == "add")
                {
                    Model.sys_t_system system = w.GetObject <Model.sys_t_system>();
                    bll.add(system);
                    w.WriteSuccess();
                }
                else if (t == "addDic")
                {
                    Dictionary <string, Model.sys_t_system> dic = w.GetDic <Model.sys_t_system>();
                    bll.addDic(dic);
                    w.WriteSuccess();
                }
                else if (t == "update")
                {
                    Model.sys_t_system system = w.GetObject <Model.sys_t_system>();
                    bll.update(system);
                    w.WriteSuccess();
                }
                else if (t == "updateDic")
                {
                    Dictionary <string, Model.sys_t_system> dic = w.GetDic <Model.sys_t_system>();
                    bll.updatedic(dic);
                    w.WriteSuccess();
                }
                else if (t == "GetAll")
                {
                    var tb = bll.GetAll();
                    w.Write(tb);
                    w.WriteSuccess();
                }
                else if (t == "read")
                {
                    ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                    string sys_var_id = r.Read("sys_var_id");
                    string value      = bll.Read(sys_var_id);
                    ReadWriteContext.IWriteContext w2 = new ReadWriteContext.WriteContextByJson();
                    w2.Append("errId", "0");
                    w2.Append("errMsg", "");
                    w2.Append("value", value);

                    res = w2.ToString();
                    return;
                }
                else
                {
                    w.ReflectionMethod(bll, t);
                    res = w.NmJson();
                }

                res = w.NmJson();
            }
            catch (Exception ex)
            {
                w.WriteError(ex);
                res = w.NmJson();
            }
        }