示例#1
0
 //修改旗舰店
 public int EditeMobileFlagShipStoreByID(SWfsBrandFlagShipStoreMobile obj)
 {
     if (obj.BrandNO == null)
     {
         return(0);
     }
     if (obj.HtmlCode == null)
     {
         obj.HtmlCode = "";
     }
     if (obj.TemplateNo == null)
     {
         obj.TemplateNo = "";
     }
     obj.CreateDate = DateTime.Now;
     if (obj.FlagShipSotreID == 0)
     {
         if (GetMobileFlagShipStoreObjByBrandNO(obj.BrandNO) != null)//判断是否存在
         {
             return(-1);
         }
         return(DapperUtil.Insert <SWfsBrandFlagShipStoreMobile>(obj, true));
     }
     else
     {
         return(DapperUtil.Update <SWfsBrandFlagShipStoreMobile>(obj) ? 1 : 0);
     }
 }
示例#2
0
        /// <summary>
        /// 配置上新时间设置方法
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int ConfigNewDate(SwfsFlagShipGloalConfig model)
        {
            SwfsFlagShipGloalConfig Config = this.NewDateManageBrandNo(model.BrandNo);

            if (Config == null)//如果为空就是添加数据
            {
                try
                {
                    model.DataCreate = System.DateTime.Now;
                    DapperUtil.Insert <SwfsFlagShipGloalConfig>(model);
                    return(1);
                }
                catch (Exception)
                {
                    return(0);

                    throw;
                }
            }
            else //修改操作
            {
                Config.ConfigName  = model.ConfigName;
                Config.ConfigValue = model.ConfigValue;
                Config.ConfigTime  = model.ConfigTime;
                return(DapperUtil.Update <SwfsFlagShipGloalConfig>(Config) == true ? 1 : 0);
            }
        }
示例#3
0
        public JsonResult UpdateHotProductStatus(string hotproductId)
        {
            var hotproduct = DapperUtil.QueryByIdentity <SWfsHotProduct>(hotproductId);

            hotproduct.Status = hotproduct.Status == short.Parse("1") ? short.Parse("0") : short.Parse("1");
            DapperUtil.Update <SWfsHotProduct>(hotproduct);
            return(Json(new { result = "success" }));
        }
示例#4
0
 public int EditeAppOperatingPosition(SWfsAppOperatingPosition obj)
 {
     if (obj.OperatingPositionId != 0)
     {
         return(DapperUtil.Update <SWfsAppOperatingPosition>(obj)?1:0);
     }
     return(0);
 }
示例#5
0
        //保存区块关联
        public bool SaveRegionRelationInfo(SWfsBrandFlagShipStoreRegion obj)
        {
            if (obj.RegionID <= 0 || obj.BrandNO == null || obj.RelationType <= 0 || string.IsNullOrEmpty(obj.TemplateNo))
            {
                return(false);
            }
            if (obj.ImgNO == null)
            {
                obj.ImgNO = "";
            }
            if (obj.RelationContent == null)
            {
                obj.RelationContent = "";
            }
            obj.CreateDate = DateTime.Now;
            //查询关联数据描述
            switch (obj.RelationType)
            {
            case 1:    //查询名称活动
                if (!string.IsNullOrEmpty(obj.RelationContent))
                {
                    SWfsNewSubject subobj = GetNewSubjectByNO(obj.RelationContent);
                    obj.Direction = subobj == null ? "" : subobj.SubjectName;
                }
                break;

            case 2:
                obj.Direction = "";
                break;

            case 3:
                if (!string.IsNullOrEmpty(obj.RelationContent))
                {
                    SWfsBrandNavigation navobj = GetBrandNavigationNO(obj.RelationContent);
                    obj.Direction = navobj == null ? "" : navobj.NavigationName;
                }
                break;

            case 4:
                obj.Direction = "";
                break;
            }
            if (obj.FlagReigionID == 0)
            {
                //判断是否已近存在该区块的数据
                if (GetRegionRelationInfoByCondition(obj.BrandNO, obj.TemplateNo, obj.RegionID).Count() > 0)
                {
                    return(false);
                }
                return(DapperUtil.Insert <SWfsBrandFlagShipStoreRegion>(obj, true) > 0 ? true : false);
            }
            else
            {
                return(DapperUtil.Update <SWfsBrandFlagShipStoreRegion>(obj));
            }
        }
