public ActionResult UpdateCate(HtmlPageCategory model) { if (ModelState.IsValid) { var obj = ServiceFactory.HtmlPageCategoryManager.Get(new HtmlPageCategory { HtmlPageCategoryId = model.HtmlPageCategoryId }); if (obj != null) { try { model.HtmlPageCategoryShortName = model.HtmlPageCategoryTitle.ToUrlSegment(250).ToLower(); ServiceFactory.HtmlPageCategoryManager.Update(model, obj); return(RedirectToAction("SearchCategory", "HtmlPage")); } catch (Exception ex) { //throw; } } } var categories = ServiceFactory.HtmlPageCategoryManager.GetAllHtmlPageCategory(Culture); ViewBag.Categories = new SelectList(categories, "HtmlPageCategoryId", "HlevelTitle"); ViewBag.IsEdit = true; return(View(model)); }
public ActionResult CreateCate() { HtmlPageCategory data = new HtmlPageCategory(); var categories = ServiceFactory.HtmlPageCategoryManager.GetAllHtmlPageCategory(Culture); ViewBag.Categories = new SelectList(categories, "HtmlPageCategoryId", "HlevelTitle"); return(View("UpdateCate", data)); }
public void Remove(HtmlPageCategory item) { //var comm = this.GetCommand("sp_HtmlPage_Delete"); //if (comm == null) return; //comm.AddParameter<int>(this.Factory, "HtmlPageId", item.HtmlPageId); //comm.SafeExecuteNonQuery(); throw new NotImplementedException(); }
public ActionResult Services(string shortname) { var obj = ServiceFactory.HtmlPageCategoryManager.GetAllActiveByShortName(shortname, Culture); HtmlPageCategory htmlpage = new HtmlPageCategory(); if (obj.Count > 0) { return(RedirectToAction("ServicesSub", new { HtmlPageCateId = obj[0].HtmlPageCategoryId, shortname = obj[0].HtmlPageCategoryShortName, htmlpageid = 1 })); } else { return(View()); } }
public HtmlPageCategory Get(HtmlPageCategory dummy) { var comm = this.GetCommand("sp_HtmlPageCategoryGet"); if (comm == null) { return(null); } comm.AddParameter <int>(this.Factory, "HtmlPageCategoryId", dummy.HtmlPageCategoryId); var dt = this.GetTable(comm); var htmlPageCate = EntityBase.ParseListFromTable <HtmlPageCategory>(dt).FirstOrDefault(); return(htmlPageCate ?? null); //throw new NotImplementedException(); }
public void Add(HtmlPageCategory item) { //var comm = this.GetCommand("sp_HtmlPage_Insert"); //if (comm == null) return; //comm.AddParameter<string>(this.Factory, "HtmlPageTitle", item.HtmlPageTitle); //comm.AddParameter<string>(this.Factory, "HtmlPageShortName", item.HtmlPageShortName); //comm.AddParameter<string>(this.Factory, "HtmlPageSummary", item.HtmlPageSummary); //comm.AddParameter<string>(this.Factory, "HtmlPageDescription", item.HtmlPageDescription); //comm.AddParameter<string>(this.Factory, "HtmlPageKeyword", item.HtmlPageKeyword); //comm.AddParameter<string>(this.Factory, "HtmlPageBody", item.HtmlPageBody); //comm.AddParameter<int>(this.Factory, "OrderNo", item.OrderNo); //comm.AddParameter<bool>(this.Factory, "IsActive", item.IsActive); //comm.AddParameter<string>(this.Factory, "HtmlPageImage", item.HtmlPageImage); //comm.AddParameter<string>(this.Factory, "CreateBy", item.CreateBy); //comm.AddParameter<string>(this.Factory, "Culture", Culture); //comm.SafeExecuteNonQuery(); throw new NotImplementedException(); }
public void Add(HtmlPageCategory item, string Culture) { var comm = this.GetCommand("sp_HtmlPageCategory_Insert"); if (comm == null) { return; } comm.AddParameter <string>(this.Factory, "HtmlPageCategoryTitle", item.HtmlPageCategoryTitle); comm.AddParameter <int>(this.Factory, "ParentId", item.ParentId); comm.AddParameter <string>(this.Factory, "HtmlPageCategoryShortName", item.HtmlPageCategoryShortName); comm.AddParameter <string>(this.Factory, "HtmlPageCategoryDescription", item.HtmlPageCategoryDescription); comm.AddParameter <string>(this.Factory, "HtmlPageCategoryKeyword", item.HtmlPageCategoryKeyword); comm.AddParameter <int>(this.Factory, "OrderNo", item.OrderNo); comm.AddParameter <bool>(this.Factory, "IsActive", item.IsActive); comm.AddParameter <string>(this.Factory, "CreateBy", item.CreateBy); comm.AddParameter <string>(this.Factory, "Culture", Culture); comm.SafeExecuteNonQuery(); //throw new NotImplementedException(); }
public ActionResult CreateCate(HtmlPageCategory model) { if (ModelState.IsValid) { try { model.HtmlPageCategoryShortName = model.HtmlPageCategoryTitle.ToUrlSegment(250).ToLower(); model.CreateBy = CurrentUser.Name; ServiceFactory.HtmlPageCategoryManager.Add(model, Culture); return(RedirectToAction("SearchCategory", "HtmlPage")); } catch (Exception) { //throw; } } var categories = ServiceFactory.HtmlPageCategoryManager.GetAllHtmlPageCategory(Culture); ViewBag.Categories = new SelectList(categories, "HtmlPageCategoryId", "HlevelTitle"); return(View("UpdateCate", model)); }
public void Update(HtmlPageCategory @new, HtmlPageCategory old) { var item = @new; item.HtmlPageCategoryId = old.HtmlPageCategoryId; var comm = this.GetCommand("sp_HtmlPageCategory_Update"); if (comm == null) { return; } comm.AddParameter <int>(this.Factory, "HtmlPageCategoryId", item.HtmlPageCategoryId); comm.AddParameter <string>(this.Factory, "HtmlPageCategoryTitle", item.HtmlPageCategoryTitle); comm.AddParameter <int>(this.Factory, "ParentId", item.ParentId); comm.AddParameter <string>(this.Factory, "HtmlPageCategoryDescription", item.HtmlPageCategoryDescription); comm.AddParameter <string>(this.Factory, "HtmlPageCategoryKeyword", item.HtmlPageCategoryKeyword); comm.AddParameter <string>(this.Factory, "HtmlPageCategoryShortName", item.HtmlPageCategoryShortName); comm.AddParameter <int>(this.Factory, "OrderNo", item.OrderNo); comm.AddParameter <bool>(this.Factory, "IsActive", item.IsActive); //comm.AddParameter<DateTime>(this.Factory, "CreateDate", item.CreateDate); //comm.AddParameter<DateTime>(this.Factory, "EditDate", item.EditDate); comm.SafeExecuteNonQuery(); //throw new NotImplementedException(); }