Пример #1
0
        public ActionResult Edit(string CoId)
        {
            NullChecker.NullCheck(new object[] { CoId });

            var CoToEdit = unitOfWork.NotExpiredCompanyRepository
                           .GetByID(EncryptionHelper.Unprotect(CoId));

            if (!CoToEdit.Admins.Any(c => AuthorizationHelper.isRelevant(c.UserId)))
            {
                return(new RedirectToNotFound());
            }

            CountriesViewModel countries = new CountriesViewModel();

            ViewBag.CountryDropDown = countries.counts(CoToEdit.State);
            ViewBag.StateDropDown   = countries.states(CoToEdit.State);

            //PorT SelectList
            var PorTs = from CompanySize e in Enum.GetValues(typeof(CompanySize))
                        select new { Id = e, Name = Resource.EnumTypes.ResourceManager.GetString(e.ToString()) };

            ViewBag.CoSizeDropdown = new SelectList(PorTs, "Id", "Name");

            var catss = CoToEdit.Categories.Select(u => u.catID);

            ViewData["Cats"]    = String.Join(",", catss);
            ViewData["company"] = CoId;

            return(View(CoToEdit));
        }
Пример #2
0
        public ActionResult EditInfo(string UId)
        {
            NullChecker.NullCheck(new object[] { UId });
            var uid = EncryptionHelper.Unprotect(UId);

            if (!AuthorizationHelper.isRelevant((int)uid))
            {
                return(new RedirectToError());
            }
            var user = unitOfWork.ActiveUserRepository.GetByID(uid);
            CountriesViewModel countries = new CountriesViewModel();

            ViewBag.CountryDropDown = countries.counts(user.State);
            ViewBag.StateDropDown   = countries.states(user.State);
            return(View(user));
        }
Пример #3
0
        public ActionResult Edit(string expID)
        {
            NullChecker.NullCheck(new object[] { expID });

            CountriesViewModel countries = new CountriesViewModel();

            var expToEdit = unitOfWork.ExperienceRepository
                            .GetByID(EncryptionHelper.Unprotect(expID));

            if (!AuthorizationHelper.isRelevant(expToEdit.userID))
            {
                throw new JsonCustomException(ControllerError.ajaxErrorEducationUser);
            }
            ViewBag.CountryDropDown = countries.counts(expToEdit.State);
            ViewBag.StateDropDown   = countries.states(expToEdit.State);
            return(PartialView(expToEdit));
        }
Пример #4
0
        public ActionResult Edit(string EvId)
        {
            NullChecker.NullCheck(new object[] { EvId });

            var eventToEdit = unitOfWork.EventRepository
                              .GetByID(EncryptionHelper.Unprotect(EvId));

            if (!AuthorizationHelper.isRelevant(eventToEdit.creatorUserID))
            {
                return(new RedirectToError());
            }
            var catss = eventToEdit.Categories.Select(u => u.catID);

            ViewData["Cats"] = String.Join(",", catss);

            CountriesViewModel countries = new CountriesViewModel();

            ViewBag.CountryDropDown = countries.counts(eventToEdit.State);
            ViewBag.StateDropDown   = countries.states(eventToEdit.State);

            return(View(eventToEdit));
        }
Пример #5
0
        public ActionResult Edit(string StId)
        {
            NullChecker.NullCheck(new object[] { StId });
            var StToEdit = unitOfWork.StoreNotExpiredRepository
                           .GetByID((int)EncryptionHelper.Unprotect(StId));

            if (!StToEdit.Admins.Any(c => AuthorizationHelper.isRelevant(c.UserId)))
            {
                return(new RedirectToNotFound());
            }

            CountriesViewModel countries = new CountriesViewModel();

            ViewBag.CountryDropDown = countries.counts(StToEdit.State);
            ViewBag.StateDropDown   = countries.states(StToEdit.State);

            var catss = StToEdit.Categories.Select(u => u.catID);

            ViewData["Cats"]  = String.Join(",", catss);
            ViewData["store"] = StId;

            return(View(StToEdit));
        }