Example #1
0
        // GET: Cities/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(
                           HttpStatusCode.BadRequest));
            }

            var city = db.Cities.Find(id);

            if (city == null)
            {
                return(HttpNotFound());
            }

            ViewBag.StateID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetStates(),
                    "StateID",
                    "Name",
                    city.StateID);

            return(View(city));
        }
Example #2
0
        // GET: /TypeLogins/Create
        public ActionResult Create()
        {
            ViewBag.UniversityID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetUniversities(),
                    "UniversityID",
                    "Description");

            ViewBag.UserRolesID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetRoles(),
                    "UserRolesID",
                    "Description");

            ViewBag.UsersID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetUsers(),
                    "UsersID",
                    "UserName");

            return(View());
        }
Example #3
0
        public ActionResult Create(City city)
        {
            if (ModelState.IsValid)
            {
                db.Cities.Add(city);

                var response =
                    DBHelper.SaveChanges(db);

                if (response.Succeeded)
                {
                    return(RedirectToAction("Index"));
                }

                ModelState.
                AddModelError(
                    string.Empty,
                    response.Message);
            }

            ViewBag.StateID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetStates(),
                    "StateID",
                    "Name",
                    city.StateID);

            return(View(city));
        }
Example #4
0
        // GET: Cities/Create
        public ActionResult Create()
        {
            ViewBag.StateID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetStates(),
                    "StateID",
                    "Name");

            return(View());
        }
        public ActionResult Edit(Enterprise enterprise)
        {
            if (ModelState.IsValid)
            {
                db.Entry(enterprise).State =
                    EntityState.Modified;

                var response =
                    DBHelper.SaveChanges(db);

                if (response.Succeeded)
                {
                    return(RedirectToAction("Index"));
                }

                ModelState.
                AddModelError(
                    string.Empty,
                    response.Message);
            }

            ViewBag.CityID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetCities(enterprise.StateID),
                    "CityID",
                    "Name",
                    enterprise.CityID);

            ViewBag.DocumentTypeID =
                new SelectList(
                    ComboBoxStateHelper.GetDocumentTypes(),
                    "DocumentTypeID",
                    "Description",
                    enterprise.DocumentTypeID);

            ViewBag.StateID =
                new SelectList(
                    ComboBoxStateHelper.GetStates(),
                    "StateID",
                    "Name",
                    enterprise.StateID);

            return(View(enterprise));
        }
Example #6
0
        // GET: /TypeLogins/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(
                           HttpStatusCode.BadRequest));
            }

            var typelogin = db.TypeLogins.Find(id);

            if (typelogin == null)
            {
                return(HttpNotFound());
            }

            ViewBag.UniversityID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetUniversities(),
                    "UniversityID",
                    "Description",
                    typelogin.UniversityID);

            ViewBag.UserRolesID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetRoles(),
                    "UserRolesID",
                    "Description",
                    typelogin.UserRolesID);

            ViewBag.UsersID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetUsers(),
                    "UsersID",
                    "UserName",
                    typelogin.UsersID);

            return(View(typelogin));
        }
Example #7
0
        // GET: /Users/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(
                           HttpStatusCode.BadRequest));
            }

            var users = db.Users.Find(id);

            if (users == null)
            {
                return(HttpNotFound());
            }

            ViewBag.CityID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetCities(users.StateID),
                    "CityID",
                    "Name",
                    users.CityID);

            ViewBag.DocumentTypeID =
                new SelectList(
                    ComboBoxStateHelper.GetDocumentTypes(),
                    "DocumentTypeID",
                    "Description",
                    users.DocumentTypeID);

            ViewBag.StateID =
                new SelectList(
                    ComboBoxStateHelper.GetStates(),
                    "StateID",
                    "Name",
                    users.StateID);

            return(View(users));
        }
        // GET: Enterprises/Create
        public ActionResult Create()
        {
            ViewBag.CityID =
                new SelectList(
                    ComboBoxStateHelper.GetCities(0),
                    "CityID",
                    "Name");

            ViewBag.DocumentTypeID =
                new SelectList(
                    ComboBoxStateHelper.GetDocumentTypes(),
                    "DocumentTypeID",
                    "Description");

            ViewBag.StateID =
                new SelectList(
                    ComboBoxStateHelper.GetStates(),
                    "StateID",
                    "Name");

            return(View());
        }
