Пример #1
0
        public ActionResult Create(Sale sale)
        {
            //System.Diagnostics.Debug.WriteLine("Hello World");
            //System.Diagnostics.Debug.WriteLine(sale.DueAmount);
            //System.Diagnostics.Debug.WriteLine(sale.Total);

            //System.Diagnostics.Debug.WriteLine("Hello World");

            if (ModelState.IsValid && sale.SalesDetails != null && sale.SalesDetails.Count > 0)
            {
                sale.IsDeleted = false;
                id             = _saleBll.Create(sale);
                if (id != null)
                {
                    return(RedirectToAction("Details", "Sales", new { id = id }));
                }
                else
                {
                    ViewBag.Message = "Sale added failed";
                }
            }
            ViewBag.ItemId     = _saleBll.GetItem();
            ViewBag.OutletId   = _saleBll.GetOutlet();
            ViewBag.EmployeeId = _saleBll.GetEmployee();
            return(View(sale));
        }
Пример #2
0
 public ActionResult Create(Sale sale)
 {
     if (ModelState.IsValid && sale.SalesDetails != null && sale.SalesDetails.Count > 0)
     {
         sale.IsDeleted = false;
         id             = saleBll.Create(sale);
         if (id != null)
         {
             return(RedirectToAction("Details", "Sales", new { id = id }));
         }
         else
         {
             ViewBag.Message = "Sale added failed";
         }
     }
     ViewBag.ItemId     = saleBll.GetItem();
     ViewBag.OutletId   = saleBll.GetOutlet();
     ViewBag.EmployeeId = saleBll.GetEmployee();
     return(View(sale));
 }