public ActionResult ConfirmOrderForm(FormCollection fc)
        {
            if (fc["btnGenerateBill"] == "Generate Bill")
            {
                int   cid            = int.Parse(fc["txtCustomer"]);
                float total          = float.Parse(fc["txtTotal"]);
                float shippingcharge = float.Parse(fc["txtShippingCharge"]);
                float grandtotal     = float.Parse(fc["txtGrandTotal"]);

                Bill bill = new Bill()
                {
                    CustomerID     = cid,
                    ShippingCharge = shippingcharge,
                    //BillDate = Convert.ToDateTime(date),
                    GrandTotal = grandtotal
                };
                string bid    = Oc.SetBill(bill, BillDetailList);
                var    result = Oc.GetBillListbyBillId(int.Parse(bid));
                foreach (var data in result)
                {
                    BillClass bc = new BillClass();

                    bc.BillId     = data.BillID;
                    bc.CustomerId = int.Parse(data.CustomerID.ToString());
                    foreach (var data1 in Cc.GetCustomerListByCustomerId(int.Parse(data.CustomerID.ToString())))
                    {
                        bc.CustomerName = data1.Name;
                        bc.Address      = data1.Address;
                        bc.Country      = data1.City.State.Country.Country1;
                        bc.State        = data1.City.State.State1;
                        bc.City         = data1.City.City1;
                    }
                    bc.ShippingCharge = float.Parse(data.ShippingCharge.ToString());
                    bc.GrandTotal     = float.Parse(data.GrandTotal.ToString());
                    bc.Status         = data.IsCanceled.ToString();
                    BillClassList.Add(bc);
                }
            }
            return(RedirectToAction("InvoiceForm"));
        }
Exemple #2
0
        public ActionResult EditCustomer(int customerId)
        {
            var result = Cc.GetCustomerListByCustomerId(customerId);

            foreach (var data in result)
            {
                EditCustomerClass edc = new EditCustomerClass()
                {
                    CustomerId = data.CustomerID,
                    Name       = data.Name,
                    Address    = data.Address,
                    CityId     = data.City.CityID,
                    City       = data.City.City1,
                    State      = data.City.State.State1,
                    StateId    = data.City.State.StateID,
                    Country    = data.City.State.Country.Country1,
                    CountryId  = data.City.State.Country.CountryID,
                    Status     = bool.Parse(data.IsActive.ToString())
                };
                EditCustomerList.Add(edc);
            }
            return(RedirectToAction("CustomerForm"));
        }