Example #9
0
        public ActionResult Create(Users users)
        {
            if (ModelState.IsValid)
            {
                if (users.PhotoUsersFile != null)
                {
                    //var pic = string.Empty;

                    var folder = "~/Content/Users";

                    var file = string.Format("{0}.jpg",
                                             users.UsersID);

                    var response2 =
                        FileImageUpLoad.
                        UploadPhoto(
                            users.PhotoUsersFile,
                            folder,
                            file);

                    if (response2)
                    {
                        var pic = string.
                                  Format("{0}/{1}",
                                         folder, file);

                        users.PhotoUsers = pic;

                        db.Entry(users).State =
                            EntityState.Modified;

                        db.SaveChanges();
                    }
                }

                if (users.FirmUsersFile != null)
                {
                    //var pic2 = string.Empty;

                    var folder2 = "~/Content/FirmUsers";

                    var file = string.Format("{0}.jpg",
                                             users.UsersID);

                    var response2 =
                        FileImageUpLoad.
                        UploadPhoto(
                            users.FirmUsersFile,
                            folder2,
                            file);

                    if (response2)
                    {
                        var pic2 = string.
                                   Format("{0}/{1}",
                                          folder2, file);

                        users.FirmUsers = pic2;

                        db.Entry(users).State =
                            EntityState.Modified;

                        db.SaveChanges();
                    }
                }

                db.Users.Add(users);

                var response =
                    DBHelper.SaveChanges(db);

                if (response.Succeeded)
                {
                    return(RedirectToAction("Index"));
                }

                ModelState.
                AddModelError(
                    string.Empty,
                    response.Message);
            }

            ViewBag.CityID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetCities(users.StateID),
                    "CityID",
                    "Name",
                    users.CityID);

            ViewBag.DocumentTypeID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetDocumentTypes(),
                    "DocumentTypeID",
                    "Description",
                    users.DocumentTypeID);

            ViewBag.StateID =
                new SelectList(
                    ComboBoxStateHelper.GetStates(),
                    "StateID",
                    "Name",
                    users.StateID);

            return(View(users));
        }
Example #10
0
        // GET: Pacients/Create
        public ActionResult Create()
        {
            ViewBag.AfpeID =
                new SelectList(
                    ComboBoxStateHelper.GetAfpes(),
                    "AfpeID", "Description");

            ViewBag.ArprID =
                new SelectList(
                    ComboBoxStateHelper.GetArps(),
                    "ArprID", "Description");

            ViewBag.CityID =
                new SelectList(
                    ComboBoxStateHelper.GetCities(0),
                    "CityID", "Name");

            ViewBag.CivilID =
                new SelectList(
                    ComboBoxStateHelper.GetCivils(),
                    "CivilID", "Description");

            ViewBag.DocumentTypeID =
                new SelectList(
                    ComboBoxStateHelper.GetDocumentTypes(),
                    "DocumentTypeID", "Description");

            ViewBag.DriveLicenseID =
                new SelectList(
                    ComboBoxStateHelper.GetLicenses(),
                    "DriveLicenseID", "Description");

            ViewBag.EpsaID =
                new SelectList(
                    ComboBoxStateHelper.GetEpsas(),
                    "EpsaID", "Description");

            ViewBag.FactorRhID =
                new SelectList(
                    ComboBoxStateHelper.GetFactors(),
                    "FactorRhID", "Description");

            ViewBag.GenderID =
                new SelectList(
                    ComboBoxStateHelper.GetGenders(),
                    "GenderID", "Description");

            ViewBag.MilitaryServiceID =
                new SelectList(
                    ComboBoxStateHelper.GetMilitaries(),
                    "MilitaryServiceID", "Options");

            ViewBag.ProfessionID =
                new SelectList(
                    ComboBoxStateHelper.GetProfessions(),
                    "ProfessionID", "Description");

            ViewBag.SchoolLevelID =
                new SelectList(
                    ComboBoxStateHelper.GetLevels(),
                    "SchoolLevelID", "Description");

            ViewBag.StateID =
                new SelectList(
                    ComboBoxStateHelper.GetStates(),
                    "StateID", "Name");

            return(View());
        }
