Exemplo n.º 1
0
        DataTable IBLL.IInOutBLL.GetOtherInOutList(DateTime date1, DateTime date2, string trans_no)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("date1", date1.ToString("yyyy-MM-dd"));
            w.Append("date2", date2.ToString("yyyy-MM-dd"));
            w.Append("trans_no", trans_no);
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/inout?t=get_other_inout_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);
            }
        }
Exemplo n.º 2
0
        public System.Data.DataTable GetSZList()
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("is_show_stop", "0");
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/finance?t=get_sz_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());
                }
                var tb  = GetDataTable(r.ReadList("data"));
                var tb2 = tb.Clone();
                foreach (DataRow row in tb.Rows)
                {
                    if (row["pay_flag"].ToString() == "3")
                    {
                        tb2.Rows.Add(row.ItemArray);
                    }
                }
                return(tb2);
            }
        }
Exemplo n.º 3
0
        DataTable ICommonBLL.GetPeopleList()
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("page_index", "1");
            w.Append("page_size", "10000");
            w.Append("dep_no", "");
            w.Append("show_stop", "0");
            w.Append("keyword", "");

            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/people?t=get_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);
            }
        }
Exemplo n.º 4
0
        System.Data.DataTable IBLL.ISupSettle.GetList(DateTime date1, DateTime date2, string sup_no)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("date1", date1.ToString("yyyy-MM-dd"));
            w.Append("date2", date2.ToString("yyyy-MM-dd"));
            w.Append("sup_no", sup_no);
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/sup_settle?t=get_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());
                }
                var tb = GetDataTable(r.ReadList("data"));

                return(tb);
            }
        }
Exemplo n.º 5
0
        public System.Data.DataTable GetSupList()
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("region_no", "");
            w.Append("keyword", "");
            w.Append("page_index", "1");
            w.Append("page_size", "20000");
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/sup?t=get_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());
                }
                var tb = GetDataTable(r.ReadList("data"));
                return(tb);
            }
        }
Exemplo n.º 6
0
        System.Data.DataTable IBLL.ICusPriceOrder.GetList(DateTime date1, DateTime date2)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("date1", date1.ToString("yyyy-MM-dd"));
            w.Append("date2", date2.ToString("yyyy-MM-dd"));
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/cus_price_order?t=get_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);
            }
        }
Exemplo n.º 7
0
        void IBLL.IFYOrder.Add(Model.bank_t_cash_master ord, List <Model.bank_t_cash_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("visa_id", ord.visa_id);
            w.Append("visa_in", ord.visa_in);
            w.Append("pay_way", ord.pay_way);
            w.Append("coin_no", ord.coin_no);
            w.Append("coin_rate", ord.coin_rate.ToString());
            w.Append("deal_man", ord.deal_man);
            w.Append("oper_id", ord.oper_id);
            w.Append("oper_date", ord.oper_date.ToString("yyyy-MM-dd"));
            w.Append("bill_total", ord.bill_total.ToString());
            w.Append("bill_flag", ord.bill_flag);
            w.Append("cm_branch", ord.cm_branch);
            w.Append("approve_flag", "0");
            w.Append("approve_man", "");
            w.Append("approve_date", "");
            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());
            var tb = new DataTable();

            tb.Columns.Add("sheet_no");
            tb.Columns.Add("type_no");
            tb.Columns.Add("bill_cash", typeof(decimal));
            tb.Columns.Add("memo");


            foreach (Model.bank_t_cash_detail line in lines)
            {
                tb.Rows.Add(
                    line.sheet_no,
                    line.type_no,
                    line.bill_cash,
                    line.memo

                    );
            }
            w.Append("lines", tb);
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/fy_order?t=add", 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");
        }
Exemplo n.º 8
0
        void IBLL.ISupSettle.Delete(string sheet_no)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("sheet_no", sheet_no);
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/sup_settle?t=delete", w.ToString());

            ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(json);
            if (r.Read("errId") != "0")
            {
                throw new Exception(r.Read("errMsg"));
            }
        }
