protected void btnOK_Click(object sender, EventArgs e)
    {
        Page.Validate("vgGroup");
            if (Page.IsValid)
            {
                try
                {
                    GroupEntity oGroup = new GroupEntity();
                    oGroup.sName = txtGroupName.Text;
                    oGroup.sDesc = txtGroupDesc.Text;

                    if (bAddnew == false && btnOK.CommandName.ToUpper() == "EDIT")
                    {
                        oGroup.iGroupID = Convert.ToInt32(btnOK.CommandArgument);
                        GroupBRL.Edit(oGroup);
                        lblThongbao.Text = "Cập nhật thành công";
                    }
                    else if(btnOK.CommandName.ToUpper()=="ADDNEW")
                    {
                            GroupBRL.Add(oGroup);
                            lblThongbao.Text = "Thêm nhóm thành công";
                    }
                }
                catch (Exception ex)
                {
                    //lblThongbao.Text = ex.Message;
                    Response.Write("<script language=\"javascript\">alert('" + ex.Message + "');location='Default.aspx?page=Group';</script>");
                }
            }
    }
示例#2
0
 /// <summary>
 /// Kiểm tra và thêm mới Group
 /// </summary>
 /// <param name="entity">Entity</param>
 /// <returns>Int32: ID của Group Mới Thêm Vào</returns>
 public static Int32 Add(GroupEntity entity)
 {
     checkLogic(entity);
     checkDuplicate(entity, false);
     checkFK(entity);
     return GroupDAL.Add(entity);
 }
示例#3
0
        /// <summary>
        /// 动态处理程序
        /// </summary>
        /// <param name="group"></param>
        /// <param name="eventArgs"></param>
        private void GroupEntityActivityModule_After(GroupEntity group, AuditEventArgs eventArgs)
        {
            //生成动态
            ActivityService activityService = new ActivityService();
            AuditService auditService = new AuditService();
            bool? auditDirection = auditService.ResolveAuditDirection(eventArgs.OldAuditStatus, eventArgs.NewAuditStatus);
            if (auditDirection == true) //生成动态
            {
                if (group == null)
                    return;

                //生成Owner为用户的动态
                Activity actvityOfBar = Activity.New();
                actvityOfBar.ActivityItemKey = ActivityItemKeys.Instance().CreateGroup();
                actvityOfBar.ApplicationId = GroupConfig.Instance().ApplicationId;
                actvityOfBar.IsOriginalThread = true;
                actvityOfBar.IsPrivate = !group.IsPublic;
                actvityOfBar.UserId = group.UserId;
                actvityOfBar.ReferenceId = 0;//没有涉及到的实体
                actvityOfBar.ReferenceTenantTypeId = string.Empty;
                actvityOfBar.SourceId = group.GroupId;
                actvityOfBar.TenantTypeId = TenantTypeIds.Instance().Group();
                actvityOfBar.OwnerId = group.UserId;
                actvityOfBar.OwnerName = group.User.DisplayName;
                actvityOfBar.OwnerType = ActivityOwnerTypes.Instance().User();

                activityService.Generate(actvityOfBar, true);
            }
            else if (auditDirection == false) //删除动态
            {
                activityService.DeleteSource(TenantTypeIds.Instance().Group(), group.GroupId);
            }
        }
示例#4
0
 /// <summary>
 /// Kiểm tra và chỉnh sửa Group
 /// </summary>
 /// <param name="entity">GroupEntity</param>
 /// <returns>bool:kết quả thực hiện</returns>
 public static bool Edit(GroupEntity entity)
 {
     checkExist(entity.iGroupID);
     checkLogic(entity);
     checkDuplicate(entity, true);
     checkFK(entity);
     return GroupDAL.Edit(entity);
 }
