示例#1
0
        public List <InvoiceEntity> Get_List_Invoice_By_CustomerID(string id)
        {
            List <InvoiceEntity> list = new List <InvoiceEntity>();

            if (dbContext == null)
            {
                dbContext = new FoodDeliveryEntities();
            }
            var listvar = dbContext.GET_LIST_INVOICE_BY_CUSTOMERID(id).ToList();

            foreach (var obj in listvar)
            {
                InvoiceEntity entity = new InvoiceEntity
                {
                    InvoiceID       = "" + obj.InvoiceID,
                    OrderDate       = "" + obj.OrderDate,
                    DeliveryDate    = "" + obj.DeliveryDate,
                    Sale            = (decimal)obj.Sale,
                    ServiceChange   = (decimal)obj.ServiceChange,
                    ShippingFee     = (decimal)obj.ShippingFee,
                    TotalPrice      = (decimal)obj.TotalPrice,
                    StoreID         = "" + obj.StoreID,
                    CustomerID      = "" + obj.CustomerID,
                    AddressDelivery = obj.AddressDelivery,
                    CustomerName    = obj.CustomerName,
                    CustomerPhone   = obj.CustomerPhone,
                    Status          = (int)obj.Status
                };
                list.Add(entity);
            }
            return(list);
        }