Example #1
0
 public ActionResult Quantities(int id)
 {
     return(Json(new
     {
         html = RenderPartialViewToString("Quantities", ProductQuantity.Find(UserID, Employee.ID, id))
     }, JsonRequestBehavior.AllowGet));
 }
Example #2
0
 public ActionResult RemoveQuantity(int id, int subID)
 {
     if (subID > 0)
     {
         ProductQuantity.Remove(UserID, Employee.ID, new ProductQuantity[] { new ProductQuantity(subID, id) });
     }
     else
     {
         var quantities = SessionValue <List <ProductQuantity> >(SessionKey.Quantity);
         if (quantities != null)
         {
             quantities.Remove(quantities.FirstOrDefault(q => q.ProductID == subID && q.WarehouseID == id));
         }
         Session[SessionKey.Quantity] = quantities;
     }
     return(Json(new
     {
         result = true,
         remove = true
     }, JsonRequestBehavior.AllowGet));
 }
Example #3
0
 public ActionResult SaveQuantity(int id, int subID, int value)
 {
     if (subID > 0)
     {
         ProductQuantity.Save(UserID, Employee.ID, new ProductQuantity[] { new ProductQuantity(subID, id, value) });
     }
     else
     {
         var quantities = SessionValue <List <ProductQuantity> >(SessionKey.Quantity);
         if (quantities == null)
         {
             quantities = new List <ProductQuantity>();
         }
         quantities.Add(new ProductQuantity(subID, id, value));
         Session[SessionKey.Quantity] = quantities;
     }
     return(Json(new
     {
         result = true,
         html = RenderPartialViewToString("Quantity", new ProductQuantity(subID, id, value))
     }, JsonRequestBehavior.AllowGet));
 }