public ActionResult AddProductDetails(ViewCreateProductDetailsModel model)
 {
     try
     {
         var user = (ViewUser)Session["user"];
         model.UpdatedByUserId = user.UserId;
         bool result = _iProductManager.SaveProductDetails(model);
         if (result)
         {
             TempData["Result"] = "Save Successfully!";
             ModelState.Clear();
         }
         else
         {
             TempData["Result"] = "Failed to  Save";
         }
         ViewBag.ProductId = new SelectList(_iProductManager.GetAllProducts(), "ProductId", "ProductName");
         return(View());
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw;
     }
 }
 public ActionResult AddProductDetails(ViewCreateProductDetailsModel model)
 {
     try
     {
         var user = (ViewUser)Session["user"];
         model.UpdatedByUserId = user.UserId;
         bool result = _iProductManager.SaveProductDetails(model);
         if (result)
         {
             TempData["Result"] = "Save Successfully!";
             ModelState.Clear();
         }
         else
         {
             TempData["Result"] = "Failed to  Save";
         }
         return(View());
     }
     catch (Exception e)
     {
         Log.WriteErrorLog(e);
         throw;
     }
 }
        public bool SaveProductDetails(ViewCreateProductDetailsModel model)
        {
            int rowAffected = _iProductGateway.SaveProductDetails(model);

            return(rowAffected > 0);
        }