public ActionResult Step3() { ViewBag.ShopGrades = ServiceHelper.Create <IShopService>().GetShopGrades(); ViewBag.ShopCategories = ServiceHelper.Create <ICategoryService>().GetMainCategory(); ViewBag.Username = base.CurrentSellerManager.UserName; ShopInfo shop = ServiceHelper.Create <IShopService>().GetShop(base.CurrentSellerManager.ShopId, true); List <CategoryKeyVal> categoryKeyVals = new List <CategoryKeyVal>(); foreach (long key in shop.BusinessCategory.Keys) { CategoryKeyVal categoryKeyVal = new CategoryKeyVal() { CommisRate = shop.BusinessCategory[key], Name = ServiceHelper.Create <ICategoryService>().GetCategory(key).Name }; categoryKeyVals.Add(categoryKeyVal); } ShopProfileStep3 shopProfileStep3 = new ShopProfileStep3() { ShopName = shop.ShopName, ShopGrade = shop.GradeId, BusinessCategory = ServiceHelper.Create <IShopService>().GetBusinessCategory(base.CurrentSellerManager.ShopId).ToList() }; return(View(shopProfileStep3)); }
public JsonResult EditProfile3(string shopProfileStep3) { ShopProfileStep3 shopProfileStep31 = JsonConvert.DeserializeObject <ShopProfileStep3>(shopProfileStep3); if (ServiceHelper.Create <IShopService>().ExistShop(shopProfileStep31.ShopName, base.CurrentSellerManager.ShopId)) { string str = string.Format("{0} 供应商名称已经存在", shopProfileStep31.ShopName); return(Json(new { success = false, msg = str })); } ShopInfo shopInfo = new ShopInfo() { Id = base.CurrentSellerManager.ShopId, ShopName = shopProfileStep31.ShopName, GradeId = shopProfileStep31.ShopGrade, //Stage = new ShopInfo.ShopStage?(ShopInfo.ShopStage.UploadPayOrder) Stage = new ShopInfo.ShopStage?(ShopInfo.ShopStage.Finish), EndDate = DateTime.Now.AddDays(1000),//给结束时间赋值,定位是当前时间后的1000天 ShopStatus = ShopInfo.ShopAuditStatus.WaitConfirm }; ShopInfo shopInfo1 = shopInfo; IEnumerable <long> categories = shopProfileStep31.Categories; ServiceHelper.Create <IShopService>().UpdateShop(shopInfo1, categories); return(Json(new { success = true })); }
public JsonResult EditProfile3(string shopProfileStep3) { ShopProfileStep3 model = Newtonsoft.Json.JsonConvert.DeserializeObject <ShopProfileStep3>(shopProfileStep3); int result = ShopApplication.UpdateShop(model, CurrentSellerManager.ShopId); if (result.Equals(-1)) { var msg = string.Format("{0} 诊所名称已经存在", model.ShopName); return(Json(new { success = false, msg = msg })); } return(Json(new { success = true })); }
/// <summary> /// 诊所信息 /// </summary> /// <param name="ids">经营类目ID集</param> /// <returns></returns> public ActionResult Step5(string ids) { Cache.Remove(CacheKeyCollection.CACHE_SHOP(CurrentSellerManager.ShopId, true)); Cache.Remove(CacheKeyCollection.CACHE_SHOPDTO(CurrentSellerManager.ShopId, true)); var shop = ShopApplication.GetShop(CurrentSellerManager.ShopId, true); if (shop.Stage == ShopInfo.ShopStage.CompanyInfo) { return(RedirectToAction("step3")); } if (shop.Stage == ShopInfo.ShopStage.FinancialInfo) { return(RedirectToAction("step4")); } var step3 = new ShopProfileStep3(); step3.ShopName = shop.ShopName; step3.ShopGrade = shop.GradeId; var gradeInfo = ShopApplication.GetShopGrade(shop.GradeId); ViewBag.GradeName = gradeInfo != null ? gradeInfo.Name : "未选择";//获取等级名称 ViewBag.ShopBusinessCategory = "未选择"; ViewBag.BusinessCategoryIds = string.Empty; if (!string.IsNullOrWhiteSpace(ids)) { var idArr = ids.Split(','); if (idArr.Length > 0) { List <long> idList = idArr.Select(p => long.Parse(p)).ToList(); var categoriesList = _iCategoryService.GetCategories().Where(p => idList.Contains(p.Id)); if (categoriesList.Count() == idArr.Length) { string businessCategory = string.Join("、", categoriesList.Select(x => x.Name).ToArray()); ViewBag.ShopBusinessCategory = businessCategory.Length > 0 ? businessCategory : "未选择"; ViewBag.BusinessCategoryIds = ids; } } } else { var businessCategoryInfo = ShopApplication.GetBusinessCategory(CurrentSellerManager.ShopId); if (businessCategoryInfo != null && businessCategoryInfo.Count > 0) { List <long> categoryIds = businessCategoryInfo.Select(p => p.CategoryId).ToList(); ViewBag.BusinessCategoryIds = string.Join(",", categoryIds.ToArray()); string businessCategory = string.Join("、", _iCategoryService.GetCategories().Where(p => categoryIds.Contains(p.Id)).Select(x => x.Name).ToArray()); ViewBag.ShopBusinessCategory = businessCategory.Length > 0 ? businessCategory : "未选择"; } } return(View(step3)); }
public JsonResult EditProfile3(string shopProfileStep3) { ShopProfileStep3 shopProfileStep31 = JsonConvert.DeserializeObject <ShopProfileStep3>(shopProfileStep3); if (ServiceHelper.Create <IShopService>().ExistShop(shopProfileStep31.ShopName, base.CurrentSellerManager.ShopId)) { string str = string.Format("{0} 店铺名称已经存在", shopProfileStep31.ShopName); return(Json(new { success = false, msg = str })); } ShopInfo shopInfo = new ShopInfo() { Id = base.CurrentSellerManager.ShopId, ShopName = shopProfileStep31.ShopName, GradeId = shopProfileStep31.ShopGrade, Stage = new ShopInfo.ShopStage?(ShopInfo.ShopStage.UploadPayOrder) }; ShopInfo shopInfo1 = shopInfo; IEnumerable <long> categories = shopProfileStep31.Categories; ServiceHelper.Create <IShopService>().UpdateShop(shopInfo1, categories); return(Json(new { success = true })); }
/// <summary> /// 商家入驻店铺信息更新 /// </summary> /// <param name="model"></param> /// <param name="ShopId"></param> /// <returns>0、失败;1、成功;-1、店铺名称已经存在</returns> public static int UpdateShop(ShopProfileStep3 model, long ShopId) { int result = 0; if (Service.ExistShop(model.ShopName, ShopId)) { result = -1; } else { Entities.ShopInfo shopInfo = Service.GetShop(ShopId); shopInfo.Id = ShopId; shopInfo.ShopName = model.ShopName; shopInfo.GradeId = model.ShopGrade; shopInfo.Stage = Entities.ShopInfo.ShopStage.UploadPayOrder; var shopCategories = model.Categories; Service.UpdateShop(shopInfo, model.Categories.ToList()); ClearCacheShop(ShopId); result = 1; } return(result); }
public ActionResult Step3() { ViewBag.ShopGrades = ShopApplication.GetShopGrades(); ViewBag.ShopCategories = _iCategoryService.GetMainCategory(); ViewBag.Username = CurrentSellerManager.UserName; var shop = ShopApplication.GetShop(CurrentSellerManager.ShopId, true); if (shop.Stage == Entities.ShopInfo.ShopStage.CompanyInfo) { return(RedirectToAction("step1")); } if (shop.Stage == Entities.ShopInfo.ShopStage.FinancialInfo) { return(RedirectToAction("step2")); } var BusinessCategory = new List <CategoryKeyVal>(); foreach (var key in shop.BusinessCategory.Keys) { BusinessCategory.Add(new CategoryKeyVal { CommisRate = shop.BusinessCategory[key], Name = _iCategoryService.GetCategory(key).Name }); } var step3 = new ShopProfileStep3(); step3.ShopName = shop.ShopName; step3.ShopGrade = shop.GradeId; step3.BusinessType = shop.BusinessType == null ? Mall.CommonModel.ShopBusinessType.Enterprise : shop.BusinessType.Value; step3.BusinessCategory = ShopApplication.GetBusinessCategory(CurrentSellerManager.ShopId); return(View(step3)); }