示例#6
0
 /// <summary>
 /// 创建品牌索引
 /// </summary>
 /// <param name="brandIndex"></param>
 /// <returns></returns>
 public int SaveBrandIndex(SWfsBrandIndex brandIndex)
 {
     if (brandIndex != null && brandIndex.IndexId == 0)
     {
         return(DapperUtil.Insert <SWfsBrandIndex>(brandIndex));
     }
     else
     {
         return(DapperUtil.Update <SWfsBrandIndex>(brandIndex) ? 1 : -1);
     }
 }
 /// <summary>
 /// 判定类型转变时间, 更新到数据库
 /// </summary>
 /// <param name="module"></param>
 /// <returns></returns>
 public void CheckAdShowTypeChangeDate(SWfsIndexModule module)
 {
     if (module.PageNo == "index" && module.ADShowTypeChangeDate < DateTime.Now && (module.ADShowType == 1 || module.ADShowType == 2) && module.ModuleId > 0)
     {
         module.ADShowTypeChangeDate = Convert.ToDateTime("2099-01-01");
         module.ADShowType           = module.ADShowType == 1 ? (short)2 : (short)1;
         DapperUtil.Update <SWfsIndexModule>(module);
         //清除缓存
         EnyimMemcachedClient.Instance.Remove("ComBeziWfs_SWfsIndexModule_GetSWfsIndexModuleIncludeTodayStyle_GetAllFloors");
     }
     //return module;
 }
 /// <summary>
 /// 读取配置值
 /// </summary>
 /// <param name="functionNo">功能编号,固定</param>
 /// <param name="configValue">配置值</param>
 /// <returns></returns>
 public SwfsFlagShipGloalConfig InsertOrUpdateSwfsFlagShipGloalConfig(SwfsFlagShipGloalConfig config)
 {
     if (config.ConfigId > 0)
     {
         DapperUtil.Update(config);
     }
     else
     {
         config.ConfigId = DapperUtil.Insert(config, true);
     }
     return(config);
 }
示例#9
0
 /// <summary>
 /// 保存或更新楼层内容
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public SwfsFlagShipModuleLink InsertOrUpdateSwfsFlagShipModuleLink(SwfsFlagShipModuleLink model)
 {
     if (model.LinkId == 0)
     {
         model.LinkId = DapperUtil.Insert <SwfsFlagShipModuleLink>(model, true);
     }
     else
     {
         DapperUtil.Update <SwfsFlagShipModuleLink>(model);
     }
     return(model);
 }
 /// <summary>
 /// 更新或插入广告图
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public SWfsOperationPicture InsertOrUpdateSWfsOperationPicture(SWfsOperationPicture model)
 {
     if (model.PictureManageId <= 0)
     {
         DapperUtil.Insert <SWfsOperationPicture>(model);
     }
     else
     {
         DapperUtil.Update <SWfsOperationPicture>(model);
     }
     return(model);
 }
 /// <summary>
 /// 保存或更新楼层
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public SwfsFlagShipModule InsertOrUpdateSwfsFlagShipModule(SwfsFlagShipModule model)
 {
     if (model.ModuleId == 0)
     {
         model.ModuleId = DapperUtil.Insert <SwfsFlagShipModule>(model, true);
     }
     else
     {
         DapperUtil.Update <SwfsFlagShipModule>(model);
     }
     return(model);
 }
示例#12
0
        public string SaveVsinsHotProducts()
        {
            string hotProductId = Request.Form["hotProductId"];
            string productNo    = Request.Form["productNo"];
            string status       = Rq.GetStringForm("status");
            string beginTime    = Rq.GetStringForm("dateBegin");
            string endTime      = Rq.GetStringForm("dateEnd");
            string description  = Rq.GetStringForm("description");
            string imgNo        = string.Empty;
            Dictionary <string, string> picResDic = new Dictionary <string, string>();

            if (Request.Files["imgfile"] != null && Request.Files["imgfile"].ContentLength > 0)
            {
                picResDic = new CommonService().PostImg(Request.Files["imgfile"], "width:640,Height:0,Length:200");
                if (picResDic.Keys.Contains("error"))
                {
                    return("{ \"result\":\"error\", \"msg\":\"" + picResDic["error"] + "\" }");
                }
                if (picResDic.Keys.Contains("success"))
                {
                    imgNo = picResDic["success"];
                }
            }
            else
            {
                imgNo = Rq.GetStringForm("imgNo");
            }

            SWfsHotProduct hotproduct = DapperUtil.QueryByIdentity <SWfsHotProduct>(hotProductId);

            if (hotproduct == null)
            {
                hotproduct            = new SWfsHotProduct();
                hotproduct.CreateDate = DateTime.Now;
            }
            hotproduct.Description = description;
            hotproduct.EndDate     = Convert.ToDateTime(endTime);
            hotproduct.PicFileNo   = imgNo;
            hotproduct.ProductNo   = productNo;
            hotproduct.StartDate   = Convert.ToDateTime(beginTime);
            hotproduct.Status      = short.Parse(status);
            hotproduct.Type        = 1;
            if (hotproduct.HotProductId != 0)
            {
                DapperUtil.Update <SWfsHotProduct>(hotproduct);
            }
            else
            {
                DapperUtil.Insert <SWfsHotProduct>(hotproduct);
            }
            return("{\"result\":\"success\"}");
        }