Exemplo n.º 9
0
        void IBLL.IInOutBLL.DeleteInOut(string sheet_no, DateTime update_time)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("sheet_no", sheet_no);
            w.Append("update_time", update_time.ToString("yyyy-MM-dd HH:mm:ss"));
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/inout?t=delete_inout", w.ToString());

            ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(json);
            if (r.Read("errId") != "0")
            {
                throw new Exception(r.Read("errMsg"));
            }
        }
Exemplo n.º 10
0
        void IBLL.ICashOrder.Check(string sheet_no, string approve_man)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("sheet_no", sheet_no);
            w.Append("approve_man", approve_man);
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/cash_order?t=check", w.ToString());

            ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(json);
            if (r.Read("errId") != "0")
            {
                throw new Exception(r.Read("errMsg"));
            }
        }
Exemplo n.º 11
0
        Model.bi_t_sz_type IFinanceBLL.GetSZTypeItem(string pay_way)
        {
            try
            {
                Helper.IRequest req = new Helper.Request();

                var json = req.request("/finance?t=get_sz_item", "{\"pay_way\":\"" + pay_way + "\"}");
                ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json);
                if (read.Read("errId") != "0")
                {
                    throw new Exception(read.Read("errMsg"));
                }
                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");

                        return(item);
                    }
                }
                return(null);
            }
            catch (Exception ex)
            {
                Helper.LogHelper.writeLog("FinanceBLL.GetSZTypeItem()", ex.ToString(), null);
                throw ex;
            }
        }
Exemplo n.º 12
0
        string IBLL.ISupSettle.MaxCode()
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("none", "");
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/sup_settle?t=max_code", w.ToString());

            ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(json);
            if (r.Read("errId") != "0")
            {
                throw new Exception(r.Read("errMsg"));
            }
            else
            {
                return(r.Read("code"));
            }
        }
Exemplo n.º 13
0
        public string Read(string sys_var_id)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("sys_var_id", sys_var_id);
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/sys?t=read", w.ToString());

            ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(json);
            if (r.Read("errId") != "0")
            {
                throw new Exception(r.Read("errMsg"));
            }
            else
            {
                return(r.Read("value"));
            }
        }
Exemplo n.º 14
0
        void IBLL.ICheckBLL.AddCheckSheet(Model.ic_t_check_master ord, List <Model.ic_t_check_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("check_no", ord.check_no);
            w.Append("meno", ord.meno);
            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"));

            var tb = new DataTable();

            tb.Columns.Add("sheet_no");
            tb.Columns.Add("item_no");
            tb.Columns.Add("in_price", typeof(decimal));
            tb.Columns.Add("sale_price", typeof(decimal));
            tb.Columns.Add("stock_qty", typeof(decimal));
            tb.Columns.Add("real_qty", typeof(decimal));
            tb.Columns.Add("balance_qty", typeof(decimal));
            tb.Columns.Add("memo");
            tb.Columns.Add("other1");
            tb.Columns.Add("other2");
            tb.Columns.Add("num1", typeof(decimal));
            tb.Columns.Add("num2", typeof(decimal));
            tb.Columns.Add("num3", typeof(decimal));
            tb.Columns.Add("packqty", typeof(int));
            tb.Columns.Add("sgqty", typeof(decimal));
            foreach (Model.ic_t_check_detail line in lines)
            {
                tb.Rows.Add(line.sheet_no, line.item_no, line.in_price, line.sale_price, line.stock_qty, line.real_qty, line.balance_qty,
                            line.memo, line.other1, line.other2, line.num1, line.num2, line.num3, line.packqty, line.sgqty);
            }
            w.Append("lines", tb);
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/check?t=add_checksheet", 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");
        }
