public int UpdateWebImg(WebImg WebImg) { using (AIYunNetContext context = new AIYunNetContext()) { WebImg originalImg = context.WebImg.Find(WebImg.ImgId); if (originalImg != null) { originalImg.ImgTitle = WebImg.ImgTitle; originalImg.ImgInfo = WebImg.ImgInfo; originalImg.ImgContent = WebImg.ImgContent; originalImg.thumbnailImage = WebImg.thumbnailImage; originalImg.ImgUrl = WebImg.ImgUrl; originalImg.softcoverstyle = WebImg.softcoverstyle; originalImg.hotalstyle = WebImg.hotalstyle; originalImg.designerrstyle = WebImg.designerrstyle; originalImg.commercialstyle = WebImg.commercialstyle; originalImg.IsPublish = WebImg.IsPublish; originalImg.IsTop = WebImg.IsTop; originalImg.editon = DateTime.Now; originalImg.ImgJzspce = WebImg.ImgJzspce; originalImg.ImgGzspace = WebImg.ImgGzspace; originalImg.ImgJzstyle = WebImg.ImgJzstyle; originalImg.DecType = WebImg.DecType; originalImg.CompanyID = 0; originalImg.PeopleID = 0; context.SaveChanges(); return(1); } else { return(0); } } }
public int AddWebImg(WebImg WebImg) { using (AIYunNetContext context = new AIYunNetContext()) { context.WebImg.Add(WebImg); context.SaveChanges(); return(1); } }
public void PageViewAdd(int WebImgID) { using (AIYunNetContext context = new AIYunNetContext()) { WebImg originalWebImg = context.WebImg.Find(WebImgID); if (originalWebImg != null) { originalWebImg.browsecount = originalWebImg.browsecount + 1; context.SaveChanges(); } } }
public ActionResult AddOrEditWebImg(WebImg WebImg) { int result = 0; if (WebImg != null && WebImg.ImgId > 0) { result = webImgService.UpdateWebImg(WebImg); } else { result = webImgService.AddWebImg(WebImg); } return(Json(new { RetCode = result }, JsonRequestBehavior.AllowGet)); }
public int DeleteWebImg(int WebImgID) { using (AIYunNetContext context = new AIYunNetContext()) { WebImg originalImg = context.WebImg.Find(WebImgID); if (originalImg != null) { originalImg.FlagDelete = 1; originalImg.deleteon = DateTime.Now; context.SaveChanges(); return(1); } else { return(0); } } }
public ActionResult AddOrEditWebImg(int ImgID) { WebImg webimg = webImgService.GetWebImgByID(ImgID); if (webimg == null) { webimg = new WebImg(); } List <WebLookup> Case_DecTypelist = webCommonService.GetLookupList("Case_DecType"); List <WebLookup> Case_stylelist = webCommonService.GetLookupList("Case_style"); List <WebLookup> Case_gz_stylelist = webCommonService.GetLookupList("Case_gz_style"); List <WebLookup> Case_Img_Jzspacelist = webCommonService.GetLookupList("Case_Img_Jzspace"); //List<WebLookup> housestylelist = webCommonService.GetLookupList("Img_housestyle"); IEnumerable <SelectListItem> Case_DecType = Case_DecTypelist.Select(com => new SelectListItem { Value = com.Code.ToString(), Text = com.Description }); IEnumerable <SelectListItem> Case_style = Case_stylelist.Select(com => new SelectListItem { Value = com.Code.ToString(), Text = com.Description }); IEnumerable <SelectListItem> Case_gz_style = Case_gz_stylelist.Select(com => new SelectListItem { Value = com.Code.ToString(), Text = com.Description }); IEnumerable <SelectListItem> Case_Img_Jzspace = Case_Img_Jzspacelist.Select(com => new SelectListItem { Value = com.Code.ToString(), Text = com.Description }); //IEnumerable<SelectListItem> housestyle = housestylelist.Select(com => new SelectListItem { Value = com.Code.ToString(), Text = com.Description }); ViewBag.Case_DecType = Case_DecType; ViewBag.Case_style = Case_style; ViewBag.Case_gz_style = Case_gz_style; ViewBag.Case_Img_Jzspace = Case_Img_Jzspace; //ViewBag.housestylelist = housestyle; return(View(webimg)); }
public ActionResult ImgDetail(int webImgID) { WebImg webImg = webImgService.GetWebImgByID(webImgID); return(View(webImg)); }