示例#5
0
        public async Task <IActionResult> AddGroup(GroupViewModel model)
        {
            if (ModelState.IsValid)
            {
                GroupEntity groupEntity = await _converterHelper.ToGroupEntityAsync(model, true);

                _context.Add(groupEntity);
                await _context.SaveChangesAsync();

                return(RedirectToAction($"{nameof(Details)}/{model.TournamentId}"));
            }

            return(View(model));
        }
 public static bool TryGetGroupByUnsafeSlot(this Client client, short slot, out GroupEntity group, out WorkerModel worker)
 {
     group  = null;
     worker = null;
     if (slot > 0 || slot <= 3)
     {
         AccountEntity accountEntity = client.GetAccountEntity();
         slot--; // slot-- żeby numerowanie dla graczy było od 1 do 3
         List <GroupEntity> groups = EntityHelper.GetPlayerGroups(accountEntity).ToList();
         group  = slot < groups.Count ? groups[slot] : null;
         worker = accountEntity.CharacterEntity.DbModel.Workers.SingleOrDefault(g => g.Id == groups[slot].Id);
     }
     return(group != null && worker != null);
 }
示例#7
0
        public ActionResult _GroupActivities(string spaceKey)
        {
            GroupEntity group = groupService.Get(spaceKey);

            if (group == null)
            {
                return(HttpNotFound());
            }

            IEnumerable <ApplicationBase> applications = applicationService.GetInstalledApplicationsOfOwner(PresentAreaKeysOfBuiltIn.GroupSpace, group.GroupId);

            ViewData["applications"] = applications;
            return(View(group));
        }
示例#8
0
        /// <summary>
        /// 添加用户组
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public GroupDto Intsert(GroupInput input)
        {
            GroupEntity group = new GroupEntity
            {
                Id   = Guid.NewGuid().ToString(),
                Name = input.Name
            };
            var      result = _iGroupRepository.Insert(group);
            GroupDto ret    = new GroupDto();

            ret.Id   = result.Id;
            ret.Name = result.Name;
            return(ret);
        }
示例#9
0
        private GroupResponse ToGroupResponse(GroupEntity groupEntity)
        {
            if (groupEntity == null)
            {
                return(null);
            }

            return(new GroupResponse
            {
                Id = groupEntity.Id,
                Name = groupEntity.Name,
                Tournament = ToTournamentResponse(groupEntity.Tournament)
            });
        }
示例#10
0
        public Result <GroupEntity> Get(BaseSpecification <GroupEntity> baseSpecification)
        {
            baseSpecification = ApplayGroupFilter(baseSpecification);

            GroupEntity group = _groupRepository.SingleOrDefault(baseSpecification);

            if (group == null)
            {
                _logger.LogError($"No group. GroupId");
                return(Result.Fail <GroupEntity>("no_group", "No Group"));
            }

            return(Result.Ok(group));
        }
示例#11
0
        public ActionResult _ChangeGroupOwner(string spaceKey, string returnUrl)
        {
            GroupEntity group = groupService.Get(spaceKey);

            if (group == null)
            {
                return(Content(string.Empty));
            }



            ViewData["returnUrl"] = WebUtility.UrlDecode(returnUrl);
            return(View(group));
        }
示例#12
0
        /// <summary>
        /// This method is used to retreive a single GroupEntity by it Primary Key
        /// </summary>
        /// <param name="uID">Unique ID</param>
        /// <returns>An entity if found, null if nothing found.</returns>
        public static GroupEntity SelectSingle(int uID)
        {
            GroupEntity       grp = new GroupEntity(uID);
            DataAccessAdapter ds  = new DataAccessAdapter();

            if (ds.FetchEntity(grp) == true)
            {
                return(grp);
            }
            else
            {
                return(null);
            }
        }
