Example #1
0
 public ActionResult SPH_Profile([Bind(Include = "StreetAddress,CityOfAddress,StateOfAddress,ZipCode,FirstName,LastName,MiddleName,TicketNumber")] SeasonPassHolder sPHolder)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sPHolder).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("SPH_Profile"));
     }
     return(View(sPHolder));
 }
 public ActionResult Edit([Bind(Include = "TicketNumber,Price,DateOfPurchase,TicketCode")] Ticket ticket)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ticket).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TicketCode = new SelectList(db.TicketCodes, "TicketCode1", "TicketType", ticket.TicketCode);
     return(View(ticket));
 }
Example #3
0
        public ActionResult Aprovar(int id)
        {
            foreach (var x in db.Candidaturas.ToList())
            {
                if (id == x.CandidaturaId)
                {
                    x.Estado          = "Aprovado";
                    db.Entry(x).State = EntityState.Modified;
                    db.SaveChanges();
                }
            }


            return(RedirectToAction("Lista"));
        }
Example #4
0
 public ActionResult Edit([Bind(Include = "ItemName,ItemPrice,ItemDescription")] Concession concession)
 {
     if (ModelState.IsValid)
     {
         db.Entry(concession).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(concession));
 }
 public ActionResult Edit([Bind(Include = "RideID,RideName,RideDiscription,RideLocation,RideCapacity")] Ride ride)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ride).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(ride));
 }
Example #6
0
 public ActionResult Edit([Bind(Include = "TicketCode1,TicketType")] TicketCode ticketCode)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ticketCode).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(ticketCode));
 }
 public ActionResult Edit([Bind(Include = "LoginEmail,Pswd,SPH_ID")] SPHLogin sPHLogin)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sPHLogin).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SPH_ID = new SelectList(db.SeasonPassHolders, "SPH_ID", "StreetAddress", sPHLogin.SPH_ID);
     return(View(sPHLogin));
 }
Example #8
0
 public ActionResult Edit([Bind(Include = "SPH_ID,StreetAddress,CityOfAddress,StateOfAddress,ZipCode,FirstName,LastName,MiddleName,TicketNumber")] SeasonPassHolder seasonPassHolder)
 {
     if (ModelState.IsValid)
     {
         db.Entry(seasonPassHolder).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TicketNumber = new SelectList(db.Tickets, "TicketNumber", "TicketNumber", seasonPassHolder.TicketNumber);
     return(View(seasonPassHolder));
 }
 public ActionResult Edit([Bind(Include = "EmployeeID,FirstName,MiddleName,LastName,StreetAddress,State,City,ZipCode,PhoneNumber,DateOfBirth,Sex,JobTitle,DepartmentID")] ParkEmployee parkEmployee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(parkEmployee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DepartmentID = new SelectList(db.Departments, "DepartmentID", "DName", parkEmployee.DepartmentID);
     return(View(parkEmployee));
 }
 public ActionResult Edit([Bind(Include = "LoginEmail,Pswd,EmployeeID")] EmployeeLogin employeeLogin)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employeeLogin).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EmployeeID = new SelectList(db.ParkEmployees, "EmployeeID", "FirstName", employeeLogin.EmployeeID);
     return(View(employeeLogin));
 }
        public ActionResult Edit([Bind(Include = "MaintenanceID,MaintDescription,CorrectiveAction,DateAdded,DateFixed,MaintCode,SupervisorID,RideID")] Maintenance maintenance)
        {
            if (ModelState.IsValid)
            {
                var login        = db.EmployeeLogins.Single(x => x.LoginEmail == ApplicationSession.Username);
                var employee     = login.ParkEmployee;
                var performed_by = new PERFORMED_BY();
                performed_by.ParkEmployee = employee;
                performed_by.Maintenance  = maintenance;
                performed_by.ManHours     = 4;

                db.PERFORMED_BY.Add(performed_by);
                db.Entry(maintenance).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.MaintCode = new SelectList(db.MaintCodes, "MaintCode1", "MaintType", maintenance.MaintCode);
            ViewBag.RideID    = new SelectList(db.Rides, "RideID", "RideName", maintenance.RideID);
            return(View(maintenance));
        }
 public ActionResult Edit([Bind(Include = "ItemName,EmployeeID,DateSold")] SOLD_BY sOLD_BY)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sOLD_BY).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ItemName   = new SelectList(db.Concessions, "ItemName", "ItemDescription", sOLD_BY.ItemName);
     ViewBag.EmployeeID = new SelectList(db.ParkEmployees, "EmployeeID", "FirstName", sOLD_BY.EmployeeID);
     return(View(sOLD_BY));
 }
 public ActionResult Edit([Bind(Include = "CriancaId,Idade,Nome,UserId,CandidaturaId")] Crianca crianca)
 {
     if (ModelState.IsValid)
     {
         crianca.UserId          = User.Identity.GetUserId();
         db.Entry(crianca).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CandidaturaId = new SelectList(db.Candidaturas, "CandidaturaId", "Estado", crianca.CandidaturaId);
     return(View(crianca));
 }
 public ActionResult Edit([Bind(Include = "TicketID,EmployeeID,AdmissionsDate")] ADMITTED_BY aDMITTED_BY)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aDMITTED_BY).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EmployeeID = new SelectList(db.ParkEmployees, "EmployeeID", "FirstName", aDMITTED_BY.EmployeeID);
     ViewBag.TicketID   = new SelectList(db.Tickets, "TicketNumber", "TicketNumber", aDMITTED_BY.TicketID);
     return(View(aDMITTED_BY));
 }
 public ActionResult Edit([Bind(Include = "DepID,FirstName,LastName,MiddleName,TicketNumber,SPH_ID")] DependentPassHolder dependentPassHolder)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dependentPassHolder).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SPH_ID       = new SelectList(db.SeasonPassHolders, "SPH_ID", "StreetAddress", dependentPassHolder.SPH_ID);
     ViewBag.TicketNumber = new SelectList(db.Tickets, "TicketNumber", "TicketNumber", dependentPassHolder.TicketNumber);
     return(View(dependentPassHolder));
 }
Example #16
0
 public ActionResult Edit([Bind(Include = "RideID,EmployeeID,DateTended")] TENDED_BY tENDED_BY)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tENDED_BY).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EmployeeID = new SelectList(db.ParkEmployees, "EmployeeID", "FirstName", tENDED_BY.EmployeeID);
     ViewBag.RideID     = new SelectList(db.Rides, "RideID", "RideName", tENDED_BY.RideID);
     return(View(tENDED_BY));
 }
 public ActionResult Edit([Bind(Include = "ID,Nome,Tipo,Creche,PreEscolar,TransporteCriancas,AulasNatacao,AulasMusica,Valor,UserId,PontuacaoTotal,Rating,Avaliacoes,RatingMedio")] Instituicao instituicao)
 {
     // return Content(ModelState.Keys.FirstOrDefault());
     //var errors = ModelState.Values.SelectMany(v => v.Errors);
     if (ModelState.IsValid)
     {
         instituicao.UserId          = User.Identity.GetUserId();
         db.Entry(instituicao).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(instituicao));
 }