Ejemplo n.º 1
0
        public List <BillingPay> GetOrderPays(string orderid)
        {
            List <BillingPay> list = new List <BillingPay>();
            DataTable         dt   = FinanceDAL.BaseProvider.GetOrderPays(orderid);

            foreach (DataRow dr in dt.Rows)
            {
                BillingPay model = new BillingPay();
                model.FillData(dr);
                model.PayTypeStr = CommonBusiness.GetEnumDesc <EnumOrderPayType>((EnumOrderPayType)model.PayType);
                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.ClientID);
                list.Add(model);
            }

            return(list);
        }
Ejemplo n.º 2
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);
        }