示例#13
0
 public async Task Delete(GroupEntity group)
 {
     await Task.Run(() =>
     {
         IList <MessageEntity> messageList = Database.Where(a => a.IdGroup == group.Id).ToList();
         if (messageList?.Count > 0)
         {
             foreach (MessageEntity message in messageList)
             {
                 Database.Remove(message);
             }
         }
     });
 }
        public ActionResult _GroupInfo(string spaceKey, bool?showGroupLogo)
        {
            long        groupId = GroupIdToGroupKeyDictionary.GetGroupId(spaceKey);
            GroupEntity group   = groupService.Get(groupId);

            if (group == null)
            {
                return(Content(string.Empty));
            }

            ViewData["showGroupLogo"] = showGroupLogo;

            return(View(group));
        }
示例#15
0
        public async Task <IActionResult> EditGroup(GroupViewModel model)
        {
            if (ModelState.IsValid)
            {
                GroupEntity groupEntity = await _converterHelper.ToGroupEntityAsync(model, false);

                _context.Update(groupEntity);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Details", new { id = model.TournamentId }));
            }

            return(View(model));
        }
示例#16
0
 public async Task Delete(GroupEntity group)
 {
     await Task.Run(() =>
     {
         IList <PersonEntity> personList = Database.Where(a => a.IdGroup == group.Id).ToList();
         if (personList?.Count > 0)
         {
             foreach (PersonEntity person in personList)
             {
                 Database.Remove(person);
             }
         }
     });
 }
示例#17
0
        private async Task CheckMatchesAsync()
        {
            var startDate = DateTime.Today.AddMonths(2).ToUniversalTime();

            if (!_context.Matches.Any())
            {
                GroupEntity    group     = _context.Groups.FirstOrDefault(t => t.Id == 1);
                DateNameEntity dateName1 = _context.DateNames.FirstOrDefault(t => t.Id == 1);

                DateTime   date1    = startDate.AddHours(14);
                TeamEntity local1   = _context.Teams.FirstOrDefault(t => t.Name == "Argentina");
                TeamEntity visitor1 = _context.Teams.FirstOrDefault(t => t.Name == "Bolivia");
                AddMatch(group, dateName1, date1, local1, visitor1);

                DateTime   date2    = startDate.AddHours(16);
                TeamEntity local2   = _context.Teams.FirstOrDefault(t => t.Name == "Brasil");
                TeamEntity visitor2 = _context.Teams.FirstOrDefault(t => t.Name == "Chile");
                AddMatch(group, dateName1, date2, local2, visitor2);



                DateNameEntity dateName2 = _context.DateNames.FirstOrDefault(t => t.Id == 2);

                DateTime   date3    = startDate.AddHours(62);
                TeamEntity local3   = _context.Teams.FirstOrDefault(t => t.Name == "Argentina");
                TeamEntity visitor3 = _context.Teams.FirstOrDefault(t => t.Name == "Brasil");
                AddMatch(group, dateName2, date3, local3, visitor3);

                DateTime   date4    = startDate.AddHours(64);
                TeamEntity local4   = _context.Teams.FirstOrDefault(t => t.Name == "Bolivia");
                TeamEntity visitor4 = _context.Teams.FirstOrDefault(t => t.Name == "Chile");
                AddMatch(group, dateName2, date4, local4, visitor4);


                DateNameEntity dateName3 = _context.DateNames.FirstOrDefault(t => t.Id == 3);

                DateTime   date5    = startDate.AddHours(110);
                TeamEntity local5   = _context.Teams.FirstOrDefault(t => t.Name == "Argentina");
                TeamEntity visitor5 = _context.Teams.FirstOrDefault(t => t.Name == "Chile");
                AddMatch(group, dateName3, date3, local5, visitor5);

                DateTime   date6    = startDate.AddHours(112);
                TeamEntity local6   = _context.Teams.FirstOrDefault(t => t.Name == "Bolivia");
                TeamEntity visitor6 = _context.Teams.FirstOrDefault(t => t.Name == "Brasil");
                AddMatch(group, dateName3, date4, local6, visitor6);

                await _context.SaveChangesAsync();
            }
        }
