public ActionResult Region(int num, int id = 0) { ViewBag.ProvinceList = MeiRongAcitivityConfigManager.GetRegion(0); ViewBag.Num = num; ViewBag.UrlId = id; if (id == 0) { return(View(new List <ActivityPageRegionConfig>())); } else { return(View(RegionActivityPageConfigManager.GetRegionRelationGroup(id))); } }
public JsonResult SaveBeautyBannerConfig(BeautyHomePageConfig model) { var result = false; string msg = string.Empty; try { var log = new BeautyOprLog { LogType = "SaveBeautyBannerConfig", IdentityID = $"{model.Id}", OldValue = null, NewValue = JsonConvert.SerializeObject(model), OperateUser = User.Identity.Name, Remarks = $"新增美容首页Banner配置", }; if (model.Id > 0) { var oldModel = BeautyHomePageConfigManager.GetBeautyHomePageConfigById(model.Id) ?? new BeautyHomePageConfig(); oldModel.Region = JsonConvert.SerializeObject(MeiRongAcitivityConfigManager.GetRegion(model.Id, 3)); log.OldValue = JsonConvert.SerializeObject(oldModel); log.Remarks = $"更新美容首页Banner配置"; result = BeautyHomePageConfigManager.UpdateBeautyHomePageBannerConfig(model); } else { int outId = 0; result = BeautyHomePageConfigManager.InsertBeautyHomePageBannerConfig(model, ref outId); log.IdentityID = outId.ToString(); } if (result) { LoggerManager.InsertLog("BeautyOprLog", log); UpdateBeautyBannerCache(model.Channel); } } catch (Exception ex) { msg = ex.Message; } return(Json(new { Result = result, Msg = msg })); }
public JsonResult GetBeautyBannerConfig() { var model = BeautyHomePageConfigManager.GetBeautyHomePageConfigById(BannerId) ?? new BeautyHomePageConfig(); model.RegionList = MeiRongAcitivityConfigManager.GetRegion(model.Id, 3); var regionresult = model.RegionList?.GroupBy(g => g.ProvinceName).Select(f => new { ProvinceName = f.Key, checkallgroup = f.ToArray().Select(s => s.CityName), }); var activitylist = MeiRongAcitivityConfigManager.GetMeiRongAcitivityConfigList(); return(Json(new { result = model, activity = activitylist, regionList = regionresult })); }
public ActionResult Export(MDBeautyApplyConfig model) { using (var stream = new MemoryStream(System.IO.File.ReadAllBytes(Server.MapPath(@"~/Content/Export/门店美容活动退出审核列表.xlsx")))) { int count = 0; var list = MDBeautyApplyConfigManager.GetMDBeautyApplyConfigList(model, int.MaxValue, 1, "Exit", out count); var xssfWorkbook = new XSSFWorkbook(stream); //创建Workbook对象 2007+ // var hssfWorkbook = new HSSFWorkbook(stream)://2003 if (list.Count > 0) { var i = 0; var sheet = xssfWorkbook.GetSheetAt(0); foreach (var item in list) { MeiRongAcitivityConfigManager manager = new MeiRongAcitivityConfigManager(); model.RegionList = manager.GetRegionRelation(item.Id, 1); string region = string.Empty; if (model.RegionList != null && model.RegionList.Count > 0) { foreach (var regionItem in model.RegionList) { region += regionItem.ProvinceName + ":" + regionItem.CityName + ";"; } } string apply = string.Empty; switch (item.ApplyAuditStatus) { case 1: apply = "待审核"; break; case 2: apply = "不通过"; break; case 3: apply = "通过"; break; default: break; } string exit = string.Empty; switch (item.ExitAuditStatus) { case 1: exit = "待审核"; break; case 2: exit = "不通过"; break; case 3: exit = "通过"; break; default: break; } var row = sheet.CreateRow((i++) + 1); row.CreateCell(0).SetCellValue(item.BeautyAcitivityId); row.CreateCell(1).SetCellValue(item.Name); row.CreateCell(2).SetCellValue(region); row.CreateCell(3).SetCellValue(item.CategoryName); row.CreateCell(4).SetCellValue(item.MinShopQuantity); row.CreateCell(5).SetCellValue(item.SignUpStartTime?.ToString() + "—" + item.SignUpEndTime?.ToString()); row.CreateCell(6).SetCellValue(item.PlanStartTime?.ToString() + "—" + item.ActivityEndTime?.ToString()); row.CreateCell(7).SetCellValue(item.MinPrice + "—" + item.MaxPrice); row.CreateCell(8).SetCellValue(item.Status == 1 ? "启用" : "禁用"); row.CreateCell(9).SetCellValue(item.ShopId); row.CreateCell(10).SetCellValue(item.ShopName); row.CreateCell(11).SetCellValue(item.ProductId); row.CreateCell(12).SetCellValue(item.ProductName); row.CreateCell(13).SetCellValue(apply); row.CreateCell(13).SetCellValue(exit); } Response.AppendHeader("Content-Disposition", "attachment;fileName=门店美容活动退出审核列表" + ".xlsx"); xssfWorkbook.Write(Response.OutputStream); Response.End(); } } return(Json(true, JsonRequestBehavior.AllowGet)); }