コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Confirm_Appointment confirm_Appointment = db.ConfirmAppointments.Find(id);

            db.ConfirmAppointments.Remove(confirm_Appointment);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "AppId,name,surname,phone,Address,Date,time,AgentId")] Confirm_Appointment confirm_Appointment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(confirm_Appointment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AgentId = new SelectList(db.agents, "AgentId", "AgentName", confirm_Appointment.AgentId);
     return(View(confirm_Appointment));
 }
コード例 #3
0
        // GET: Confirm_Appointment/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Confirm_Appointment confirm_Appointment = db.ConfirmAppointments.Find(id);

            if (confirm_Appointment == null)
            {
                return(HttpNotFound());
            }
            return(View(confirm_Appointment));
        }
コード例 #4
0
        // GET: Confirm_Appointment/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Confirm_Appointment confirm_Appointment = db.ConfirmAppointments.Find(id);

            if (confirm_Appointment == null)
            {
                return(HttpNotFound());
            }
            ViewBag.AgentId = new SelectList(db.agents, "AgentId", "AgentName", confirm_Appointment.AgentId);
            return(View(confirm_Appointment));
        }
コード例 #5
0
        public ActionResult Confirm(int?id)
        {
            Appointment         appointment = db.appointments.Find(id);
            Confirm_Appointment confirm     = new Confirm_Appointment();

            confirm.AppId   = appointment.AppId;
            confirm.name    = appointment.name;
            confirm.surname = appointment.surname;
            confirm.phone   = appointment.phone;
            confirm.Address = appointment.Address;
            confirm.Date    = appointment.Date;
            confirm.time    = appointment.time;
            confirm.AgentId = appointment.AgentId;

            appointment.status = "Appointment Approved";
            db.ConfirmAppointments.Add(confirm);
            db.appointments.Remove(appointment);
            db.SaveChanges();
            return(RedirectToAction("Index", "Confirm_Appointment"));
        }