public JsonResult BannerTypeDel(int? id) { BannerType bannertype = new BannerType(); int bId = id ?? 0; using (club = new ClubEntities()) { bannertype = club.BannerTypes.Where(b => b.Id == bId).FirstOrDefault(); if (bannertype == null) Redirect("#/error/notfound"); club.BannerTypes.Remove(bannertype); if (club.SaveChanges() >= 0) { hitStr = "广告分类删除成功!"; status = Status.success; } else { hitStr = "广告分类删除失败!"; } } return Json(new { status = status.ToString(), content = HtmlCommon.GetHitStr("删除成功!", status) }); }
public ActionResult BannerTypeEdit(int? id,string name,string size,string variables) { tId = id ?? 0; BannerType bannerType = new BannerType(); using (club = new ClubEntities()) { bannerType = club.BannerTypes.Where(b => b.Id == tId).FirstOrDefault(); if (bannerType == null) { return RedirectToAction("notfound", "error"); } else { bannerType.Name = name; bannerType.Size = size; bannerType.Variables = variables; } if (club.SaveChanges() >= 0) { hitStr = "广告分类更新成功!"; status = Status.success; } else { hitStr = "系统异常,请稍后重试!"; } } ViewBag.StatusStr = Common.HtmlCommon.GetHitStr(hitStr, status); return View("~/areas/bwum/views/banner/typeedit.cshtml", bannerType); }
public ActionResult BannerTypeCreate(string name, string size, string variables) { BannerType bannerType = new BannerType() { Name = name, Size = size, Variables = variables, VarDate = DateTime.Now }; if (string.IsNullOrEmpty(name)) { hitStr = "分类的名称不能为空!"; } else { //BannerType bannerType = new BannerType() { Name=name,Size=size,Variables=variables,VarDate=DateTime.Now}; using (club = new ClubEntities()) { club.BannerTypes.Add(bannerType); if (club.SaveChanges() >= 0) { status = Status.success; hitStr = "分类名称创建成功!"; } else { hitStr = "系统异常,请稍后重试!"; } } } ViewBag.StatusStr = Common.HtmlCommon.GetHitStr(hitStr, status); return View("~/areas/bwum/views/banner/typeedit.cshtml", bannerType); }
public ActionResult BannerTypeShow(int? id) { tId = id ?? 0; BannerType bannerType=new BannerType(); using (club = new ClubEntities()) { bannerType = club.BannerTypes.Where(b => b.Id == tId).FirstOrDefault(); if (bannerType == null) { return RedirectToAction("notfound","error"); } } return View("~/areas/bwum/views/banner/typeedit.cshtml",bannerType); }
public ActionResult BannerTypeCreate() { BannerType bannertype = new BannerType(); return View("~/areas/bwum/views/banner/typeedit.cshtml", bannertype); }