示例#13
0
 //编辑模板
 public int EditeTemplate(SWfsBrandFlagShipTemplate obj)
 {
     if (obj.TemplateName == null)
     {
         return(0);
     }
     if (obj.TemplateNO == null)
     {
         return(0);
     }
     if (obj.TemplateType == 0)
     {
         return(0);
     }
     if (obj.TemplateDirection == null)
     {
         obj.TemplateDirection = "";
     }
     if (obj.TemplatePath == null)
     {
         obj.TemplatePath = "";
     }
     if (obj.CSSPath == null)
     {
         obj.CSSPath = "";
     }
     if (obj.JSPath == null)
     {
         obj.JSPath = "";
     }
     if (obj.TemplateDirection == null)
     {
         obj.TemplateDirection = "";
     }
     obj.CreateDate = DateTime.Now;
     if (obj.TemplateID == 0)//添加
     {
         //判断是否存在该编号
         if (IsExists(obj.TemplateNO) > 0)
         {
             return(-1);
         }
         return(DapperUtil.Insert <SWfsBrandFlagShipTemplate>(obj, true));
     }
     else
     {
         return(DapperUtil.Update <SWfsBrandFlagShipTemplate>(obj) ? 1 : 0);
     }
 }
示例#14
0
 public int BrandSpecialityStoreEdits(string brandNo, int templateId, string specialityStoreType, string specialityStorePic, string brandIntroduce, DateTime dateCreate, int order)
 {
     if (order == 1)
     {
         return(DapperUtil.Insert <SWfsBrandSpecialityStore>(new SWfsBrandSpecialityStore {
             TemplateId = templateId, SpecialityStoreType = specialityStoreType, SpecialityStorePic = specialityStorePic, BrandIntroduce = brandIntroduce, DateCreate = dateCreate
         }));
     }
     else
     {
         return(Convert.ToInt32(DapperUtil.Update <SWfsBrandSpecialityStore>(new SWfsBrandSpecialityStore {
             TemplateId = templateId, SpecialityStoreType = specialityStoreType, SpecialityStorePic = specialityStorePic, BrandIntroduce = brandIntroduce, DateCreate = dateCreate
         })));
     }
 }
示例#15
0
        //发布旗舰店信息
        public int PublishFlagShipStoreInfo(SWfsBrandFlagShipStore obj)
        {
            //查询发布的旗舰店是否存在
            var result = DapperUtil.Query <SWfsBrandFlagShipStoreSave>("ComBeziWfs_SWfsBrandFlagShipStore_ReadByBrandNo", new { BrandNo = obj.BrandNo }).FirstOrDefault();

            if (result != null)
            {
                //修改
                obj.FlagShipStoreId = result.FlagShipStoreId;
                return(DapperUtil.Update <SWfsBrandFlagShipStore>(obj) ? 1 : 0);//修改发布数据
            }
            else
            {
                return(DapperUtil.Insert <SWfsBrandFlagShipStore>(obj, true));//增加发布数据
            }
        }
        /// <summary>
        /// 更新或插入楼层
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public SWfsIndexModule InsertOrUpdateSWfsIndexModule(SWfsIndexModule model, Boolean needEntity = false)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            if (model.ModuleId <= 0)
            {
                DapperUtil.Insert <SWfsIndexModule>(model);
            }
            else
            {
                DapperUtil.Update <SWfsIndexModule>(model);
            }

            if (needEntity && model.ModuleId <= 0)//插入时 需要获取最ID
            {
                var result = DapperUtil.Query <int>("ComBeziWfs_SWfsIndexModule_GetSWfsIndexModuleIdByCreaterAndCreateTime", new { model.DateCreate, model.OperateUserId }).FilterList();
                model.ModuleId = (result != null && result.Any()) ? result.First() : -1;
            }
            return(model);
        }
