public static ResultResponse UploadItem(PromotionItemFileViewModel entity) { ResultResponse result = new ResultResponse(); try { using (var db = new MarComContext()) { if (entity.Id == 0) { T_Promotion_Item_File it = new T_Promotion_Item_File(); it.Id = it.Id; it.Filename = it.Filename; it.Qty = it.Qty; it.Todo = it.Todo; it.Request_Due_Date = it.Request_Due_Date; it.Note = it.Note; it.Create_By = it.Create_By; it.Create_Date = DateTime.Now; db.T_Promotion_Item_File.Add(it); db.SaveChanges(); } } } catch (Exception) { throw; } return(result); }
public ActionResult AddItem() { //ViewBag.Promotion = new SelectList(PromotionRepo.Get(), "Id", "Name"); PromotionItemFileViewModel model = new PromotionItemFileViewModel(); return(PartialView("_AddItem", model)); }