示例#18
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            RequiresAuthorizationOrManagedGroup(AuthorizationStrings.UpdateGroup, Group.Id);
            var group = new GroupEntity
            {
                Id          = Group.Id,
                Name        = txtGroupName.Text,
                Type        = Group.Type,
                Description = txtGroupDesc.Text
            };

            var result = Call.GroupApi.Put(group.Id, group);

            EndUserMessage = !result.Success ? result.ErrorMessage : "Successfully Updated Group";
        }
示例#19
0
        /// <summary>
        /// This function is used to insert a GroupEntity in the storage area.
        /// </summary>
        /// <param name="siteuid">The site UID</param>
        /// <param name="name">The Name</param>
        /// <param name="isbuiltin">The Is Built-In Flag</param>
        /// <param name="ishidden">The Is Hidden Flag</param>
        /// <param name="isdisabled">The Is Disabled</param>
        /// <param name="emailaddress">The Email Address</param>
        /// <param name="owneruid">The Owner UID</param>
        /// <returns>True on success, False on fail</returns>
        public static bool Insert(System.Int32 siteuid, System.String name, System.Boolean isbuiltin, System.Boolean ishidden, System.Boolean isdisabled, System.String emailaddress, System.Int32 owneruid)
        {
            GroupEntity ge = new GroupEntity();

            ge.SiteUID      = siteuid;
            ge.Name         = name;
            ge.IsBuiltin    = isbuiltin;
            ge.IsHidden     = ishidden;
            ge.IsDisabled   = isdisabled;
            ge.EmailAddress = emailaddress;
            ge.OwnerUID     = owneruid;
            DataAccessAdapter ds = new DataAccessAdapter();

            return(ds.SaveEntity(ge));
        }
示例#20
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     Group = !string.IsNullOrEmpty(Request["groupid"])
         ? Call.GroupApi.Get(Convert.ToInt32(Request.QueryString["groupid"]))
         : null;
     if (Group == null)
     {
         RequiresAuthorization(AuthorizationStrings.SearchGroup);
     }
     else
     {
         RequiresAuthorizationOrManagedGroup(AuthorizationStrings.ReadGroup, Group.Id);
     }
 }
示例#21
0
        public IActionResult Create([FromBody] GroupDto model)
        {
            var entry = new GroupEntity {
                Name = model.Name
            };

            try{
                _context.Groups.Add(entry);
                _context.SaveChanges();
                return(CreatedAtRoute("GetGroup", new { id = entry.Id }, entry));
            } catch {
                Console.WriteLine("error");
                throw;
            }
        }
        public AzureADGroup GetDeletedGroup(string accessToken)
        {
            GroupEntity group = null;

            if (Group != null)
            {
                group = GroupsUtility.GetDeletedGroup(Group.Id, accessToken);
            }
            else if (!string.IsNullOrEmpty(GroupId))
            {
                group = GroupsUtility.GetDeletedGroup(GroupId, accessToken);
            }

            return(AzureADGroup.CreateFrom(group));
        }
示例#23
0
        public void Should_Map_GroupEntity_To_GroupModel()
        {
            var groupEntity = new GroupEntity()
            {
                Id          = 1,
                Name        = "GroupA",
                CreatedDate = DateTime.Now,
                UpdatedDate = DateTime.Now
            };

            var groupModel = _mapper.Map <GroupModel>(groupEntity);

            Assert.Equal(groupEntity.Id, groupModel.Id);
            Assert.Equal(groupEntity.Name, groupModel.Name);
        }
示例#24
0
        public async Task <GroupEntity> GetGroupInfo(string chatId)
        {
            var info = await GetGroupEntity(chatId);

            if (info == null)
            {
                info = new GroupEntity
                {
                    ChatId = chatId
                };
                _context.Groups.Add(info);
                await _context.SaveChangesAsync();
            }
            return(info);
        }