Exemplo n.º 15
0
 void IFinanceBLL.DeleteSZType(string pay_way)
 {
     try
     {
         Helper.IRequest req = new Helper.Request();
         ReadWriteContext.IWriteContext write = new ReadWriteContext.WriteContextByJson();
         write.Append("pay_way", pay_way);
         var json = req.request("/finance?t=delete_sz", write.ToString());
         ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json);
         if (read.Read("errId") != "0")
         {
             throw new Exception(read.Read("errMsg"));
         }
     }
     catch (Exception ex)
     {
         Helper.LogHelper.writeLog("FinanceBLL.DeleteSZType()", ex.ToString(), pay_way);
         throw ex;
     }
 }
Exemplo n.º 16
0
        decimal IPriceBLL.GetSupItemPrice(string sup_id, string item_no, string type)
        {
            try
            {
                Helper.IRequest req = new Helper.Request();

                var json = req.request("/price?t=get_sup_item_price", "{\"sup_id\":\"" + sup_id + "\",\"item_no\":\"" + item_no + "\",\"type\":\"" + type + "\"}");
                ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json);
                if (read.Read("errId") != "0")
                {
                    throw new Exception(read.Read("errMsg"));
                }

                return(Helper.Conv.ToDecimal(read.Read("price")));
            }
            catch (Exception ex)
            {
                Helper.LogHelper.writeLog("PriceBLL.GetSupItemPrice()", ex.ToString(), sup_id, item_no);
                throw ex;
            }
        }
Exemplo n.º 17
0
        decimal IPriceBLL.GetLastInPrice(string item_no)
        {
            try
            {
                Helper.IRequest req = new Helper.Request();

                var json = req.request("/price?t=get_last_in_price", "{\"item_no\":\"" + item_no + "\"}");
                ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json);
                if (read.Read("errId") != "0")
                {
                    throw new Exception(read.Read("errMsg"));
                }

                return(Helper.Conv.ToDecimal(read.Read("price")));
            }
            catch (Exception ex)
            {
                Helper.LogHelper.writeLog("PriceBLL.GetLastInPrice()", ex.ToString(), item_no);
                throw ex;
            }
        }
Exemplo n.º 18
0
        public System.Data.DataTable GetBranchList()
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("code_len", "4");
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/branch?t=get_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());
                }
                var tb = GetDataTable(r.ReadList("data"));
                return(tb);
            }
        }
Exemplo n.º 19
0
        DataTable IBLL.ICheckBLL.GetCheckInitList()
        {
            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/check?t=get_check_init_list", "");

            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);
            }
        }
Exemplo n.º 20
0
 void IFinanceBLL.UpdateSZType(Model.bi_t_sz_type item)
 {
     try
     {
         Helper.IRequest req = new Helper.Request();
         ReadWriteContext.IWriteContext write = new ReadWriteContext.WriteContextByJson();
         write.Append("pay_way", item.pay_way);
         write.Append("pay_name", item.pay_name);
         write.Append("pay_flag", item.pay_flag);
         write.Append("km_code", item.km_code);
         write.Append("pay_kind", item.pay_kind);
         write.Append("other1", item.other1);
         write.Append("other2", item.other2);
         write.Append("num1", item.num1.ToString());
         write.Append("num2", item.num2.ToString());
         write.Append("pay_memo", item.pay_memo);
         write.Append("if_acc", item.if_acc);
         write.Append("path", item.path);
         write.Append("is_account", item.is_account);
         write.Append("account_flag", item.account_flag);
         write.Append("is_pay", item.is_pay);
         write.Append("is_profit", item.is_profit);
         write.Append("profit_type", item.profit_type);
         write.Append("auto_cashsheet", item.auto_cashsheet);
         write.Append("if_CtFix", item.if_CtFix);
         var json = req.request("/finance?t=change_sz", write.ToString());
         ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json);
         if (read.Read("errId") != "0")
         {
             throw new Exception(read.Read("errMsg"));
         }
     }
     catch (Exception ex)
     {
         Helper.LogHelper.writeLog("FinanceBLL.UpdateSZType()", ex.ToString(), null);
         throw ex;
     }
 }
Exemplo n.º 21
0
        void IBLL.ICashOrder.GetOrder(string sheet_no, out System.Data.DataTable tb1)
        {
            ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
            w.Append("sheet_no", sheet_no);

            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/cash_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"));
            }
        }
