public ActionResult Update(OrderDetail model)
 {
     if (OrderDetailHelper.UpdateOderDatail(model))
     {
         return(Content("success"));
     }
     return(Content("failure"));
 }
 public ActionResult Delete(DeleteDetailViewModel model)
 {
     if (OrderDetailHelper.DeleteOrderDetail(model.MainID, model.SubID))
     {
         return(Content("success"));
     }
     return(Content("failure"));
 }
        public ActionResult Index(string searchString, int page = 1, int pageSize = 10)
        {
            ViewBag.Active = "#OrderDetails";
            IEnumerable <OrderDetail> models;

            if (String.IsNullOrEmpty(searchString))
            {
                models = OrderDetailHelper.GetOrderDetails();
            }
            else
            {
                models = OrderDetailHelper.GetOrderDetails(searchString);
            }
            ViewBag.SearchString = searchString;
            return(View(models.OrderByDescending(x => x.ProductID).ToPagedList(page, pageSize)));
        }
 public ActionResult Add(OrderDetail model)
 {
     if (ModelState.IsValid)
     {
         if (OrderDetailHelper.AddOrderDetail(model))
         {
             return(Content("success"));
         }
         else
         {
             ModelState.AddModelError("", "Existing product detail!");
             return(PartialView("Add"));
         }
     }
     else
     {
         return(PartialView("Add"));
     }
 }
        public static void Main()
        {
            CustomerHelper customerHelper = new CustomerHelper();
            //customerHelper.Insert("Sidra Abdullah", "*****@*****.**", "sid12345", "03082608409");
            //customerHelper.Insert("Sarmed Rizv", "*****@*****.**", "desh123", "03082608409");
            //customerHelper.Insert("Ayesha Zulfiqar", "*****@*****.**", "hang345", "03188608409");
            //customerHelper.Insert("Saba Abdullah", "*****@*****.**", "wigwam45", "03082908409");
            // customerHelper.Insert("Iqra Shafqat", "*****@*****.**", "sd12345@", "03152658409");

            ProductHelper productHelper = new ProductHelper();
            // productHelper.Insert("Makeup", 1200, 40, "J.", "Not Retrun and not repalceable");
            // productHelper.Insert("kurta", 2200, 20, "J.", "Repalceable");
            // productHelper.Insert("Trouser", 1000, 10, "J.", "Not Retrun and but Repalceable");
            // productHelper.Insert("Perfumes", 2500, 140, "J.", "Not Retrun and not repalceable");
            // productHelper.Insert("Body spray", 800, 140, "J.", "Not Retrun and not repalceable");
            // productHelper.Insert("Stove", 2200, 9, "Dawlance", "Not Retrun and not Repalceable with one Year wrantee");
            // productHelper.Insert("Sandwich Maker", 3000, 5, "Dawlance", "Not Retrun and not Repalceable with one Year wrantee");

            OrderDetailHelper orderDetailHelper = new OrderDetailHelper();

            orderDetailHelper.Insert("22dec,2020", 2400, 2, 3, 3);
            orderDetailHelper.Insert("23dec,2020", 5000, 2, 6, 4);
            orderDetailHelper.Insert("31dec,2020", 2200, 1, 4, 5);
        }
        public ActionResult UpdateTransfer(int?mainID, int?SubID)
        {
            OrderDetail model = OrderDetailHelper.GetOrderDetailByID((int)mainID, (int)SubID);

            return(PartialView("Update", model));
        }