Пример #1
0
        public ActionResult AlterimageCreate(int groupId)
        {
            SWfsBrandService service            = new SWfsBrandService();
            IEnumerable <SWfsListAlterPic> list = service.getSWfsListAlterGroupListID(groupId);

            return(View(list));
        }
Пример #2
0
        public ActionResult FloorRefOCS(int ModuleId)
        {
            ViewBag.ModuleId = ModuleId;
            SWfsBrandService              dal    = new SWfsBrandService();
            SwfsFlagShipModule            module = _SwfsFlagShipModuleService.GetSwfsFlagShipModuleById(ModuleId);
            List <SwfsFlagShipModuleLink> links  = _SwfsFlagShipModuleLinkService.GetAllSwfsFlagShipModuleLinkByModuleId(ModuleId).Where(a => a.ShowType == 0 && a.State == 1).ToList();

            ViewBag.ModuleType = module.ModuleType;
            ViewBag.brandNo    = module.BrandNo;
            string CategoryNo = "";

            if (links != null && links.Any())
            {
                CategoryNo = links[0].CategoryNo;
            }
            else
            {
                links = new List <SwfsFlagShipModuleLink> {
                    new SwfsFlagShipModuleLink()
                };
            }
            System.Text.StringBuilder sb   = new System.Text.StringBuilder();
            IList <OCSInfo>           list = dal.GetOCSListByBrandNO(module.BrandNo, CategoryNo, sb);

            //获取已经添加过的
            ViewBag.RightAdd = new HtmlString(sb.ToString());
            sb.Length        = 0;
            dal.GetOCSTree(list, "ROOT", sb);
            ViewBag.TreeHTML = new HtmlString(sb.ToString());
            sb.Length        = 0;

            return(View(links[0]));
        }
Пример #3
0
        public string ImgAlterUpload(SWfsListAlterPic obj, string linkname, int groupId)
        {
            SWfsBrandService service = new SWfsBrandService();

            obj.CreateDate = DateTime.Now;
            if (string.IsNullOrEmpty(obj.AlterAddress))
            {
                obj.AlterAddress = "";
            }
            #region 添加图片
            if (Request.Files["alter1file"] != null && Request.Files["alter1file"].ContentLength > 0)
            {
                obj.LargePicture = SaveImg(Request.Files["alter1file"], "width:690,Height:290,Length:300");
                if (rsPic.Keys.Contains("error"))
                {
                    ViewData["tip"] = new HtmlString("<script>alert('" + rsPic["error"] + "')</script>");
                    return(rsPic["error"]);
                }
            }
            else
            {
                if (string.IsNullOrEmpty(obj.LargePicture))
                {
                    obj.LargePicture = "";
                }
            }

            #endregion
            if (obj.AlterPicId == 0)
            {
                var ser = service.HeavyRow(linkname, groupId);
                if (ser.Count() > 0)
                {
                    if (ser.ElementAt(0).AlterPicId != obj.AlterPicId)
                    {
                        return("2");
                    }
                }
                //调用排重方法
                var row = service.HeavyRow(linkname, groupId);
                if (row.Count() > 0)
                {
                    return("2");
                }
                obj.LinkName = Request.Form["LinkName"];
                //添加
                return(service.Alterinsert(obj) > 0 ? "1" : "0");
            }
            else
            {
                obj.LinkName = Request.Form["LinkName"];
                //修改
                return(service.AlterUpdate(obj) ? "1" : "0");
            }
        }
Пример #4
0
        public ActionResult FlagshipList(int pageSize = 10, int pageIndex = 1)
        {
            SWfsBrandService bll = new SWfsBrandService();
            int count            = 0;

            //IList<SWfsBrandExtendList> list = bll.AIIBrandsList(pageIndex, pageSize, out count);
            ViewBag.list       = AllBrandsQueryList(pageIndex, pageSize, out count);
            ViewBag.pageIndex  = pageIndex;
            ViewBag.pageSize   = pageSize;
            ViewBag.TotalCount = count;
            return(View());
        }
Пример #5
0
        public ActionResult AlterCreate(int id = 0)
        {
            SWfsBrandService   service = new SWfsBrandService();
            SWfsListAlterGroup obj     = service.GetGroupbyID(id);

            if (obj == null)
            {
                return(View(new SWfsListAlterGroup {
                    GroupId = id
                }));
            }
            return(View(obj));
        }
Пример #6
0
        public ActionResult AlterCreate(SWfsListAlterGroup obj)
        {
            Dictionary <string, string> dic     = new Dictionary <string, string>();
            SWfsBrandService            service = new SWfsBrandService();

            obj.CreateDate = DateTime.Now;
            obj.GroupName  = Request.Form["GroupName"];
            obj.Gender     = Request.Form["Gender"] != null?int.Parse(Request.Form["Gender"]) : 0;

            obj.Status = Request.Form["Status"] != null?int.Parse(Request.Form["Status"]) : 0;

            obj.GroupType = 0;
            obj.Category  = Request.Form["Category"];
            if (obj.GroupId == 0)
            {
                if (service.GroupCreate(obj) > 0)
                {
                    ViewData["tip"] = new HtmlString("<script>alert('添加成功'); window.location.href='AlterList.html'</script>");
                }
                else
                {
                    ViewData["tip"] = new HtmlString("<script>alert('添加失败');</script>");
                }
            }
            else
            {
                if (service.GroupUpdate(obj))
                {
                    ViewData["tip"] = new HtmlString("<script>alert('修改成功'); window.location.href='AlterList.html'</script>");
                }
                else
                {
                    ViewData["tip"] = new HtmlString("<script>alert('修改失败');</script>");
                }
            }
            return(View(obj));
        }
Пример #7
0
        //修改状态
        public int AlterlistStatus(int groupId, int status)
        {
            SWfsBrandService bll = new SWfsBrandService();

            return(bll.AlterStatus(groupId, status));
        }