示例#25
0
        ///<summary>
        ///新增
        ///</summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Add(GroupEntity model)
        {
            string strSql = @"insert into Tb_Group values(@Name,@Permission,@DTCreated,@UserID,@Role)";
            Dictionary <string, object> paramDic = new Dictionary <string, object>();

            paramDic.Add("Name", model.Name);
            paramDic.Add("Permission", model.Permission);
            paramDic.Add("DTCreated", model.DTCreated);
            paramDic.Add("UserID", model.UserID);
            paramDic.Add("Role", model.Role);

            int effectLine = db.Execute(strSql);

            return(effectLine > 0?true:false);
        }
        public async Task <IActionResult> Edit(int id, GroupEntity groupEntity)
        {
            if (id != groupEntity.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                await _groupHttpService.UpdateAsync(groupEntity);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(groupEntity));
        }
示例#27
0
 //Constructor For Starting Multicast For On Demand
 public Multicast(int imageProfileId, string clientCount, int userId, string userIp, int clusterId)
 {
     _multicastSession = new ActiveMulticastSessionEntity();
     _isOnDemand       = true;
     _imageProfile     = new ImageProfileServices().ReadProfile(imageProfileId);
     _clientCount      = clientCount;
     _group            = new GroupEntity {
         ImageProfileId = _imageProfile.Id
     };
     _userId = userId;
     _multicastSession.ImageProfileId = _imageProfile.Id;
     _computerServices = new ComputerServices();
     _ipAddress        = userIp;
     _clusterId        = clusterId;
 }
示例#28
0
        public IActionResult Post([FromBody] GroupEntity value)
        {
            var currentUser = HttpContext.User.Identity.Name;

            if (!_securityRepository.UserIsAdmin(HttpContext))
            {
                return(_securityRepository.Gate(GateType.Unathorised, AccessLogAction.GroupCreate, currentUser, _object, string.Empty));
            }

            _groupRepository.Add(value);
            _securityRepository.LogUserAction(currentUser, AccessLogAction.GroupCreate, value.Name, _object, true);
            _groupRepository.SaveChanges();

            return(Ok(value));
        }
示例#29
0
        public ActionResult _ValidateQuestion(long groupId, string myAnswer)
        {
            StatusMessageData message = null;
            GroupEntity       group   = groupService.Get(groupId);

            if (group == null)
            {
                return(Json(new StatusMessageData(StatusMessageType.Error, "找不到群组!")));
            }


            //已修改
            IUser currentUser = UserContext.CurrentUser;

            if (currentUser == null)
            {
                return(Json(new StatusMessageData(StatusMessageType.Error, "您尚未登录!")));
            }
            if (group.JoinWay != JoinWay.ByQuestion)
            {
                return(Json(new StatusMessageData(StatusMessageType.Error, "当前加入方式不是问题验证")));
            }


            bool isMember = groupService.IsMember(group.GroupId, currentUser.UserId);

            if (!isMember)
            {
                if (group.Answer == myAnswer)
                {
                    GroupMember member = GroupMember.New();
                    member.UserId    = UserContext.CurrentUser.UserId;
                    member.GroupId   = group.GroupId;
                    member.IsManager = false;
                    groupService.CreateGroupMember(member);
                    message = new StatusMessageData(StatusMessageType.Success, "加入群组成功!");
                }
                else
                {
                    message = new StatusMessageData(StatusMessageType.Error, "答案错误!");
                }
            }
            else
            {
                message = new StatusMessageData(StatusMessageType.Hint, "您已加入过该群组!");
            }
            return(Json(message));
        }
