public ActionResult Company_infoimg(ShopBrand moudel) { string viewname = ""; var fileLogoName = UploadImgUtility.UploadImage(Request.Files["Logofile"], Server.MapPath(CommonContorllers.FileUploadBrandLogoImgPath)); if (!string.IsNullOrEmpty(fileLogoName)) { moudel.Logo = CommonContorllers.FileUploadBrandLogoImgPath + fileLogoName; viewname = "Company_info"; } var fileQRcodeName = UploadImgUtility.UploadImage(Request.Files["QRcodefile"], Server.MapPath(CommonContorllers.FileUploadBrandQRCodeImgPath)); if (!string.IsNullOrEmpty(fileQRcodeName)) { moudel.QRCode = CommonContorllers.FileUploadBrandQRCodeImgPath + fileQRcodeName; viewname = "Company_info"; } var fileBLSName = UploadImgUtility.UploadImage(Request.Files["BLSfile"], Server.MapPath(CommonContorllers.FileUploadBrandBLSImgPath)); if (!string.IsNullOrEmpty(fileBLSName)) { moudel.BLS = CommonContorllers.FileUploadBrandBLSImgPath + fileBLSName; viewname = "Company_Qualifications"; } var fileCICName = UploadImgUtility.UploadImage(Request.Files["CICfile"], Server.MapPath(CommonContorllers.FileUploadBrandCICImgPath)); if (!string.IsNullOrEmpty(fileCICName)) { moudel.CIC = CommonContorllers.FileUploadBrandCICImgPath + fileCICName; viewname = "Company_Qualifications"; } return(View(viewname, moudel)); }
public ActionResult uploadimg(Customer moudel) { var fileBLSName = UploadImgUtility.UploadImage(Request.Files["portraitfile"], Server.MapPath(CommonContorllers.FileUploadPortraitImgPath)); if (!string.IsNullOrEmpty(fileBLSName)) { moudel.portrait = CommonContorllers.FileUploadPortraitImgPath + fileBLSName; } return(View("Userinfo", moudel)); }
public ActionResult EditPost(YG.SC.DataAccess.OpenShop shopBrand) { var entity = this._iOpenShopService.GetById(shopBrand.Id); var fileLogoName = UploadImgUtility.UploadImage(Request.Files["LogoImg"], Server.MapPath(CommonContorllers.FileUploadOpenShopLogoImgPath)); if (!string.IsNullOrEmpty(fileLogoName)) { entity.Logo = CommonContorllers.FileUploadOpenShopLogoImgPath + fileLogoName; } entity.Name = shopBrand.Name; entity.Rmark = shopBrand.Rmark; entity.Url = shopBrand.Url; entity.VidoUrl = shopBrand.VidoUrl; this._iOpenShopService.Update(entity); string msg = "修改完成"; ViewBag.msg = msg; return(Redirect("~/Merchant/Edit?id=" + entity.Id)); }
public ActionResult Company_infoimg(DataAccess.OpenShop moudel) { string viewname = ""; var fileLogoName = UploadImgUtility.UploadImage(Request.Files["Logofile"], Server.MapPath(CommonContorllers.FileUploadOpenShopLogoImgPath)); if (!string.IsNullOrEmpty(fileLogoName)) { ViewBag.Range = Request["Range"]; ViewBag.ValueStr = Request["ValueStr"]; ViewBag.District = Request["District"]; moudel.Logo = CommonContorllers.FileUploadOpenShopLogoImgPath + fileLogoName; viewname = "Company_info"; } var fileQRcodeName = UploadImgUtility.UploadImage(Request.Files["QRcodefile"], Server.MapPath(CommonContorllers.FileUploadOpenShopQRCodeImgPath)); if (!string.IsNullOrEmpty(fileQRcodeName)) { ViewBag.Range = Request["Range"]; ViewBag.ValueStr = Request["ValueStr"]; ViewBag.District = Request["District"]; moudel.QRcode = CommonContorllers.FileUploadOpenShopQRCodeImgPath + fileQRcodeName; viewname = "Company_info"; } var fileBLSName = UploadImgUtility.UploadImage(Request.Files["BLSfile"], Server.MapPath(CommonContorllers.FileUploadOpenShopBLSImgPath)); if (!string.IsNullOrEmpty(fileBLSName)) { moudel.BLS = CommonContorllers.FileUploadOpenShopBLSImgPath + fileBLSName; viewname = "Company_Qualifications"; } var fileCICName = UploadImgUtility.UploadImage(Request.Files["CICfile"], Server.MapPath(CommonContorllers.FileUploadOpenShopCICImgPath)); if (!string.IsNullOrEmpty(fileCICName)) { moudel.CIC = CommonContorllers.FileUploadOpenShopCICImgPath + fileCICName; viewname = "Company_Qualifications"; } return(View(viewname, moudel)); }
public ActionResult uploadimg(ShopBrand moudel) { string viewname = ""; if (moudel.Id != 0) { viewname = "Brand_add3"; var fileBLSName = UploadImgUtility.UploadImage(Request.Files["BLSfile"], Server.MapPath(CommonContorllers.FileUploadBrandBLSImgPath)); if (!string.IsNullOrEmpty(fileBLSName)) { moudel.BLS = CommonContorllers.FileUploadBrandBLSImgPath + fileBLSName; } var fileCICName = UploadImgUtility.UploadImage(Request.Files["CICfile"], Server.MapPath(CommonContorllers.FileUploadBrandCICImgPath)); if (!string.IsNullOrEmpty(fileCICName)) { moudel.CIC = CommonContorllers.FileUploadBrandCICImgPath + fileCICName; } } else { YG.SC.DataAccess.ShopBrand model = new DataAccess.ShopBrand(); var attrsTypes = this._iShopAttributesServiceService.GetListByAttributeId(9); ViewBag.shopType = attrsTypes; var fileLogoName = UploadImgUtility.UploadImage(Request.Files["Logofile"], Server.MapPath(CommonContorllers.FileUploadBrandLogoImgPath)); if (!string.IsNullOrEmpty(fileLogoName)) { moudel.Logo = CommonContorllers.FileUploadBrandLogoImgPath + fileLogoName; } var fileQRcodeName = UploadImgUtility.UploadImage(Request.Files["QRcodefile"], Server.MapPath(CommonContorllers.FileUploadBrandQRCodeImgPath)); if (!string.IsNullOrEmpty(fileQRcodeName)) { moudel.QRCode = CommonContorllers.FileUploadBrandQRCodeImgPath + fileQRcodeName; } ViewBag.attributesvalue = Request["selAttribute"]; viewname = "Brand_add1"; } return(View(viewname, moudel)); }
public ActionResult Postimg(ProductViewModel moudel) { string Viewname = ""; var fileCICName = UploadImgUtility.UploadImage(Request.Files["Imagefile"], Server.MapPath(CommonContorllers.FileUploadGoodsImgPath)); if (!string.IsNullOrEmpty(fileCICName)) { moudel.Image = CommonContorllers.FileUploadGoodsImgPath + fileCICName; } if (moudel.Id > 0) { Viewname = "ProductEdit"; } else { Viewname = "ProductAdd"; } CategorySearchCriteria SearchCriteria = new CategorySearchCriteria(); SearchCriteria.Type = (int)CommonEnum.TypeOfDbObject.Classification; SearchCriteria.ParentId = -1; var attrsTypes = this._ObjectService.SearchCategory(SearchCriteria).Item1; var typelist = (from m in attrsTypes select new SelectListItem { Text = m.Name, Value = m.Id.ToString() }).ToList(); if (typelist.Count == 0) { typelist.Add(new SelectListItem() { Text = "无", Value = "-1" }); } ViewBag.shopType = typelist; return(View(Viewname, moudel)); }
public ActionResult BrandEdit(Brand model) { bool isMember; bool isBrand; Customer member = GetCurrentUser(out isMember, out isBrand); if (member == null || !isMember)//只有已登录的会员用户才可以管理自己的品牌。 { return(RedirectToAction("Index", "Login")); } var fileLogoName = UploadImgUtility.UploadImage(Request.Files["Logo"], Server.MapPath(CommonContorllers.FileUploadBrandLogoImgPath)); var fileQRCodeName = UploadImgUtility.UploadImage(Request.Files["QRCode"], Server.MapPath(CommonContorllers.FileUploadBrandQRCodeImgPath)); ShopBrand sb = new ShopBrand(); if (isBrand) { sb = _IShopBrandService.GetById(member.Companyid); } sb.Name = model.Name; if (!string.IsNullOrEmpty(fileLogoName)) { sb.Logo = fileLogoName; } if (!string.IsNullOrEmpty(fileQRCodeName)) { sb.QRCode = fileQRCodeName; } sb.Url = model.WebUrl; sb.VidoUrl = model.VideoUrl; sb.JoinIn = model.IsAllowJoin; sb.Recsts = model.IsValid ? 1 : 0; sb.Abbreviation = model.Introduce; if (isBrand) { sb.Id = member.Companyid; _IShopBrandService.Update(sb); } else { _IShopBrandService.Insert(sb); Customer c = _iCustomerService.GetEntityById(UserContext.Current.Id); c.Companyid = sb.Id; _iCustomerService.Update(c); } //增加业态 List <ShopBrandAttributeValues> listattr = new List <ShopBrandAttributeValues>(); var attributesvalue = Request["selAttribute"]; if (!string.IsNullOrEmpty(attributesvalue)) { foreach (var item in attributesvalue.Split(',')) { ShopBrandAttributeValues bv = new ShopBrandAttributeValues() { BrandId = sb.Id, Recsts = 1, AttributesId = Convert.ToInt32(item.Split('-')[0]), AttributeValuesId = Convert.ToInt32(item.Split('-')[1]), }; listattr.Add(bv); } } this._iShopAttributesServiceService.InsertList(listattr); return(RedirectToAction("Brand")); }
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)); }