public int Edit(string topicId, string action, string status = "1") { SWfsTopics t = new SWfsTopics(); int rs = 0; switch (action) { case "del": //删除 rs = DapperUtil.Execute("ComBeziWfs_SWfsTopics_DeleteTopicByTopicNo", (new { TopicNo = topicId })); break; case "switch": //开启和关闭 rs = DapperUtil.UpdatePartialColumns <SWfsTopics>(new { TopicNo = topicId, status = status }) ? 1 : 0; break; case "top": //置顶和取消 rs = DapperUtil.UpdatePartialColumns <SWfsTopics>(new { TopicNo = topicId, IsTop = (status == "1")?true:false, DateTop = DateTime.Now }) ? 1 : 0; break; } return(rs); }
/// <summary> /// 修改最新预报列表 /// </summary> /// <param name="NewArrivalNoticeId"></param> /// <returns></returns> public int ModifyNewArrivalNoticeById(string Id, string name, string Date, string UserID) { int result = 0; var resultint = DapperUtil.UpdatePartialColumns <SWfsNewArrivalNotice>(new { NewArrivalNoticeId = Id, NewArrivalNoticName = name, NewArrivalNoticDate = Date, UpdateDate = DateTime.Now, UpdateOperateUserId = UserID }); return(result = resultint == false ? 0 : 1); }
/// <summary> /// 修改最新预报列表 /// </summary> /// <param name="NewArrivalNoticeId"></param> /// <returns></returns> public int DeLNewArrivalNoticeById(string Id, string UserID) { int result = 0; var resultint = DapperUtil.UpdatePartialColumns <SWfsNewArrivalNotice>(new { NewArrivalNoticeId = Id, DataState = 255, UpdateDate = DateTime.Now, UpdateOperateUserId = UserID }); return(result = resultint == false ? 0 : 1); }
//保存商品的title public int SaveProductTitle(string productNo, string productTitle) { //判断是否存在编辑过的商品 SWfsProductRef productObj = GetProductRefByProductNO(productNo); if (productObj == null) { productObj.ProductNO = productNo; productObj.TemplateNO = ""; productObj.CreateDate = DateTime.Parse("1900-01-01 00:00:00"); productObj.EditeDate = DateTime.Parse("1900-01-01 00:00:00"); productObj.HTMLCode = ""; productObj.PublishHTML = ""; productObj.ProductTitle = productTitle; productObj.PublishTime = DateTime.Parse("1900-01-01 00:00:00"); productObj.PublishPeople = ""; productObj.EditePeople = ""; productObj.HTMLCodeMobile = ""; productObj.PublishHTMLMobile = ""; return(DapperUtil.Insert <SWfsProductRef>(productObj)); } else { return(DapperUtil.UpdatePartialColumns <SWfsProductRef>(new { RefID = productObj.RefID, ProductTitle = productTitle })?1:0); } return(DapperUtil.Execute("ComBeziWfs_SWfsProductRef_SaveProductTitle", new { ProductTitle = productTitle, ProductNO = productNo })); }
/// <summary> /// 修改热门商品排序值 /// </summary> /// <param name="id"></param> /// <param name="sortValue"></param> /// <returns></returns> public bool UpdateHotProductSortValue(int id, int sortValue) { return(DapperUtil.UpdatePartialColumns <SWfsIndexHotProductListTemp>(new { ID = id, SortValue = sortValue })); }
/// <summary> /// 品牌排序 /// </summary> /// <param name="id"></param> /// <param name="sortValue"></param> /// <returns></returns> public bool EditeBrandSortValue(int id, int sortValue) { return(DapperUtil.UpdatePartialColumns <SWfsSpHomeRecommendBrand>(new { RecommendBrandID = id, SortId = sortValue })); }
//修改旗舰店模板编号 public int EditeMobileFlagShipStoreTempNO(int flagID, string tempNO) { return(DapperUtil.UpdatePartialColumns <SWfsBrandFlagShipStoreMobile>(new { FlagShipSotreID = flagID, TemplateNo = tempNO }) ? 1 : 0); }
/// <summary> /// 商品排序操作 /// </summary> /// <param name="id"></param> /// <param name="sortValue"></param> /// <returns></returns> public bool EditeBrandSortValue(int id, int sortValue) { return(DapperUtil.UpdatePartialColumns <SWfsIndexNewArrivalProductList>(new { NewArrivalProductListId = id, SortValue = sortValue })); }
/// <summary> /// 保存会场HTML /// </summary> /// <param name="obj">会场html信息</param> /// <param name="ispre">是否预热</param> /// <param name="ismobile">是否移动端</param> /// <returns></returns> public bool SaveVenueHtml(SWfsMeetingInfoHtml obj, int ispre, int ismobile) { if (obj.ID == 0) { return(false); } if (ispre == 0 && ismobile == 0)//移动端预热 { return(DapperUtil.UpdatePartialColumns <SWfsMeetingInfoHtml>(new { ID = obj.ID, MobilePreViewCode = obj.MobilePreViewCode, TemplateType = obj.TemplateType, IsPublish = obj.IsPublish, UpdateDate = obj.UpdateDate, UpdateUserId = obj.UpdateUserId })); } else if (ispre == 1 && ismobile == 0)//移动端开始 { return(DapperUtil.UpdatePartialColumns <SWfsMeetingInfoHtml>(new { ID = obj.ID, MobileStartCode = obj.MobileStartCode, TemplateType = obj.TemplateType, IsPublish = obj.IsPublish, UpdateDate = obj.UpdateDate, UpdateUserId = obj.UpdateUserId })); } else if (ispre == 0 && ismobile == 1)//web端预热 { return(DapperUtil.UpdatePartialColumns <SWfsMeetingInfoHtml>(new { ID = obj.ID, WebPreViewCode = obj.WebPreViewCode, TemplateType = obj.TemplateType, IsPublish = obj.IsPublish, UpdateDate = obj.UpdateDate, UpdateUserId = obj.UpdateUserId })); } else //web端开始 { return(DapperUtil.UpdatePartialColumns <SWfsMeetingInfoHtml>(new { ID = obj.ID, WebStartCode = obj.WebStartCode, TemplateType = obj.TemplateType, IsPublish = obj.IsPublish, UpdateDate = obj.UpdateDate, UpdateUserId = obj.UpdateUserId })); } }
//修改结构的父类 public int EditeStructParent(int parentStructId, string structName, string productNo) { return(DapperUtil.UpdatePartialColumns <SWfsProductRefTemplate>(new { ProductRefTemplateID = parentStructId, ProductNo = productNo, ModuleName = structName, })?1:0); }
public bool MobileAdModify(string id, string status, string updateUserId, DateTime updateDate) { return(DapperUtil.UpdatePartialColumns <SWfsMobileAd>(new { ID = id, UpdateUserId = updateUserId, UpdateDate = updateDate, Status = status })); }
//修改标签 public int EditeLabel(SWfsProductLabel obj) { //验证是否存在重复标签 return(DapperUtil.UpdatePartialColumns <SWfsProductLabel>(new { LabelId = obj.LabelId, LabelName = obj.LabelName, LabelType = obj.LabelType, LabelNickName = obj.LabelNickName }) ? 1 : 0); }
//添加所选商品 public bool AddAboutProduct(int flagNo, string pIdList, int order) { if (order == 1) { return(DapperUtil.UpdatePartialColumns <SWfsBrandFlagShipStoreSave>(new { FlagShipStoreId = flagNo, ProductNos1 = pIdList })); } else { return(DapperUtil.UpdatePartialColumns <SWfsBrandFlagShipStoreSave>(new { FlagShipStoreId = flagNo, ProductNos2 = pIdList })); } }
//修改商品所选择的模板编号 public int EditeProductTemplateNO(int id, string tempNO) { string templateCode = GetTemplateCodeByTempNO(tempNO);//按模板编号获取模板代码 return(DapperUtil.UpdatePartialColumns <SWfsProductRef>(new { RefID = id, TemplateNO = tempNO == null ? "" : tempNO, HTMLCode = templateCode == null ? "" : templateCode }) ? 1 : 0); }
/// <summary> /// 修改活动图 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool UpdateStyleActivityPic(SWfsStyleActivityPic model) { return(DapperUtil.UpdatePartialColumns <SWfsStyleActivityPic>(new { SAID = model.SAID, ActivityName = model.ActivityName, PicNo = model.PicNo, PicUrl = model.PicUrl, StartTime = model.StartTime, CreateUserId = model.CreateUserId })); }
/// <summary> /// 移动导航信息 /// </summary> /// <param name="newid"></param> /// <param name="newsortid"></param> /// <returns></returns> public int MoveNaviga(string newid, string newsortid) { int result = 0; result = DapperUtil.UpdatePartialColumns <SWfsNavigationManage>(new { NavigationId = Convert.ToInt32(newid), SortId = Convert.ToInt32(newsortid) }) == true ? 1 : 0; return(result); }
public bool UpdateCommentRContentById(string commentId, string commentRContent, string reType) { //return DapperUtil.Execute("ComBeziWfs_SWfsProductComment_UpdateCommentRContent", new { CommentId = commentId, CommentRContent = commentRContent}); if (reType == "result") { return(DapperUtil.UpdatePartialColumns <SWfsProductComment>(new { CommentId = commentId, ResultCode = commentRContent, ResultDate = DateTime.Now, ResultNo = PresentationHelper.GetPassport().UserName })); } else { return(DapperUtil.UpdatePartialColumns <SWfsProductComment>(new { CommentId = commentId, CommentRContent = commentRContent, CommentRDate = DateTime.Now, OperateUserId = PresentationHelper.GetPassport().UserName })); } }
//发布旗舰店 public int SaveVenueHtml(int flagID, string htmlcode) { if (flagID == 0) { return(0); } return(DapperUtil.UpdatePartialColumns <SWfsBrandFlagShipStoreMobile>(new { FlagShipSotreID = flagID, HtmlCode = htmlcode, CreateDate = DateTime.Now, }) ? 1 : 0); }
/// <summary> /// 更新或添加楼层连接 /// </summary> /// <param name="links"></param> public void InsertOrUpdateFloorSWfsIndexModuleLink(List <SWfsIndexModuleLink> links) { foreach (SWfsIndexModuleLink item in links) { if (item.LinkId > 0) { DapperUtil.UpdatePartialColumns <SWfsIndexModuleLink>(item); } else { DapperUtil.Insert <SWfsIndexModuleLink>(item); } } }
public bool UpdateAppAlterPic(SWfsAppAlterPic entity) { return(DapperUtil.UpdatePartialColumns <SWfsAppAlterPic>(new { AppSlterPicId = entity.AppSlterPicId, Name = entity.Name, PicNo = entity.PicNo, RefContent = entity.RefContent, AlterType = entity.AlterType, RefType = entity.RefType, Sort = entity.Sort, StartTime = entity.StartTime })); }
//SWfsAppShopCategory public void aa(string namea) { //查询 Dictionary <string, object> dic = new Dictionary <string, object>();//用来拼接sql语句 dic.Add("bbb", "0000"); DapperUtil.Query <string>("ComBeziWfs_Brand_get", dic, new { name = namea }); DapperUtil.Execute("bbb", dic); //执行sql语句 DapperUtil.Insert <SWfsProductLabel>(new SWfsProductLabel()); //插入数据 DapperUtil.UpdatePartialColumns <SWfsProductLabel>(new //修改部分字段 到数据库 { LabelId = 12, //第一个一定放主键 name = '"' }); }
/// <summary> /// 更新楼层排序 /// </summary> /// <param name="moduls"></param> public int UpdateSWfsIndexModuleSort(List <SWfsIndexModule> moduls) { try { foreach (SWfsIndexModule item in moduls) { DapperUtil.UpdatePartialColumns <SWfsIndexModule>(new { item.ModuleId, item.Sort, item.Stutas }); } } catch (Exception) { return(0); } return(1); }
/// <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); } }
//编辑商品推荐内容 public int EditeProductRefContent(SWfsProductRef obj) { if (obj.TemplateNO == null) { obj.TemplateNO = ""; } Passport passport = PresentationHelper.GetPassport(); return(DapperUtil.UpdatePartialColumns <SWfsProductRef>(new { RefID = obj.RefID, EditeDate = DateTime.Now, EditePeople = (passport == null?"":passport.UserName), HTMLCode = obj.HTMLCode, HTMLCodeMobile = obj.HTMLCodeMobile, }) ? 1 : 0); }
//编辑模板模板 public int EditeProductTemplate(SWfsProductTemplate obj) { if (obj.TemplateCode == null) { obj.TemplateCode = ""; } if (obj.TemplateCodeMobile == null) { obj.TemplateCodeMobile = ""; } if (string.IsNullOrEmpty(obj.TemplateNO)) { return(0); } if (obj.TemplateID == 0) { if (IsExistsTemplateNO(obj.TemplateNO) > 0) { return(-1); } if (IsExistsTemplateName(obj.TemplateName).Count() > 0) { return(-2); } obj.CreateDate = DateTime.Now; return(DapperUtil.Insert <SWfsProductTemplate>(obj, true)); } else { IEnumerable <int> isExists = IsExistsTemplateName(obj.TemplateName); if (isExists.Count(p => p != obj.TemplateID) > 0) { return(-2); } return(DapperUtil.UpdatePartialColumns <SWfsProductTemplate>(new { TemplateID = obj.TemplateID, TemplateNO = obj.TemplateNO, TemplateName = obj.TemplateName, TemplateDirection = obj.TemplateDirection, TemplateCode = obj.TemplateCode, TemplateCodeMobile = obj.TemplateCodeMobile }) ? 1 : 0); } }
/// <summary> /// 如果添加品牌存在(或被逻辑删除),则更新品牌状态 /// </summary> /// <param name="recommendBrand"></param> /// <param name="userId"></param> /// <returns></returns> private bool UpdateSWfsSpChannelRecommendBrand(SWfsSpHomeRecommendBrand recommendBrand, string userId) { var dic = new Dictionary <string, object>(); dic.Add("PageNo", recommendBrand.PageNo); dic.Add("PagePositionNo", recommendBrand.PagePositionNo); dic.Add("BrandNO", recommendBrand.IsRecommendBrand == 1 ? "" : recommendBrand.BrandNO); dic.Add("IsRecommendBrand", recommendBrand.IsRecommendBrand); //查询品牌 var originalBrand = DapperUtil.Query <SWfsSpHomeRecommendBrand>("ComBeziWfs_SWfsSpHomeRecommendBrand_GetRecommendBrand", dic, new { PageNo = recommendBrand.PageNo, PagePositionNo = recommendBrand.PagePositionNo, BrandNO = recommendBrand.BrandNO, IsRecommendBrand = recommendBrand.IsRecommendBrand }).FirstOrDefault(); //如果存在则修改,如果不存在则返回 if (originalBrand == null) { return(true); } else { var result = DapperUtil.UpdatePartialColumns <SWfsSpHomeRecommendBrand>(new { RecommendBrandID = originalBrand.RecommendBrandID, Status = recommendBrand.Status, DataState = 1, UpdateOperateUserId = userId, UpdateDate = DateTime.Now, SortId = 0, PictureFileNo = recommendBrand.PictureFileNo, BrandNo = recommendBrand.BrandNO, DateBegin = recommendBrand.DateBegin, PictureIndex = recommendBrand.PictureIndex, PictureFileTitle = recommendBrand.PictureFileTitle }); return(false); } }
public bool UpdateASWfsProductCommentStatus(int verify, int commentId, int status) { if (status == 0) { //隐藏状态,已经审核通过,某种原因把它隐藏了。所以修改为审核通过显示状态 return(DapperUtil.UpdatePartialColumns <SWfsProductComment>(new { CommentId = commentId, Status = 1 })); } else if (status == 1) { //显示状态,只能隐藏 return(DapperUtil.UpdatePartialColumns <SWfsProductComment>(new { CommentId = commentId, Status = 0 })); } else {//待审核状态:审核通过修改为审核通过并显示状态,如果不通过状态不变(待审核) if (verify == 1) { return(DapperUtil.UpdatePartialColumns <SWfsProductComment>(new { CommentId = commentId, Status = 1 })); } } UpdateSWfsProductCommentOperateUserId(commentId, PresentationHelper.GetPassport().UserName); //return DapperUtil.UpdatePartialColumns<SWfsProductComment>(new { CommentId = commentId, Status = status }); return(false); }
//修改结构的子类 public int EditeStructChild(IEnumerable <SWfsProductRefTemplate> region) { for (int i = 0; i < region.Count(); i++) { if (region.ElementAt(i).ModuleStatus == 0) { region.ElementAt(i).TemplateHtmlCode = ""; region.ElementAt(i).TemplateHtmlCodeMobile = ""; } DapperUtil.UpdatePartialColumns <SWfsProductRefTemplate>(new { ProductRefTemplateID = region.ElementAt(i).ProductRefTemplateID, ModuleName = region.ElementAt(i).ModuleName, ModuleStatus = region.ElementAt(i).ModuleStatus, TemplateNo = region.ElementAt(i).TemplateNo, ProductNo = region.ElementAt(i).ProductNo, Sort = region.ElementAt(i).Sort, TemplateHtmlCode = region.ElementAt(i).TemplateHtmlCode.Trim(), TemplateHtmlCodeMobile = region.ElementAt(i).TemplateHtmlCodeMobile.Trim() }); } return(1); }
//修改操作者名称 public bool UpdateSWfsQuestAnswerOperateUserId(int questAnswerId, string userName) { return(DapperUtil.UpdatePartialColumns <SWfsQuestAnswer>(new { QuestAnswerId = questAnswerId, OperateUserId = userName })); }
//修改咨询前台显示状态 public bool UpdateSWfsQuestAnswerIsShow(int questAnswerId, int isShow) { UpdateSWfsQuestAnswerOperateUserId(questAnswerId, PresentationHelper.GetPassport().UserName); return(DapperUtil.UpdatePartialColumns <SWfsQuestAnswer>(new { QuestAnswerId = questAnswerId, IsShow = isShow })); }