예제 #1
0
        public List<StorageBilling> GetPayableBills(int paystatus, int invoicestatus, string begintime, string endtime, string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, string agentid, string clientid)
        {
            List<StorageBilling> list = new List<StorageBilling>();
            DataSet ds = FinanceDAL.BaseProvider.GetPayableBills(paystatus, invoicestatus, begintime, endtime, keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, userid, agentid, clientid);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                StorageBilling model = new StorageBilling();
                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;
        }
예제 #2
0
        public StorageBilling GetPayableBillByID(string billingid, string agentid, string clientid)
        {
            StorageBilling model = new StorageBilling();
            DataSet ds = FinanceDAL.BaseProvider.GetPayableBillByID(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.StorageBillingPays = new List<StorageBillingPay>();
                foreach (DataRow dr in ds.Tables["Pays"].Rows)
                {
                    StorageBillingPay pay = new StorageBillingPay();
                    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.StorageBillingPays.Add(pay);
                }

                model.StorageBillingInvoices = new List<StorageBillingInvoice>();
                foreach (DataRow dr in ds.Tables["Invoices"].Rows)
                {
                    StorageBillingInvoice invoice = new StorageBillingInvoice();
                    invoice.FillData(dr);
                    invoice.CreateUser = OrganizationBusiness.GetUserByUserID(invoice.CreateUserID, invoice.AgentID);
                    model.StorageBillingInvoices.Add(invoice);
                }
            }
            return model;
        }