Example #11
0
        public ActionResult Edit(Pacient pacient)
        {
            if (ModelState.IsValid)
            {
                db.Entry(pacient).State =
                    EntityState.Modified;

                var response =
                    DBHelper.SaveChanges(db);

                if (response.Succeeded)
                {
                    return(RedirectToAction("Index"));
                }

                ModelState.
                AddModelError(
                    string.Empty,
                    response.Message);
            }

            ViewBag.AfpeID =
                new SelectList(
                    ComboBoxStateHelper.GetAfpes(),
                    "AfpeID", "Description",
                    pacient.AfpeID);

            ViewBag.ArprID =
                new SelectList(
                    ComboBoxStateHelper.GetArps(),
                    "ArprID", "Description",
                    pacient.ArprID);

            ViewBag.CityID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetCities(pacient.StateID),
                    "CityID", "Name",
                    pacient.CityID);

            ViewBag.CivilID =
                new SelectList(
                    ComboBoxStateHelper.GetCivils(),
                    "CivilID", "Description",
                    pacient.CivilID);

            ViewBag.DocumentTypeID =
                new SelectList(
                    ComboBoxStateHelper.GetDocumentTypes(),
                    "DocumentTypeID", "Description",
                    pacient.DocumentTypeID);

            ViewBag.DriveLicenseID =
                new SelectList(
                    ComboBoxStateHelper.GetLicenses(),
                    "DriveLicenseID", "Description",
                    pacient.DriveLicenseID);

            ViewBag.EpsaID =
                new SelectList(
                    ComboBoxStateHelper.GetEpsas(),
                    "EpsaID", "Description",
                    pacient.EpsaID);

            ViewBag.FactorRhID =
                new SelectList(
                    ComboBoxStateHelper.GetFactors(),
                    "FactorRhID", "Description",
                    pacient.FactorRhID);

            ViewBag.GenderID =
                new SelectList(
                    ComboBoxStateHelper.GetGenders(),
                    "GenderID", "Description",
                    pacient.GenderID);

            ViewBag.MilitaryServiceID =
                new SelectList(
                    ComboBoxStateHelper.GetMilitaries(),
                    "MilitaryServiceID", "Options",
                    pacient.MilitaryServiceID);

            ViewBag.ProfessionID =
                new SelectList(
                    ComboBoxStateHelper.GetProfessions(),
                    "ProfessionID", "Description",
                    pacient.ProfessionID);

            ViewBag.SchoolLevelID =
                new SelectList(
                    ComboBoxStateHelper.GetLevels(),
                    "SchoolLevelID", "Description",
                    pacient.SchoolLevelID);

            ViewBag.StateID =
                new SelectList(
                    ComboBoxStateHelper.GetStates(),
                    "StateID", "Name",
                    pacient.StateID);

            return(View(pacient));
        }
