コード例 #1
0
        //Put Method

        public string UpdateOldAppointment(AppointmentTBL app)

        {
            var appointment3 = _appointmentData.UpdateAppointment(app.AppointmentId, app.AppointmentTypeId, app.ConsumerId, app.StatusCode, app.ConsumerName);

            return(appointment3);
        }
コード例 #2
0
        public ActionResult Delete(int id)
        {
            AppointmentTBL appointmentTBL = db.AppointmentTBLs.Find(id);

            db.AppointmentTBLs.Remove(appointmentTBL);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
 public ActionResult Edit(AppointmentTBL appointment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(appointment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(appointment));
 }
コード例 #4
0
        public ActionResult Create(AppointmentTBL appointment)
        {
            var app = db.AppointmentTBLs.SingleOrDefault(c => c.ConsumerName == appointment.ConsumerName);

            if (app == null)
            {
                db.AppointmentTBLs.Add(appointment);
                db.SaveChanges();
                return(RedirectToAction("index"));
            }
            return(View("index"));
        }
コード例 #5
0
        //Deleting the appointment
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AppointmentTBL appointmentTbl = db.AppointmentTBLs.Find(id);

            if (appointmentTbl == null)
            {
                return(HttpNotFound());
            }
            return(View(appointmentTbl));
        }
コード例 #6
0
        public ActionResult Create(AppointmentTBL appointment)
        {
            var app = db.AppointmentTBLs.SingleOrDefault(c => c.ConsumerName == appointment.ConsumerName);

            if (app == null)
            {
                db.AppointmentTBLs.Add(appointment);
                db.SaveChanges();
                //return RedirectToAction("index");
                return(Content("Record Added Successfully"));
            }
            //return View("index");
            return(Content("Already Existed"));
        }
コード例 #7
0
        //Post Method
        public string InsertAppointment(int appointmentId, int appointmentTypeId, string consumerId, string statusCode, string consumerName)
        {
            var appointment1 = new AppointmentTBL
            {
                AppointmentId     = appointmentId,
                AppointmentTypeId = appointmentTypeId,
                ConsumerId        = consumerId,
                StatusCode        = statusCode,
                ConsumerName      = consumerName
            };

            if (db.AppointmentTBLs.Any(c => c.ConsumerName.Equals(consumerName)))//db.AppointmentTBLs.SingleOrDefault(c => c.ConsumerName == consumerName))
            {
                return("Already Exist");
            }
            else
            {
                db.AppointmentTBLs.Add(appointment1);
                db.SaveChanges();
                return("Success");
            }
        }
コード例 #8
0
        //Updating the AppointmentId
        public string UpdateAppointment(AppointmentTBL app)
        {
            var response = _oasService.UpdateOldAppointment(app);

            return(response);
        }
コード例 #9
0
        //inserting New appointment -Pavi
        public string InsertAppointment(AppointmentTBL app)
        {
            var response = _oasService.InsertNewAppointment(app);

            return(response);
        }
コード例 #10
0
        public ActionResult Get(int id)
        {
            AppointmentTBL appointment = db.AppointmentTBLs.Where(x => x.AppointmentId == id).SingleOrDefault();

            return(View(appointment));
        }
コード例 #11
0
        //Post Method
        public string InsertNewAppointment(AppointmentTBL app)
        {
            var appointment = _appointmentData.InsertAppointment(app.AppointmentId, app.AppointmentTypeId, app.ConsumerId, app.StatusCode, app.ConsumerName);

            return(appointment);
        }