예제 #1
0
 public ActionResult Create(FormCollection collection, HttpPostedFileBase Parvandeh)
 {
     try
     {
         var _Bytes = new byte[Parvandeh.ContentLength];
         Parvandeh.InputStream.Read(_Bytes, 0, Parvandeh.ContentLength);
         dc.Product_Insert(collection["Name"], _Bytes, collection["Abstract"], collection["Description"], Convert.ToInt32(collection["SubGroup"]));
         return(RedirectToAction("Index"));
     }
     catch (Exception e)
     {
         ViewBag.Message = "خطا در تعریف محصول جدید";
         if (Request.IsAjaxRequest())
         {
             return(PartialView());
         }
         return(View());
     }
 }