public ActionResult LienHe(FormCollection collection) { ViewData["accountID"] = QLSHOPRes.GetAccountByShop(int.Parse(collection["shopID"])); ViewData["shopID"] = collection["shopID"]; ViewData["Action"] = "LienHe"; var model = new LienHeChuShop(); var model1 = SKRes.FindAllSuKienCuaShop(int.Parse(collection["shopID"])); ViewData["ListSuKien"] = this.RenderPartialViewToString("ListSuKien", model1); try { if (TryUpdateModel(model)) { LHCShop.Add(model); LHCShop.Save(); ViewData["Message"] = "Cám ơn bạn đã gởi cho tôi."; model = new LienHeChuShop(); return View(model); } else { return View(model); } } catch { return View(model); } }
public ActionResult LienHe(int? id) { ViewData["accountID"] = QLSHOPRes.GetAccountByShop(id); ViewData["shopID"] = id; ViewData["Action"] = "LienHe"; var model = new LienHeChuShop(); var model1 = SKRes.FindAllSuKienCuaShop(id); ViewData["ListSuKien"] = this.RenderPartialViewToString("ListSuKien", model1); return View(model); }
public void Add(LienHeChuShop dm) { en.AddObject("LienHeChuShop", dm); }
public void Delete(LienHeChuShop dm) { en.DeleteObject(dm); }
public ActionResult LienHe(FormCollection collection) { try { var lhChuShop = new LienHeChuShop(); if (TryUpdateModel(lhChuShop)) { LHCShop.Add(lhChuShop); LHCShop.Save(); return RedirectToAction("Index"); } else { return View(); } } catch { return View(); } }