Example #1
0
        public async Task <IActionResult> AddGroup(AddGroupModel model)
        {
            var imageUri = "";

            if (model.ImageUpload != null)
            {
                var blockBlob = PostGroupImage(model.ImageUpload);
                imageUri = blockBlob.Uri.AbsoluteUri;
            }

            else
            {
                imageUri = "/images/users/default.png";
            }

            var group = new Group()
            {
                Name        = model.Title,
                Description = model.Description,
                ImageUrl    = imageUri,
                AdminId     = model.AdminId
            };

            if (group.Name != null && group.Description != null)
            {
                await _groupService.Add(group);
            }
            return(RedirectToAction("Index"));
        }
        public static GameSettingString AddNewShort(this IGroup <GameSetting> gameSettings, string editorId)
        {
            var ret = new GameSettingString(
                gameSettings.SourceMod.GetNextFormKey(editorId));

            gameSettings.Add(ret);
            return(ret);
        }
        public static GameSettingFloat AddNewFloat(this IGroup <GameSetting> gameSettings)
        {
            var ret = new GameSettingFloat(
                gameSettings.SourceMod.GetNextFormKey());

            gameSettings.Add(ret);
            return(ret);
        }
Example #4
0
        public static GlobalFloat AddNewFloat(this IGroup <Global> globals)
        {
            var ret = new GlobalFloat(
                globals.SourceMod.GetNextFormKey());

            globals.Add(ret);
            return(ret);
        }
Example #5
0
        public static GlobalShort AddNewShort(this IGroup <Global> globals, string editorId)
        {
            var ret = new GlobalShort(
                globals.SourceMod.GetNextFormKey(editorId));

            globals.Add(ret);
            return(ret);
        }
Example #6
0
        public static GlobalInt AddNewInt(this IGroup <Global> globals, string editorId)
        {
            var ret = new GlobalInt(
                globals.SourceMod.GetNextFormKey(editorId),
                globals.SourceMod.GameRelease.ToSkyrimRelease());

            globals.Add(ret);
            return(ret);
        }
Example #7
0
        public static GlobalShort AddNewShort(this IGroup <Global> globals)
        {
            var ret = new GlobalShort(
                globals.SourceMod.GetNextFormKey(),
                globals.SourceMod.GameRelease.ToSkyrimRelease());

            globals.Add(ret);
            return(ret);
        }
Example #8
0
        public static GameSettingString AddNewShort(this IGroup <GameSetting> gameSettings)
        {
            var ret = new GameSettingString(
                gameSettings.SourceMod.GetNextFormKey(),
                gameSettings.SourceMod.GameRelease.ToSkyrimRelease());

            gameSettings.Add(ret);
            return(ret);
        }
