Ejemplo n.º 1
0
        public Billing GetOrderBillByID(string billingid, string agentid, string clientid)
        {
            Billing model = new Billing();
            DataSet ds = FinanceDAL.BaseProvider.GetOrderBillByID(billingid, agentid, clientid);
            if (ds.Tables["Billing"].Rows.Count > 0)
            {
                model.FillData(ds.Tables["Billing"].Rows[0]);

                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID);

                model.PayStatusStr = model.PayStatus == 0 ? "未收款"
                                : model.PayStatus == 1 ? "部分收款"
                                : model.PayStatus == 2 ? "已收款"
                                : model.PayStatus == 9 ? "已删除"
                                : "";

                model.InvoiceStatusStr = model.InvoiceStatus == 0 ? "未开票"
                                : model.InvoiceStatus == 1 ? "已申请"
                                : model.InvoiceStatus == 2 ? "已开票"
                                : model.InvoiceStatus == 9 ? "已删除"
                                : "";

                model.BillingPays = new List<BillingPay>();
                foreach (DataRow dr in ds.Tables["Pays"].Rows)
                {
                    BillingPay pay = new BillingPay();
                    pay.FillData(dr);

                    switch (pay.PayType)
                    {
                        case 1:
                            pay.PayTypeStr = "现金支付";
                            break;
                        case 2:
                            pay.PayTypeStr = "在线支付";
                            break;
                        case 3:
                            pay.PayTypeStr = "支付宝";
                            break;
                        case 4:
                            pay.PayTypeStr = "微信";
                            break;
                        case 5:
                            pay.PayTypeStr = "线下汇款";
                            break;

                    }
                    pay.CreateUser = OrganizationBusiness.GetUserByUserID(pay.CreateUserID, pay.AgentID);
                    model.BillingPays.Add(pay);
                }

                model.BillingInvoices = new List<BillingInvoice>();
                foreach (DataRow dr in ds.Tables["Invoices"].Rows)
                {
                    BillingInvoice invoice = new BillingInvoice();
                    invoice.FillData(dr);

                    invoice.StatusStr = invoice.Status == 0 ? "已申请"
                                : invoice.Status == 1 ? "已申请"
                                : invoice.Status == 9 ? "已删除"
                                : "";

                    invoice.CreateUser = OrganizationBusiness.GetUserByUserID(invoice.CreateUserID, invoice.AgentID);
                    model.BillingInvoices.Add(invoice);
                }
            }
            return model;
        }
Ejemplo n.º 2
0
        public List<Billing> GetOrderBills(int paystatus, int invoicestatus, int returnstatus, string begintime, string endtime, string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, string agentid, string clientid)
        {
            List<Billing> list = new List<Billing>();
            DataSet ds = FinanceDAL.BaseProvider.GetOrderBills(paystatus, invoicestatus, returnstatus, begintime, endtime, keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, userid, agentid, clientid);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                Billing model = new Billing();
                model.FillData(dr);

                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID);

                model.PayStatusStr = model.PayStatus == 0 ? "未收款"
                                : model.PayStatus == 1 ? "部分收款"
                                : model.PayStatus == 2 ? "已收款"
                                : model.PayStatus == 9 ? "已删除"
                                : "";

                model.InvoiceStatusStr = model.InvoiceStatus == 0 ? "未开票"
                                : model.InvoiceStatus == 1 ? "已申请"
                                : model.InvoiceStatus == 2 ? "已开票"
                                : model.InvoiceStatus == 9 ? "已删除"
                                : "";

                list.Add(model);
            }
            return list;
        }