示例#30
0
        /// <summary>
        /// 贴吧所在呈现区域拥有者自动创建贴吧事件
        /// </summary>
        /// <param name="sender">群组实体</param>
        /// <param name="eventArgs">事件参数</param>
        void AutoMaintainBarSectionModule_After(GroupEntity sender, CommonEventArgs eventArgs)
        {
            BarSectionService barSectionService = new BarSectionService();

            if (eventArgs.EventOperationType == EventOperationType.Instance().Create())
            {
                BarSection barSection = BarSection.New();

                barSection.TenantTypeId         = TenantTypeIds.Instance().Group();
                barSection.SectionId            = sender.GroupId;
                barSection.OwnerId              = sender.GroupId;
                barSection.UserId               = sender.UserId;
                barSection.Name                 = sender.GroupName;
                barSection.IsEnabled            = true;
                barSection.LogoImage            = sender.Logo;
                barSection.ThreadCategoryStatus = ThreadCategoryStatus.NotForceEnabled;
                barSectionService.Create(barSection, sender.UserId, null, null);
            }
            else if (eventArgs.EventOperationType == EventOperationType.Instance().Update())
            {
                BarSection barSection = barSectionService.Get(sender.GroupId);
                barSection.UserId    = sender.UserId;
                barSection.Name      = sender.GroupName;
                barSection.LogoImage = sender.Logo;

                IList <long> managerIds = null;
                if (barSection.SectionManagers != null)
                {
                    managerIds = barSection.SectionManagers.Select(n => n.UserId).ToList();
                }
                barSectionService.Update(barSection, sender.UserId, managerIds, null);
            }
            else if (eventArgs.EventOperationType == EventOperationType.Instance().Approved() || eventArgs.EventOperationType == EventOperationType.Instance().Disapproved())
            {
                BarSection barSection = barSectionService.Get(sender.GroupId);
                barSection.AuditStatus = sender.AuditStatus;
                IList <long> managerIds = null;
                if (barSection.SectionManagers != null)
                {
                    managerIds = barSection.SectionManagers.Select(n => n.UserId).ToList();
                }
                barSectionService.Update(barSection, sender.UserId, managerIds, null);
            }
            else
            {
                barSectionService.Delete(sender.GroupId);
            }
        }
示例#31
0
        public void TestSelectByAliasReturnsNull()
        {
            UserGroupLinkEntity groupLink = null;
            GroupEntity         group     = null;

            GroupEntity[] stuff1 = Query <UserEntity>()
                                   .Inner.Join(x => x.Groups, () => groupLink)
                                   .Inner.Join(x => groupLink.Group, () => group)
                                   .Select(x => group)
                                   .ToArray();

            foreach (GroupEntity item in stuff1)
            {
                Assert.That(item, Is.Null);
            }
        }
示例#32
0
        /// <summary>
        /// 删除群组是删除贴吧相关的
        /// </summary>
        /// <param name="group"></param>
        /// <param name="eventArgs"></param>
        private void DeleteGroup_Before(GroupEntity group, CommonEventArgs eventArgs)
        {
            if (eventArgs.EventOperationType == EventOperationType.Instance().Delete())
            {
                BarPostService            barPostService   = new BarPostService();
                BarThreadService          barThreadService = new BarThreadService();
                PagingDataSet <BarThread> barThreads       = barThreadService.Gets(group.GroupId);

                new BarSectionService().Delete(group.GroupId);
                barThreadService.DeletesBySectionId(group.GroupId);
                foreach (var barThread in barThreads)
                {
                    barPostService.DeletesByThreadId(barThread.ThreadId);
                }
            }
        }
示例#33
0
        public void CanInnerJoinOnInnerJoinedEntityUsingString()
        {
            UserGroupLinkEntity link  = null;
            GroupEntity         group = null;

            IDetachedFlowQuery <UserEntity> query = DetachedQuery <UserEntity>()
                                                    .Inner.Join("Groups", () => link)
                                                    .Inner.Join("link.Group", () => group)
                                                    .Distinct().Select(u => group.Name);

            FlowQuerySelection <GroupEntity> groups = Query <GroupEntity>()
                                                      .Where(g => g.Name, FqIs.In(query))
                                                      .Select();

            Assert.That(groups.Count(), Is.EqualTo(2));
        }
