public ActionResult ExtraAppEdit(NewsExtraApp model, HttpPostedFileBase logoFile) { var extraApp = dbContextService.Single <NewsExtraApp>(model.Id); extraApp.Name = model.Name; extraApp.PackageName = model.PackageName; extraApp.VersionCode = model.VersionCode; extraApp.ExtraType = model.ExtraType; extraApp.IsBrower = model.IsBrower; extraApp.ExtraLinkUrl = model.ExtraLinkUrl; extraApp.ExtraLogoUrl = model.ExtraLogoUrl; extraApp.Description = model.Description; extraApp.Status = model.Status; extraApp.CreateDateTime = DateTime.Now; var logoFilePath = GetNewsLogoFilePath <NewsExtraApp>(model, logoFile); if (!string.IsNullOrEmpty(logoFilePath)) { extraApp.ExtraLogoUrl = string.Format("{0}{1}", NEWS_LOGOS_IMAGE_PREFIX, Path.GetFileName(logoFilePath)); } var ret = dbContextService.Update <NewsExtraApp>(extraApp); NewsUIService.UpdateServerVersion <NewsExtraApp>(); return(RedirectToAction("ExtraAppList")); }
public ActionResult InfAddressDelete(int infAddressId) { var ret = dbContextService.Delete <NewsInfAddress>(infAddressId); NewsUIService.UpdateServerVersion <NewsInfAddress>(); return(RedirectToAction("InfAddressList")); }
public ActionResult ExtraRatioDelete(int extraRatioId) { var ret = dbContextService.Delete <NewsExtraRatio>(extraRatioId); NewsUIService.UpdateServerVersion <NewsExtraApp>(); return(RedirectToAction("ExtraRatioList")); }
public ActionResult SubCategoryDelete(int subcategoryId) { var ret = dbContextService.Delete <NewsSubCategory>(subcategoryId); NewsUIService.UpdateServerVersion <NewsSubCategory>(); return(RedirectToAction("SubCategoryList")); }
public ActionResult SourceDelete(int sourceId) { var ret = dbContextService.Delete <NewsSource>(sourceId); NewsUIService.UpdateServerVersion <NewsSource>(); return(RedirectToAction("SourceList")); }
public ActionResult CategoryEdit(NewsCategory model) { var category = dbContextService.Single <NewsCategory>(model.Id); category.Name = model.Name; category.Status = model.Status; category.CreateDateTime = DateTime.Now; var ret = dbContextService.Update <NewsCategory>(category); NewsUIService.UpdateServerVersion <NewsCategory>(); return(RedirectToAction("CategoryList")); }
public ActionResult InfAddressAdd(NewsInfAddress model) { var exist = dbContextService.Exists <NewsInfAddress>(x => x.InfAddress == model.InfAddress); if (exist) { TempData["errorMsg"] = "该接口地址已存在!"; return(View()); } var ret = dbContextService.Add <NewsInfAddress>(model); NewsUIService.UpdateServerVersion <NewsInfAddress>(); return(RedirectToAction("InfAddressList")); }
public ActionResult ExtraRatioEdit(NewsExtraRatio model) { var extraRatio = dbContextService.Single <NewsExtraRatio>(model.Id); extraRatio.ChannelId = model.ChannelId; extraRatio.Ratio = model.Ratio; extraRatio.Status = model.Status; extraRatio.CreateDateTime = DateTime.Now; var ret = dbContextService.Update <NewsExtraRatio>(extraRatio); NewsUIService.UpdateServerVersion <NewsExtraApp>(); return(RedirectToAction("ExtraRatioList")); }
public ActionResult SubCategoryAdd(NewsSubCategory model) { var exist = dbContextService.Exists <NewsSubCategory>(x => x.NameLowCase == model.NameLowCase); if (exist) { TempData["errorMsg"] = "该子分类已存在!"; return(View()); } var ret = dbContextService.Add <NewsSubCategory>(model); NewsUIService.UpdateServerVersion <NewsSubCategory>(); return(RedirectToAction("SubCategoryList")); }
public ActionResult SourceAdd(NewsSource model) { var exist = dbContextService.Exists <NewsSource>(x => x.Name == model.NameLowCase || x.PackageName == model.PackageName); if (exist) { TempData["errorMsg"] = "该提供商已存在!"; return(View()); } var ret = dbContextService.Add <NewsSource>(model); NewsUIService.UpdateServerVersion <NewsSource>(); return(RedirectToAction("SourceList")); }
public ActionResult ExtraRatioAdd(NewsExtraRatio model) { var exist = dbContextService.Exists <NewsExtraRatio>(x => x.ChannelId == model.ChannelId); if (exist) { TempData["errorMsg"] = "该渠道配置已存在!"; return(View()); } var ret = dbContextService.Add <NewsExtraRatio>(model); NewsUIService.UpdateServerVersion <NewsExtraApp>(); return(RedirectToAction("ExtraRatioList")); }
public ActionResult SourceEdit(NewsSource model) { var source = dbContextService.Single <NewsSource>(model.Id); source.Name = model.Name; source.NameLowCase = source.NameLowCase; source.PackageName = source.PackageName; source.Status = model.Status; source.CreateDateTime = DateTime.Now; var ret = dbContextService.Update <NewsSource>(source); NewsUIService.UpdateServerVersion <NewsSource>(); return(RedirectToAction("SourceList")); }
public ActionResult InfAddressEdit(NewsInfAddress model) { var infAddress = dbContextService.Single <NewsInfAddress>(model.Id); infAddress.Name = model.Name; infAddress.SourceId = model.SourceId; infAddress.CategoryId = model.CategoryId; infAddress.SubCategoryId = model.SubCategoryId; infAddress.IsStamp = model.IsStamp; infAddress.InfAddress = model.InfAddress; infAddress.Status = model.Status; infAddress.CreateDateTime = DateTime.Now; var ret = dbContextService.Update <NewsInfAddress>(infAddress); NewsUIService.UpdateServerVersion <NewsInfAddress>(); return(RedirectToAction("InfAddressList")); }
public ActionResult SubCategoryEdit(NewsSubCategory model) { var subcategory = dbContextService.Single <NewsSubCategory>(model.Id); subcategory.Name = model.Name; subcategory.NameLowCase = subcategory.NameLowCase; subcategory.SourceId = subcategory.SourceId; subcategory.CategoryId = subcategory.CategoryId; subcategory.Cursor = subcategory.Cursor; subcategory.Status = model.Status; subcategory.CreateDateTime = DateTime.Now; var ret = dbContextService.Update <NewsSubCategory>(subcategory); NewsUIService.UpdateServerVersion <NewsSubCategory>(); return(RedirectToAction("SubCategoryList")); }
public ActionResult ExtraAppAdd(NewsExtraApp model) { var exist = dbContextService.Exists <NewsExtraApp>(x => x.Name == model.Name); if (exist) { TempData["errorMsg"] = "该外推应用已存在!"; return(View()); } var logoFile = Request.Files[Request.Files.Keys[0]]; var logoFilePath = GetNewsLogoFilePath <NewsExtraApp>(model, logoFile); if (!string.IsNullOrEmpty(logoFilePath)) { model.ExtraLogoUrl = string.Format("{0}{1}", NEWS_LOGOS_IMAGE_PREFIX, Path.GetFileName(logoFilePath)); } var ret = dbContextService.Add <NewsExtraApp>(model); NewsUIService.UpdateServerVersion <NewsExtraApp>(); return(RedirectToAction("ExtraAppList")); }