示例#1
0
 public ActionResult Terminal(TerminalVM model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var  terminal = Mapper.Map <Sell>(model);
             bool isSaved  = _sellManager.Save(terminal);
             if (isSaved)
             {
                 return(RedirectToAction("Payment"));
             }
         }
     }
     catch (Exception exception)
     {
         ModelState.AddModelError("", exception.Message);
         model.ItemCategories = _itemCategoryManager.GetAll();
         model.Items          = _itemManager.GetAll();
         return(View(model));
     }
     model.ItemCategories = _itemCategoryManager.GetAll();
     model.Items          = _itemManager.GetAll();
     return(View(model));
 }
示例#2
0
        public JsonResult SaveOrder(Sell aSell)
        {
            string status = null;

            Global.Id = aSell.BillNo;
            string message = aSellManager.Save(aSell);

            if (message == "Yes")
            {
                status = message;
                ModelState.Clear();
            }
            else if (message == "Exists")
            {
                status = message;
            }
            else
            {
                status = message;
            }
            return(new JsonResult {
                Data = new { status = status }
            });
        }