示例#34
0
        public void CanRightOuterJoinWithProvidedRevealConvention()
        {
            UserGroupLinkEntity link  = null;
            GroupEntity         group = null;

            IDetachedFlowQuery <UserEntity> query = DetachedQuery <UserEntity>()
                                                    .RightOuter.Join(u => u.Groups, () => link)
                                                    .RightOuter.Join(u => link.Group, () => group, new CustomConvention(x => x))
                                                    .Select(u => group.Id);

            FlowQuerySelection <GroupEntity> groups = Query <GroupEntity>()
                                                      .Where(g => g.Id, FqIs.In(query))
                                                      .Select();

            Assert.That(groups.Count(), Is.EqualTo(2));
        }
示例#35
0
 /// <summary>
 /// 修改皮肤文件的使用人数
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="eventArgs"></param>
 private void ChangeThemeAppearanceUserCountModule_After(GroupEntity sender, CommonEventArgs eventArgs)
 {
     var themeService = new ThemeService();
     PresentAreaService presentAreaService = new PresentAreaService();
     if (eventArgs.EventOperationType == EventOperationType.Instance().Create())
     {
         var presentArea = presentAreaService.Get(PresentAreaKeysOfBuiltIn.GroupSpace);
         themeService.ChangeThemeAppearanceUserCount(PresentAreaKeysOfBuiltIn.GroupSpace, null, presentArea.DefaultThemeKey + "," + presentArea.DefaultAppearanceKey);
     }
     else if (eventArgs.EventOperationType == EventOperationType.Instance().Delete())
     {
         var presentArea = presentAreaService.Get(PresentAreaKeysOfBuiltIn.GroupSpace);
         string defaultThemeAppearance = presentArea.DefaultThemeKey + "," + presentArea.DefaultAppearanceKey;
         if (!sender.IsUseCustomStyle)
             themeService.ChangeThemeAppearanceUserCount(PresentAreaKeysOfBuiltIn.GroupSpace, !string.IsNullOrEmpty(sender.ThemeAppearance) ? sender.ThemeAppearance : defaultThemeAppearance, null);
     }
 }
        /// <summary>
        /// 群组操作日志事件处理
        /// </summary>
        private void GroupOperationLogEventModule_After(GroupEntity senders, CommonEventArgs eventArgs)
        {
            if (eventArgs.EventOperationType == EventOperationType.Instance().Delete()
               || eventArgs.EventOperationType == EventOperationType.Instance().Approved()
               || eventArgs.EventOperationType == EventOperationType.Instance().Disapproved()
               || eventArgs.EventOperationType == EventOperationType.Instance().SetEssential()
               || eventArgs.EventOperationType == EventOperationType.Instance().SetSticky()
               || eventArgs.EventOperationType == EventOperationType.Instance().CancelEssential()
               || eventArgs.EventOperationType == EventOperationType.Instance().CancelSticky())
            {
                OperationLogEntry entry = new OperationLogEntry(eventArgs.OperatorInfo);
                entry.ApplicationId = entry.ApplicationId;
                entry.Source = GroupConfig.Instance().ApplicationName;
                entry.OperationType = eventArgs.EventOperationType;
                entry.OperationObjectName = senders.GroupName;
                entry.OperationObjectId = senders.GroupId;
                entry.Description = string.Format(ResourceAccessor.GetString("OperationLog_Pattern_" + eventArgs.EventOperationType, entry.ApplicationId), "群组", entry.OperationObjectName);

                OperationLogService logService = Tunynet.DIContainer.Resolve<OperationLogService>();
                logService.Create(entry);
            }
        }