Exemplo n.º 22
0
        void IBLL.IInOutBLL.GetOtherInOut(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_other_inout", 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"));
            }
        }
Exemplo n.º 23
0
        List <Model.bi_t_supcust_info> ICommonBLL.GetSupList(string keyword)
        {
            try
            {
                Helper.IRequest req = new Helper.Request();
                ReadWriteContext.IWriteContext write = new ReadWriteContext.WriteContextByJson();
                write.Append("page_index", "1");
                write.Append("page_size", "500");
                write.Append("region_no", "");
                write.Append("show_stop", "0");
                write.Append("keyword", keyword);

                var json = req.request("/sup?t=get_list", write.ToString());
                ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json);
                if (read.Read("errId") != "0")
                {
                    throw new Exception(read.Read("errMsg"));
                }
                List <Model.bi_t_supcust_info> lst = new List <Model.bi_t_supcust_info>();
                if (read.Read("data") != null)
                {
                    foreach (ReadWriteContext.IReadContext r in read.ReadList("data"))
                    {
                        Model.bi_t_supcust_info item = new Model.bi_t_supcust_info();
                        item.supcust_no = r.Read("supcust_no");
                        item.sup_name   = item.supcust_no + "/" + r.Read("sup_name");
                        lst.Add(item);
                    }
                }
                return(lst);
            }
            catch (Exception ex)
            {
                Helper.LogHelper.writeLog("CommonBLL.GetSupList()", ex.ToString(), null);
                throw ex;
            }
        }
Exemplo n.º 24
0
        void IBLL.ICashOrder.Add(Model.bank_t_cash_master ord, 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("visa_id", ord.visa_id);
            w.Append("visa_in", ord.visa_in);
            w.Append("pay_way", ord.pay_way);
            w.Append("coin_no", ord.coin_no);
            w.Append("coin_rate", ord.coin_rate.ToString());
            w.Append("deal_man", ord.deal_man);
            w.Append("oper_id", ord.oper_id);
            w.Append("oper_date", ord.oper_date.ToString("yyyy-MM-dd"));
            w.Append("bill_total", ord.bill_total.ToString());
            w.Append("bill_flag", ord.bill_flag);
            w.Append("cm_branch", ord.cm_branch);
            w.Append("approve_flag", "0");
            w.Append("approve_man", "");
            w.Append("approve_date", "");
            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());

            Helper.IRequest req  = new Helper.Request();
            var             json = req.request("/cash_order?t=add", 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");
        }
Exemplo n.º 25
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);
            }
        }
Exemplo n.º 26
0
        DataTable ICommonBLL.GetAllSupList()
        {
            try
            {
                Helper.IRequest req = new Helper.Request();
                ReadWriteContext.IWriteContext write = new ReadWriteContext.WriteContextByJson();
                write.Append("page_index", "1");
                write.Append("page_size", "10000");
                write.Append("region_no", "");
                write.Append("show_stop", "0");
                write.Append("keyword", "");

                var json = req.request("/sup?t=get_list", write.ToString());
                ReadWriteContext.IReadContext read = new ReadWriteContext.ReadContextByJson(json);
                if (read.Read("errId") != "0")
                {
                    throw new Exception(read.Read("errMsg"));
                }
                DataTable dt = new DataTable();
                dt.Columns.Add("supcust_no");
                dt.Columns.Add("sup_name");
                if (read.Read("data") != null)
                {
                    foreach (ReadWriteContext.IReadContext r in read.ReadList("data"))
                    {
                        dt.Rows.Add(r.Read("supcust_no"), r.Read("sup_name"));
                    }
                }
                return(dt);
            }
            catch (Exception ex)
            {
                Helper.LogHelper.writeLog("CommonBLL.GetAllSupList()", ex.ToString(), null);
                throw ex;
            }
        }
Exemplo n.º 27
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);
            }
        }
Exemplo n.º 28
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"));
            }
        }
Exemplo n.º 29
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;
            }
        }
Exemplo n.º 30
0
        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"));
            }
        }