Example #12
0
        // GET: Pacients/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(
                           HttpStatusCode.BadRequest));
            }

            var pacient = db.Pacients.Find(id);

            if (pacient == null)
            {
                return(HttpNotFound());
            }

            ViewBag.AfpeID =
                new SelectList(
                    ComboBoxStateHelper.GetAfpes(),
                    "AfpeID", "Description",
                    pacient.AfpeID);

            ViewBag.ArprID =
                new SelectList(
                    ComboBoxStateHelper.GetArps(),
                    "ArprID", "Description",
                    pacient.ArprID);

            ViewBag.CityID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetCities(pacient.StateID),
                    "CityID", "Name",
                    pacient.CityID);

            ViewBag.CivilID =
                new SelectList(
                    ComboBoxStateHelper.GetCivils(),
                    "CivilID", "Description",
                    pacient.CivilID);

            ViewBag.DocumentTypeID =
                new SelectList(
                    ComboBoxStateHelper.GetDocumentTypes(),
                    "DocumentTypeID", "Description",
                    pacient.DocumentTypeID);

            ViewBag.DriveLicenseID =
                new SelectList(
                    ComboBoxStateHelper.GetLicenses(),
                    "DriveLicenseID", "Description",
                    pacient.DriveLicenseID);

            ViewBag.EpsaID =
                new SelectList(
                    ComboBoxStateHelper.GetEpsas(),
                    "EpsaID", "Description",
                    pacient.EpsaID);

            ViewBag.FactorRhID =
                new SelectList(
                    ComboBoxStateHelper.GetFactors(),
                    "FactorRhID", "Description",
                    pacient.FactorRhID);

            ViewBag.GenderID =
                new SelectList(
                    ComboBoxStateHelper.GetGenders(),
                    "GenderID", "Description",
                    pacient.GenderID);

            ViewBag.MilitaryServiceID =
                new SelectList(
                    ComboBoxStateHelper.GetMilitaries(),
                    "MilitaryServiceID", "Options",
                    pacient.MilitaryServiceID);

            ViewBag.ProfessionID =
                new SelectList(
                    ComboBoxStateHelper.GetProfessions(),
                    "ProfessionID", "Description",
                    pacient.ProfessionID);

            ViewBag.SchoolLevelID =
                new SelectList(
                    ComboBoxStateHelper.GetLevels(),
                    "SchoolLevelID", "Description",
                    pacient.SchoolLevelID);

            ViewBag.StateID =
                new SelectList(
                    ComboBoxStateHelper.GetStates(),
                    "StateID", "Name",
                    pacient.StateID);

            return(View(pacient));
        }
Example #13
0
        public ActionResult Create(TypeLogin typelogin)
        {
            if (ModelState.IsValid)
            {
                db.TypeLogins.Add(typelogin);

                var response =
                    DBHelper.SaveChanges(db);

                if (response.Succeeded)
                {
                    return(RedirectToAction("Index"));
                }

                ModelState.
                AddModelError(
                    string.Empty,
                    response.Message);

                if (typelogin.FirmLoginFile != null)
                {
                    var folder3 = "~/Content/FirmAcces";

                    var file4 = string.Format("{0}.jpg",
                                              typelogin.TypeLoginID);

                    var response4 =
                        FileImageUpLoad.
                        UploadPhoto(
                            typelogin.FirmLoginFile,
                            folder3,
                            file4);

                    if (response4)
                    {
                        var pic4 = string.
                                   Format("{0}/{1}",
                                          folder3, file4);

                        typelogin.FirmLogin = pic4;

                        db.Entry(typelogin).State =
                            EntityState.Modified;

                        db.SaveChanges();
                    }
                }
            }

            ViewBag.UniversityID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetUniversities(),
                    "UniversityID",
                    "Description",
                    typelogin.UniversityID);

            ViewBag.UserRolesID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetRoles(),
                    "UserRolesID",
                    "Description",
                    typelogin.UserRolesID);

            ViewBag.UsersID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetUsers(),
                    "UsersID",
                    "UserName",
                    typelogin.UsersID);

            return(View(typelogin));
        }
Example #14
0
        // GET: Examen/Create
        public ActionResult Create()
        {
            ViewBag.EnterpriseID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetEnterprises(),
                    "EnterpriseID",
                    "Document");

            ViewBag.ExActivoID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetActivoes(),
                    "ExActivoID",
                    "Description");

            ViewBag.ExamenLevelID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetELevels(),
                    "ExamenLevelID",
                    "Description");

            ViewBag.ExamenTypeID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetETypes(),
                    "ExamenTypeID",
                    "Description");

            ViewBag.ExFonoID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetEFonos(),
                    "ExFonoID",
                    "Description");

            ViewBag.ExMedicoID =
                new SelectList(
                    ComboBoxStateHelper
                    .GetEMedicos(),
                    "ExMedicoID",
                    "Description");

            ViewBag.ExOptoID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetEOptos(),
                    "ExOptoID",
                    "Description");

            ViewBag.ExPsicoID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetEPsicos(),
                    "ExPsicoID",
                    "Description");

            ViewBag.OtherExamID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetOthers(),
                    "OtherExamID",
                    "Description");

            ViewBag.PacientID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetPacients(),
                    "PacientID",
                    "Document");

            return(View());
        }
