Пример #1
0
        public string AddOperatingPosition(int operatingPositionSort = 0, string operatingPositionLinkUrl = "", string picno = "", int imgWidth = 0, int imgHeight = 0, int imgLength = 0)
        {
            SWfsAppOperatingPosition obj  = new SWfsAppOperatingPosition();
            HttpPostedFileBase       file = Request.Files["operatingPositionImgfile"];

            if (file != null && file.ContentLength > 0)
            {
                SaveImg(file, imgWidth, imgHeight, 100);
                if (rsPic.Keys.Contains("error"))
                {
                    return("{\"status\":1,\"message\":\"" + rsPic["error"] + "\"}");
                }
                else
                {
                    obj.PicNo = rsPic["success"];
                }
            }
            else
            {
                obj.PicNo = picno;
            }
            if (string.IsNullOrEmpty(obj.PicNo))
            {
                obj.PicNo = "";
            }
            obj.OperatingPositionId = operatingPositionSort;
            obj.Sort       = 0;
            obj.LinkUrl    = operatingPositionLinkUrl;
            obj.CreateDate = DateTime.Now;
            appIndexService.UpdateAppOperatingPosition(obj);
            return("{\"status\":0,\"message\":\"操作成功\"}");
        }
Пример #2
0
 public int EditeAppOperatingPosition(SWfsAppOperatingPosition obj)
 {
     if (obj.OperatingPositionId != 0)
     {
         return(DapperUtil.Update <SWfsAppOperatingPosition>(obj)?1:0);
     }
     return(0);
 }
Пример #3
0
        //首页
        public ActionResult Index()
        {
            AppIndexParams model = new AppIndexParams();
            IEnumerable <SWfsAppShopCategory> shopCategorylist     = appIndexService.GetAppShopCategoryList();
            SWfsAppOperatingPosition          operatingPositionOne = appIndexService.GetAppOperatingPositionOne();

            model.ShopCategoryList     = shopCategorylist;
            model.OperatingPositionOne = operatingPositionOne;
            model.HomeAlterPic         = appIndexService.GetHomeAlterPic();
            return(View(model));
        }
Пример #4
0
 /// <summary>
 /// 添加/修改搜索页运营位
 /// 指定位置不存在的insert,存在的update
 /// </summary>
 /// <param name="obj"></param>
 public int UpdateAppOperatingPosition(SWfsAppOperatingPosition obj)
 {
     if (obj.OperatingPositionId == 0)
     {
         return(DapperUtil.Insert <SWfsAppOperatingPosition>(obj, true));
     }
     else
     {
         return(DapperUtil.UpdatePartialColumns <SWfsAppOperatingPosition>(new
         {
             OperatingPositionId = obj.OperatingPositionId,
             PicNo = obj.PicNo,
             LinkUrl = obj.LinkUrl
         }) ? 1 : 0);
     }
 }