Exemple #1
0
        // ------------------------- CREATE -------------------------------------
        // GET
        public ActionResult Create()
        {
            CVEditViewModel cvModel = new CVEditViewModel();

            cvModel.Miasta    = _miastoRepo.GetCities();
            cvModel.Kategorie = _kategoriaRepo.GetCategories();
            //cvModel.Doswiadczenie = _repo.GetExperience();
            if (cvModel == null)
            {
                return(HttpNotFound());
            }
            else if (cvModel.UzytkownikId != User.Identity.GetUserId() && !(User.IsInRole("Admin") || User.IsInRole("Pracownik")))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            return(View(cvModel));
        }
        // ------------------------- CREATE -------------------------------------
        // GET
        public ActionResult Create()
        {
            OgloszenieEditViewModel ogloszenie = new OgloszenieEditViewModel();

            ogloszenie.Miasta       = _miastoRepo.GetCities();
            ogloszenie.RodzajeUmowy = _repo.GetAgreementTypes();
            ogloszenie.Kategorie    = _kategoriaRepo.GetCategories();
            if (ogloszenie == null)
            {
                return(HttpNotFound());
            }
            else if (ogloszenie.UzytkownikId != User.Identity.GetUserId() && !(User.IsInRole("Admin") || User.IsInRole("Pracownik")))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            return(View(ogloszenie));
        }