Ejemplo n.º 1
0
        public GroupResultModel CreateGroup(CreateGroupRequestModel param)
        {
            GroupResultModel result = new GroupResultModel();

            try
            {
                int?memberId = IdentityHelper.GetMemberId();
                if (!memberId.HasValue)
                {
                    throw new OrgException("Invalid MemberId");
                }

                GroupBL bl = new GroupBL();

                var group = bl.CreateGroup(memberId.Value, param, OrgComm.Data.Models.Group.GroupType.Other);

                result.Status  = true;
                result.Message = "Group created";
                result.Group   = group;
            }
            catch (OrgException oex)
            {
                result.Status  = false;
                result.Message = oex.Message;
            }
            catch (Exception ex)
            {
                result.Status  = false;
                result.Message = AppConfigs.InternalErrorMessage;

                if (AppConfigs.DebugInternalMessage)
                {
                    result.InternalMessage = ex.Message;
                }
            }

            return(result);
        }