public ActionResult Index(string brandNo) { if (string.IsNullOrEmpty(brandNo)) { Response.Redirect("/Shangpin/Brand/AIIBrandsSelect"); } List <SwfsFlagShipModule> modules = _SwfsFlagShipModuleService.GetOrInitialBrandModules(brandNo); ViewBag.Modules = modules; ViewBag.ModuleLinkDic = _SwfsFlagShipModuleLinkService.GetFloorLinkDic(modules.Select(a => a.ModuleId).ToArray()); var g01 = _pic.GetEntityByBrandNoAndIndex(brandNo, 0); var g02 = _pic.GetEntityByBrandNoAndIndex(brandNo, 1); var g03 = _pic.GetEntityByBrandNoAndIndex(brandNo, 2); ViewBag.picur1 = g01 == null ? "/Areas/Shangpin/Images/topshop/test_03.jpg" : "/ReadPic/GetPic.ashx?width=0&height=0&pictureFileNo=" + g01.PictureFileNo + "&type=2"; ViewBag.picur2 = g02 == null ? "/Areas/Shangpin/Images/topshop/test_03.jpg" : "/ReadPic/GetPic.ashx?width=0&height=0&pictureFileNo=" + g02.PictureFileNo + "&type=2"; ViewBag.picur3 = g03 == null ? "/Areas/Shangpin/Images/topshop/test_03.jpg" : "/ReadPic/GetPic.ashx?width=0&height=0&pictureFileNo=" + g03.PictureFileNo + "&type=2"; SwfsFlagShipLogo entity = _logo.GetEntityByBrandNo(brandNo); ViewBag.logourl = entity == null ? "" : "/ReadPic/GetPic.ashx?width=0&height=0&pictureFileNo=" + entity.LogoNo + "&type=2"; var flash_ = _flash.GetEntityByBrandNo(brandNo).FirstOrDefault(); if (flash_ != null) { ViewBag.flash_url = "/ReadPic/GetPic.ashx?width=0&height=0&pictureFileNo=" + flash_.PictureNo + "&type=2"; } //获取此品牌导航信息 用于导航链接 ViewBag.BrandInfo = new SWfsBrandService().GetSWfsBrandExtendListByBrandNo(brandNo) ?? new SWfsBrandExtendList(); return(View()); }
public ActionResult FlagShipLogo(string brandNo) { if (string.IsNullOrEmpty(brandNo)) { Response.Redirect("/Shangpin/Brand/AIIBrandsSelect"); } SwfsFlagShipLogo entity = _logo.GetEntityByBrandNo(brandNo); if (entity == null) { entity = new SwfsFlagShipLogo(); entity.CreateDate = DateTime.Now; entity.BrandNo = brandNo; } return(View(entity)); }
public JsonResult FlagShipLogo(FormCollection form) { ResultBase_form result = new ResultBase_form(); SwfsFlagShipLogo entity = new SwfsFlagShipLogo(); TryUpdateModel <SwfsFlagShipLogo>(entity, form); HttpPostedFileBase file = Request.Files["picFile"]; rsPic.Clear(); if (file != null && file.ContentLength > 0) { string width = form["Width"]; string height = form["Height"]; string length = form["Length"]; rsPic = _SwfsFlagShipModuleLinkService.SaveImg(Request.Files["picFile"], "width:" + width + " ,Height:" + height + ",Length:" + length + ""); if (rsPic.Keys.Contains("error")) { result.status = 0; result.msg = rsPic["error"]; return(Json(result, JsonRequestBehavior.AllowGet)); } else { entity.LogoNo = rsPic["success"]; } } else { if (!string.IsNullOrEmpty(Request.Form["LogoNo"])) { entity.LogoNo = Request.Form["LogoNo"]; } } if (entity.LogoId == 0) { result.status = _logo.Insert(entity); } else { result.status = _logo.Update(entity) ? 1 : 0; } result.msg = result.status == 0 ? "操作失败" : "操作成功"; result.content = entity; return(Json(result, JsonRequestBehavior.AllowGet)); }