public ActionResult OpenShop_add3(int Id = 0) { OpenShopViewModel openshop = new OpenShopViewModel(); openshop.Id = Id; return(View(openshop)); }
public ActionResult OpenShop_add3UPdate(OpenShopViewModel openshop) { DataAccess.OpenShop moudel = this._iOpenShopService.GetById(openshop.Id); moudel.Id = openshop.Id; moudel.BLS = openshop.BLS; moudel.CIC = openshop.CIC; this._iOpenShopService.Update(moudel); return(RedirectToAction("OpenShop_add4")); }
/// <summary> /// 开店首页 /// </summary> /// <returns></returns> public ActionResult OpenShop() { OpenShopViewModel model = new OpenShopViewModel { Shop = null, ErrorList = new List <string>() }; //判断店铺开张情况 if (CurrentUser.Shop != null) { model.Shop = CurrentUser.Shop; //判断资质情况 //ShopPermit shopPermit = ShopContract.ShopPermits.FirstOrDefault(sp => sp.Shop.Id == model.Shop.Id); Hmh.Core.Shop.Models.ShopPermit shopPermit = CurrentUser.Shop.ShopPermit; if (shopPermit == null) { model.ErrorList.Add("未上传认证资料"); } else { if (shopPermit.State == ShopPermitState.Verifying) { model.ErrorList.Add("您的店铺正在审核中"); } } Hmh.Core.Shop.Models.Contract currentContract = CurrentUser.Shop.CurrentContract; if (currentContract == null) { model.ErrorList.Add("未签合同"); } //合同付款情况 } return(View(model)); }
public ActionResult OpenShop_add1() { var attrsTypes = this._iShopAttributesService.GetListByAttributeId(OpenShopAttrId); var typelist = (from m in attrsTypes select new SelectListItem { Text = m.ValueStr, Value = m.Id.ToString() }).ToList(); ViewBag.shopType = typelist; CategorySearchCriteria SearchCriteria = new CategorySearchCriteria(); SearchCriteria.ParentId = -1; var rangelist = this._objectService.SearchCategory(SearchCriteria).Item1; var range = (from m in rangelist select new SelectListItem { Text = m.Name, Value = m.Id.ToString() }).ToList(); ViewBag.range = range; var Districtlist = this._hotareaService.GetByParentId(1); var District = (from m in Districtlist select new SelectListItem { Text = m.name, Value = m.id.ToString() }).ToList(); ViewBag.District = District; OpenShopViewModel moudel = new OpenShopViewModel(); return(View(moudel)); }
public ActionResult uploadimg(OpenShopViewModel moudel) { string viewname = ""; if (moudel.Id != 0) { viewname = "OpenShop_add3"; var fileBLSName = UploadImgUtility.UploadImage(Request.Files["BLSfile"], Server.MapPath(CommonContorllers.FileUploadOpenShopBLSImgPath)); if (!string.IsNullOrEmpty(fileBLSName)) { moudel.BLS = CommonContorllers.FileUploadOpenShopBLSImgPath + fileBLSName; } var fileCICName = UploadImgUtility.UploadImage(Request.Files["CICfile"], Server.MapPath(CommonContorllers.FileUploadOpenShopCICImgPath)); if (!string.IsNullOrEmpty(fileCICName)) { moudel.CIC = CommonContorllers.FileUploadOpenShopCICImgPath + fileCICName; } } else { YG.SC.DataAccess.OpenShop model = new DataAccess.OpenShop(); var attrsTypes = this._iShopAttributesService.GetListByAttributeId(OpenShopAttrId); var typelist = (from m in attrsTypes select new SelectListItem { Text = m.ValueStr, Value = m.Id.ToString() }).ToList(); ViewBag.shopType = typelist; CategorySearchCriteria SearchCriteria = new CategorySearchCriteria(); SearchCriteria.ParentId = -1; var rangelist = this._objectService.SearchCategory(SearchCriteria).Item1; var range = (from m in rangelist select new SelectListItem { Text = m.Name, Value = m.Id.ToString() }).ToList(); ViewBag.range = range; var Districtlist = this._hotareaService.GetByParentId(1); var District = (from m in Districtlist select new SelectListItem { Text = m.name, Value = m.id.ToString() }).ToList(); ViewBag.District = District; var fileLogoName = UploadImgUtility.UploadImage(Request.Files["Logofile"], Server.MapPath(CommonContorllers.FileUploadOpenShopLogoImgPath)); if (!string.IsNullOrEmpty(fileLogoName)) { moudel.Logo = CommonContorllers.FileUploadOpenShopLogoImgPath + fileLogoName; } var fileQRcodeName = UploadImgUtility.UploadImage(Request.Files["QRcodefile"], Server.MapPath(CommonContorllers.FileUploadOpenShopQRCodeImgPath)); if (!string.IsNullOrEmpty(fileQRcodeName)) { moudel.QRcode = CommonContorllers.FileUploadOpenShopQRCodeImgPath + fileQRcodeName; } ViewBag.quyu = Request.Form["District"]; viewname = "OpenShop_add1"; } return(View(viewname, moudel)); }
public ActionResult OpenShop_add1(OpenShopViewModel openShop) { var attrsTypes = this._iShopAttributesService.GetListByAttributeId(OpenShopAttrId); var typelist = (from m in attrsTypes select new SelectListItem { Text = m.ValueStr, Value = m.Id.ToString() }).ToList(); ViewBag.shopType = typelist; CategorySearchCriteria SearchCriteria = new CategorySearchCriteria(); SearchCriteria.ParentId = -1; var rangelist = this._objectService.SearchCategory(SearchCriteria).Item1; var range = (from m in rangelist select new SelectListItem { Text = m.Name, Value = m.Id.ToString() }).ToList(); ViewBag.range = range; var Districtlist = this._hotareaService.GetByParentId(1); var District = (from m in Districtlist select new SelectListItem { Text = m.name, Value = m.id.ToString() }).ToList(); ViewBag.District = District; DataAccess.OpenShop moudel = new DataAccess.OpenShop(); moudel.CreateTime = DateTime.Now; moudel.Recsts = 1; moudel.Name = openShop.Name; moudel.Abbreviation = openShop.Abbreviation; moudel.Type = openShop.Type != null ? openShop.Type.Value : 0; moudel.Url = openShop.Url; moudel.Address = openShop.Address; moudel.Introduction = openShop.Introduction; moudel.Logo = openShop.Logo; moudel.QRcode = openShop.QRcode; moudel.Districtid = openShop.Districtid; moudel.Rangeid = openShop.Rangeid; this._iOpenShopService.Insert(moudel); Customer customer = new Customer(); customer.Name = openShop.Customer; customer.LoginName = openShop.Name; customer.Mobile = openShop.Mobile; customer.Password = openShop.Password.Trim(); customer.Property = true; customer.registertime = DateTime.Now; customer.GroupId = (int)CommonEnum.GroupOfCustomer.OpenShop; customer.Online = true; customer.Companyid = moudel.Id; _openShopId = moudel.Id; this._iCustomerService.Insert(customer); WriteUserSession(customer, ""); return(RedirectToAction("OpenShop_add2/" + moudel.Id)); }