示例#17
0
        public int GetNextCounterId(string sequenceKey)
        {
            int             i     = 1;
            SequenceCounter model = DapperUtil.Query <SequenceCounter>("ComBeziCommon_SequenceCounter_Read", new { SequenceKey = sequenceKey }).FirstOrDefault();

            if (model == null)
            {
                SequenceCounter sc = new SequenceCounter();
                sc.SequenceKey = sequenceKey;
                sc.CounterId   = i;
                DapperUtil.Insert <SequenceCounter>(sc, false);//true 返回插入数据的主键,false则不返回
            }
            else
            {
                i = model.CounterId;
                model.CounterId   = i + 1;
                model.SequenceKey = sequenceKey;
                DapperUtil.Update(model);
            }
            return(i);
        }
 /// <summary>
 /// 插入或更新link
 /// </summary>
 /// <param name="link"></param>
 /// <returns></returns>
 public int InsertOrUpdateLink(ref SWfsIndexModuleLink link, Boolean needEntity = false)
 {
     try
     {
         if (link.LinkId <= 0)
         {
             DapperUtil.Insert <SWfsIndexModuleLink>(link);
         }
         else
         {
             DapperUtil.Update <SWfsIndexModuleLink>(link);
         }
         if (needEntity)
         {
             link = DapperUtil.Query <SWfsIndexModuleLink>("ComBeziWfs_SWfsIndexModuleLink_GetSWfsIndexModuleLinkByModuleIdAndDateCreate", new { ModuleId = link.ModuleId, link.DateCreate }).FirstOrDefault();
         }
     }
     catch (Exception)
     {
         return(-1);
     }
     return(1);
 }
 /// <summary>
 /// 修改运营位广告
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool Update(SWfsBrandAdsInfo model)
 {
     return(DapperUtil.Update(model));
 }
 public bool Update(SWfsPictureManager model)
 {
     return(DapperUtil.Update <SWfsPictureManager>(model));
 }
示例#21
0
 public bool BrandSpecialityStoreUpdate(SWfsBrandSpecialityStore obj)
 {
     return(DapperUtil.Update <SWfsBrandSpecialityStore>(obj));
 }
示例#22
0
 public int SelectProductListId(SwfsFlagShipNewArrivalProductList ArrivalProduct)
 {
     return(DapperUtil.Update <SwfsFlagShipNewArrivalProductList>(ArrivalProduct) == true ? 1 : 0);
 }
 public void Update(SWfsSubjectFocusArea model)
 {
     DapperUtil.Update <SWfsSubjectFocusArea>(model);
 }
示例#24
0
 public bool Update(WfsCmsContent model)
 {
     return(DapperUtil.Update <WfsCmsContent>(model));
 }
示例#25
0
 //修改关联表
 public bool PromotionTipRefUpdate(SWfsProductPromotionTipRef obj)
 {
     return(DapperUtil.Update <SWfsProductPromotionTipRef>(obj));
 }
示例#26
0
 //修改旗舰店
 public bool UpdateFlagShipStore(SWfsBrandFlagShipStoreSave obj)
 {
     return(DapperUtil.Update <SWfsBrandFlagShipStoreSave>(obj));
 }
示例#27
0
 //更新一条新的咨询
 public bool UpdateSWfsQuestAnswer(SWfsQuestAnswer QA)
 {
     UpdateSWfsQuestAnswerOperateUserId(QA.QuestAnswerId, PresentationHelper.GetPassport().UserName);
     return(DapperUtil.Update <SWfsQuestAnswer>(QA));
 }
示例#28
0
 //修改
 public bool GroupUpdate(SWfsListAlterGroup obj)
 {
     return(DapperUtil.Update <SWfsListAlterGroup>(obj));
 }
 public bool Update(SwfsFlagShipFlash entity)
 {
     return(DapperUtil.Update <SwfsFlagShipFlash>(entity));
 }
示例#30
0
 //图片修改
 public bool AlterUpdate(SWfsListAlterPic obj)
 {
     return(DapperUtil.Update <SWfsListAlterPic>(obj));
 }