Ejemplo n.º 1
0
        public virtual async Task <ActionResult> Edit(GroupModel viewModel, Guid ID)
        {
            var model = _Group.GetDetail(ID);

            ViewBag.SportType       = new SelectList(SPList(), "Value", "Text", model.SportTypeID);
            ViewBag.ParticipantType = new SelectList(PTList(), "Value", "Text", model.ParticipantTypeID);
            ViewBag.CountryID       = new SelectList(COList(), "Value", "Text", model.CountryID);
            if (!_Group.IsExist(viewModel.Title, ID, viewModel.TournamentID, viewModel.SportTypeID.Value))
            {
                _Group.Edit(ID, viewModel);
                await _uow.SaveChangesAsync();
            }
            else
            {
                ViewBag.Message = "عنوان وارد شده در سیستم موجود است.";
                return(View());
            }
            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult Detail(Group par)
        {
            if (!ModelState.IsValid)
            {
                TempData["msgError"] = fn.fg.DataIsntValid;
            }
            else
            {
                par.LAST_MODIFIED_BY = Session["UserName"].ToString();

                var isEdit = repo.Edit(par.ID, par);
                if (isEdit)
                {
                    TempData["msgSuccess"] = fn.fg.Edit;
                }
                else
                {
                    TempData["msgError"] = fn.fg.EFailed;
                }
            }
            return(RedirectToAction("ListGroup", "UserGroup"));
        }