//保存区块关联 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)); } }
//关联设置 public bool UpdateNavigateRelationShip(SWfsBrandNavigation obj) { return(DapperUtil.UpdatePartialColumns <SWfsBrandNavigation>(new { NavigationId = obj.NavigationId, RefType = obj.RefType, RefContent = obj.RefContent })); }
//更改从属 public bool UpdateNavigateParent(SWfsBrandNavigation obj) { return(DapperUtil.UpdatePartialColumns <SWfsBrandNavigation>(new { NavigationId = obj.NavigationId, ParentId = obj.ParentId, Sort = obj.Sort })); }
//隐藏导航 public bool HiddenNavigate(SWfsBrandNavigation obj) { return(DapperUtil.UpdatePartialColumns <SWfsBrandNavigation>(new { NavigationId = obj.NavigationId, VisibleStatus = obj.VisibleStatus })); }
//修改导航名称 public bool UpdateNavigateName(SWfsBrandNavigation obj) { return(DapperUtil.UpdatePartialColumns <SWfsBrandNavigation>(new { NavigationId = obj.NavigationId, NavigationName = obj.NavigationName })); }
//增加导航 public int InsertNavigate(SWfsBrandNavigation obj) { return(DapperUtil.Insert <SWfsBrandNavigation>(obj, true)); }