public ActionResult Medium(int? id) { Medium dal = new Medium(); Ba_Medium model = dal.GetSinglemediumById(id.HasValue ? (int)id : 1); return View(model); }
// // GET: /SuperAdmin/MediumList/ public ActionResult Index() { ViewBag.jsInit = Public.SuperAdminCommon.JSInit("MediumManage", "MediumList"); Medium dal = new Medium(); IList<Ba_Medium> medium = dal.Getmedium(); return View(medium); }
public string Delete(int id) { string result = "0"; Medium dal = new Medium(); var model = dal.GetSinglemediumById(id); if (model != null) { model.Ns_State = false; dal.Update(model); result = "1"; } return result; }
// // GET: /SuperAdmin/MediumOperate/ public ActionResult Index(int? id) { ViewBag.jsInit = Public.SuperAdminCommon.JSInit("MediumManage", "MediumOperate"); var model = new Ba_Medium(); if (id != null) { Medium dal = new Medium(); model = dal.GetSinglemediumById((int)id); } if (model == null) model = new Ba_Medium(); ViewBag.model = model; if (model.Ns_ID.Equals(0)) ViewBag.Title = "新增媒體報道"; else ViewBag.Title = "更新媒體報道"; return View(); }
public string Submit(MediumOperate_Form form) { string result = string.Empty; Medium dal = new Medium(); var model = dal.GetSinglemediumById(form.medium_id); if (model == null) model = new Ba_Medium(); model.Ns_Title = form.medium_title; model.Ns_SubTitle = form.medium_subtitle; model.Ns_Content = form.medium_description; model.Ns_BuildTime = DateTime.Now; model.Ns_State = true; try { dal.SaveOrUpdate(model); result = "1"; } catch (System.Exception ex) { result = ex.ToString(); } return result; }