Example #15
0
        public ActionResult Edit(Examen examen)
        {
            if (ModelState.IsValid)
            {
                db.Entry(examen).State =
                    EntityState.Modified;

                var response =
                    DBHelper.SaveChanges(db);

                if (response.Succeeded)
                {
                    return(RedirectToAction("Index"));
                }

                ModelState.
                AddModelError(
                    string.Empty,
                    response.Message);
            }

            ViewBag.EnterpriseID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetEnterprises(),
                    "EnterpriseID",
                    "Document",
                    examen.EnterpriseID);

            ViewBag.ExActivoID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetActivoes(),
                    "ExActivoID",
                    "Description",
                    examen.ExActivoID);

            ViewBag.ExamenLevelID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetELevels(),
                    "ExamenLevelID",
                    "Description",
                    examen.ExamenLevelID);

            ViewBag.ExamenTypeID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetETypes(),
                    "ExamenTypeID",
                    "Description",
                    examen.ExamenTypeID);

            ViewBag.ExFonoID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetEFonos(),
                    "ExFonoID",
                    "Description",
                    examen.ExFonoID);

            ViewBag.ExMedicoID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetEMedicos(),
                    "ExMedicoID",
                    "Description",
                    examen.ExMedicoID);

            ViewBag.ExOptoID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetEOptos(),
                    "ExOptoID",
                    "Description",
                    examen.ExOptoID);

            ViewBag.ExPsicoID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetEPsicos(),
                    "ExPsicoID",
                    "Description",
                    examen.ExPsicoID);

            ViewBag.OtherExamID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetOthers(),
                    "OtherExamID",
                    "Description",
                    examen.OtherExamID);

            ViewBag.PacientID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetPacients(),
                    "PacientID",
                    "Document",
                    examen.PacientID);

            return(View(examen));
        }
Example #16
0
        // GET: Examen/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(
                           HttpStatusCode.BadRequest));
            }

            var examen = db.Examen.Find(id);

            if (examen == null)
            {
                return(HttpNotFound());
            }

            ViewBag.EnterpriseID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetEnterprises(),
                    "EnterpriseID",
                    "Document",
                    examen.EnterpriseID);

            ViewBag.ExActivoID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetActivoes(),
                    "ExActivoID",
                    "Description",
                    examen.ExActivoID);

            ViewBag.ExamenLevelID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetELevels(),
                    "ExamenLevelID",
                    "Description",
                    examen.ExamenLevelID);

            ViewBag.ExamenTypeID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetETypes(),
                    "ExamenTypeID",
                    "Description",
                    examen.ExamenTypeID);

            ViewBag.ExFonoID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetEFonos(),
                    "ExFonoID",
                    "Description",
                    examen.ExFonoID);

            ViewBag.ExMedicoID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetEMedicos(),
                    "ExMedicoID",
                    "Description",
                    examen.ExMedicoID);

            ViewBag.ExOptoID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetEOptos(),
                    "ExOptoID",
                    "Description",
                    examen.ExOptoID);

            ViewBag.ExPsicoID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetEPsicos(),
                    "ExPsicoID",
                    "Description",
                    examen.ExPsicoID);

            ViewBag.OtherExamID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetOthers(),
                    "OtherExamID",
                    "Description",
                    examen.OtherExamID);

            ViewBag.PacientID =
                new SelectList(
                    ComboBoxStateHelper.
                    GetPacients(),
                    "PacientID",
                    "Document",
                    examen.PacientID);

            return(View(examen));
        }