public ActionResult DeleteAppointment(int a) { Models.Appointment_Master am = new Appointment_Master(); am.Ap_ID = a; am.delete(); return(RedirectToAction("Appointment")); }
public ActionResult Getallappointment() { Appointment_Master am = new Appointment_Master(); if (TempData["Evalue"] != null) { if (TempData["Evalue"] == "Uname") { am.U_Name = TempData["Edata"].ToString(); User u = new Models.User(); u.Name = am.U_Name; u.getbyname(); am.U_ID = u.U_ID; TempData["Evalue"] = null; TempData["Edata"] = null; return(View(am.getallappoint())); } else { am.E_Name = TempData["Edata"].ToString(); Employee em = new Models.Employee(); em.Name = am.E_Name; em.getidbyname(); am.E_ID = em.E_ID; return(View(am.getallappointemp())); } } return(View(am.all())); }
[CusExceptionFilter] //Giving My Custom Exception Filter To The Method Where we Insert Data public Boolean POSTAppointment(Appointment_Master AM) { context.Appointment_Master.Add(AM); int f = context.SaveChanges(); return((f > 0) ? true : false); // If Valid Add ata to table and returning true or false depending on the database/table }
[AuthFilter] //Applying AuthFilter public HttpResponseMessage GetAccountByAc(int ID) { Appointment_Master obj = context.Appointment_Master.FirstOrDefault(s => s.ap_id == ID); //using lamda just getting data of the account holder who matches the argument HttpResponseMessage res = new HttpResponseMessage(HttpStatusCode.OK); res.Content = new ObjectContent(typeof(Appointment_Master), obj, new JsonMediaTypeFormatter()); return(res); }
public HttpResponseMessage GetAp_id(int ap_id) { Appointment_Master appointment = db.Appointment_Master.Find(ap_id); //Find Appointment Form Tada base HttpResponseMessage httpResponse = new HttpResponseMessage(HttpStatusCode.OK); //Call Response httpResponse.Content = new ObjectContent(typeof(Appointment_Master), appointment, new JsonMediaTypeFormatter()); //Data In json from return(httpResponse); }
public ActionResult AppStatus(int a) { Appointment_Master am = new Appointment_Master(); am.Ap_ID = a; am.search(); am.Status = !am.Status; am.update(); return(RedirectToAction("Getallappointment")); }
[Auth] // Authentication For User If User Are in Data base then New appointment book public HttpResponseMessage PostAppointment(Appointment_Master appointment_Master) { db.Appointment_Master.Add(appointment_Master);// Add data in Appointment table db.SaveChanges(); HttpResponseMessage httpResponse = new HttpResponseMessage(HttpStatusCode.Created); //httpResponse create for If Data Successfully insert That httpResponse show Message httpResponse.Content = new StringContent("Insert Successfully!!"); return(httpResponse); }
public String PostAppData(Appointment_Master apm) { if (apm != null) { db.Appointment_Master.Add(apm); db.SaveChanges(); return("Appoinment has been booked!"); } else { return("Error Accured!"); } }
public ActionResult AddAppointment(Appointment_Master am) { am.U_ID = GetDetail.U_ID; am.add(); return(RedirectToAction("Appointment")); }