示例#37
0
 /// <summary>
 /// Kiểm tra tồn tại khóa ngoại
 /// </summary>
 /// <param name="entity">GroupEntity:entity</param>
 private static void checkFK(GroupEntity entity)
 {
 }
 protected string getGroupName(Object x)
 {
     int iGroupID = int.Parse(x.ToString());
     String sGroupName = string.Empty;
     GroupEntity oGrp = new GroupEntity();
     oGrp = GroupBRL.GetOne(iGroupID);
     if (oGrp != null)
         sGroupName = oGrp.sName;
     return sGroupName;
 }
示例#39
0
 /// <summary>
 /// Kiểm tra trùng lặp bản ghi
 /// </summary>
 /// <param name="entity">GroupEntity: GroupEntity</param>
 private static void checkDuplicate(GroupEntity entity,bool checkPK)
 {
     /*
     Example
     List<GroupEntity> list = GroupDAL.GetAll();
     if (list.Exists(
         delegate(GroupEntity oldEntity)
         {
             bool result =oldEntity.FIELD.Equals(entity.FIELD, StringComparison.OrdinalIgnoreCase);
             if(checkPK)
                 result=result && oldEntity.iGroupID != entity.iGroupID;
             return result;
         }
     ))
     {
         list.Clear();
         throw new Exception(EX_FIELD_EXISTED);
     }
     */
 }
示例#40
0
 /// <summary>
 /// 审核状态发生变化时处理积分
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="eventArgs"></param>
 private void GroupEntityPointModule_After(GroupEntity sender, AuditEventArgs eventArgs)
 {
     string pointItemKey = string.Empty;
     string eventOperationType = string.Empty;
     string description = string.Empty;
     ActivityService activityService = new ActivityService();
     AuditService auditService = new AuditService();
     PointService pointService = new PointService();
     bool? auditDirection = auditService.ResolveAuditDirection(eventArgs.OldAuditStatus, eventArgs.NewAuditStatus);
     if (auditDirection == true) //加积分
     {
         pointItemKey = PointItemKeys.Instance().Group_CreateGroup();
         if (eventArgs.OldAuditStatus == null)
             eventOperationType = EventOperationType.Instance().Create();
         else
             eventOperationType = EventOperationType.Instance().Approved();
     }
     else if (auditDirection == false) //减积分
     {
         pointItemKey = PointItemKeys.Instance().Group_DeleteGroup();
         if (eventArgs.NewAuditStatus == null)
             eventOperationType = EventOperationType.Instance().Delete();
         else
             eventOperationType = EventOperationType.Instance().Disapproved();
     }
     if (!string.IsNullOrEmpty(pointItemKey))
     {
         description = string.Format(ResourceAccessor.GetString("PointRecord_Pattern_" + eventOperationType), "群组", sender.GroupName);
     }
     pointService.GenerateByRole(sender.UserId, pointItemKey, description, eventOperationType == EventOperationType.Instance().Create() || eventOperationType == EventOperationType.Instance().Delete() && eventArgs.OperatorInfo.OperatorUserId == sender.UserId);
 }
示例#41
0
 /// <summary>
 /// 自动安装群组的相关应用
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="eventArgs"></param>
 private void InstallApplicationsModule_After(GroupEntity sender, CommonEventArgs eventArgs)
 {
     ApplicationService applicationService = new ApplicationService();
     if (eventArgs.EventOperationType == EventOperationType.Instance().Create())
     {
         applicationService.InstallApplicationsOfPresentAreaOwner(PresentAreaKeysOfBuiltIn.GroupSpace, sender.GroupId);
     }
     else if (eventArgs.EventOperationType == EventOperationType.Instance().Delete())
     {
         applicationService.DeleteApplicationsOfPresentAreaOwner(PresentAreaKeysOfBuiltIn.GroupSpace, sender.GroupId);
     }
 }
示例#42
0
 /// <summary>
 /// Kiểm tra logic Entity
 /// </summary>
 /// <param name="entity">GroupEntity: entity</param>
 private static void checkLogic(GroupEntity entity)
 {
     if (String.IsNullOrEmpty(entity.sName))
         throw new Exception(EX_SNAME_EMPTY);
 }