Example #9
0
        public static GameSettingInt AddNewInt(this IGroup <GameSetting> gameSettings, string editorId)
        {
            var ret = new GameSettingInt(
                gameSettings.SourceMod.GetNextFormKey(editorId),
                gameSettings.SourceMod.GameRelease.ToSkyrimRelease());

            gameSettings.Add(ret);
            return(ret);
        }
 public bool AddGroup(GroupAddRequest request)
 {
     try
     {
         group.Add(request);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Example #11
0
 /// <summary>
 /// Duplicates a given record (giving it a new FormID) adding it to the group and returning it.
 /// </summary>
 /// <param name="group">Group to add to</param>
 /// <param name="source">Source record to duplicate</param>
 /// <returns>Duplicated and added record</returns>
 public static TMajor DuplicateInAsNewRecord <TMajor, TMajorGetter, TSharedParent>(this IGroup <TMajor> group, TMajorGetter source)
     where TMajor : class, IMajorRecordInternal, TSharedParent
     where TMajorGetter : TSharedParent
     where TSharedParent : IMajorRecordGetter
 {
     try
     {
         var newRec = (source.Duplicate(group.SourceMod.GetNextFormKey()) as TMajor) !;
         group.Add(newRec);
         return(newRec);
     }
     catch (Exception ex)
     {
         throw RecordException.Enrich <TMajor>(ex, source.FormKey, source.EditorID);
     }
 }
Example #12
0
        public ActionResult AddData(Group par)
        {
            par.CREATED_BY   = Session["UserName"].ToString();
            par.CREATED_TIME = DateTime.Now;

            var isSave = repo.Add(par);

            if (isSave)
            {
                TempData["msgSuccess"] = fn.fg.Save;
            }
            else
            {
                TempData["msgError"] = fn.fg.SFailed;
            }

            return(RedirectToAction("ListGroup", "UserGroup"));
        }
Example #13
0
        public async Task <ResultModel <Domain.Chat.DTO.Group> > Insert(Domain.Chat.DTO.Group group)
        {
            var groupDomain = new Group(group.Identification, group.TypeGroup);

            await SetValidateObject <Group>(new string[1] {
                "Grupo Cadastrado"
            }, groupDomain, group);

            if (Object.Sucess)
            {
                _IGroup.Add(groupDomain);
                await _IGroup.SaveChangesAsync();

                group.Id = groupDomain.Id;
                SetObject(group);
            }

            return(Object);
        }
        private void CreateGroup()
        {
            if (ValidGroupInput())
            {
                var g = group.Add(new GroupModel()
                {
                    Icon = GroupIcon,
                    Name = GroupName
                });

                Items.Add(new NavigationItemModel()
                {
                    ID    = g.ID,
                    Icon  = GroupIcon,
                    Title = GroupName
                });
                Toast("分组已添加", ToastType.Success);
                SelectGroup(g.ID);
                HideGroupModalCommand.Execute(null);
            }
        }
Example #15
0
        public virtual async Task <ActionResult> Create(GroupModel viewModel, int?TournamentID)
        {
            ViewBag.SportType       = SPList();
            ViewBag.ParticipantType = PTList();
            ViewBag.CountryID       = COList();
            if (ModelState.IsValid)
            {
                if (!_Group.IsExist(viewModel.Title, TournamentID.Value, viewModel.SportTypeID.Value))
                {
                    var grp = new GroupModel
                    {
                        Title             = viewModel.Title,
                        SportType         = viewModel.SportType,
                        SportTypeID       = viewModel.SportTypeID,
                        SportTypeTitle    = viewModel.SportTypeTitle,
                        Tournament        = viewModel.Tournament,
                        TournamentID      = viewModel.TournamentID,
                        TournamentTitle   = viewModel.TournamentTitle,
                        ParticipantTypeID = viewModel.ParticipantTypeID,
                        CountryID         = viewModel.CountryID
                    };
                    _Group.Add(grp, TournamentID.Value);
                    await _uow.SaveChangesAsync();

                    ViewBag.Status = true;
                    return(View());
                }
                else
                {
                    ViewBag.Message = "عنوان وارد شده تکراری است.";
                    return(View());
                }
            }
            else
            {
                return(View());
            }
        }
Example #16
0
        /// <summary>
        /// Obtém a diferença entre a matriz corrente e outra matriz.
        /// </summary>
        /// <param name="right">A outra matriz.</param>
        /// <param name="group">O grupo.</param>
        /// <returns>O resultado da diferença.</returns>
        public ArrayMathMatrix <ObjectType> Subtract(ArrayMathMatrix <ObjectType> right, IGroup <ObjectType> group)
        {
            if (right == null)
            {
                throw new ArgumentNullException("right");
            }
            else if (group == null)
            {
                throw new ArgumentNullException("semigroup");
            }
            else
            {
                if (this.numberOfLines == right.numberOfLines &&
                    this.numberOfColumns == right.numberOfColumns)
                {
                    var result = new ArrayMathMatrix <ObjectType>(
                        this.numberOfLines,
                        this.numberOfColumns);
                    for (int i = 0; i < this.numberOfLines; ++i)
                    {
                        for (int j = 0; j < this.numberOfColumns; ++j)
                        {
                            result.elements[i][j] = group.Add(
                                this.elements[i][j],
                                group.AdditiveInverse(right.elements[i][j]));
                        }
                    }

                    return(result);
                }
                else
                {
                    throw new ArgumentException("Matrices don't have the same dimensions.");
                }
            }
        }
Example #17
0
 /// <summary>
 /// 添加一条数据
 /// </summary>
 /// <param name="model">数据实体</param>
 /// <returns></returns>
 public int Add(Models.APP.Group model)
 {
     return(dal.Add(model));
 }
Example #18
0
        public static int AddGroup(GroupInfo group)
        {
            IGroup dal = Factory <IGroup> .Create("Group");

            return(dal.Add(group));
        }
 static void AddItem <T>(IGroup <T> g, T item) => g.Add(item);
Example #20
0
 public static T AddToGroup <T>(this T self, IGroup group)
     where T : ITransient
 {
     group.Add(self);
     return(self);
 }
Example #21
0
 public new IGenerator AddTo(IGroup group)
 {
     group?.Add(this);
     return(this);
 }
Example #22
0
 public void AddGroup(Group gr)
 {
     _groupRepository.Add(gr);
 }
Example #23
0
 public new IChannel <TR> AddTo(IGroup group)
 {
     group.Add(this);
     return(this);
 }