コード例 #1
0
 public ActionResult DeleteAppointment(int a)
 {
     Models.Appointment_Master am = new Appointment_Master();
     am.Ap_ID = a;
     am.delete();
     return(RedirectToAction("Appointment"));
 }
コード例 #2
0
        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()));
        }
コード例 #3
0
        [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
        }
コード例 #4
0
        [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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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"));
        }
コード例 #7
0
        [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);
        }
コード例 #8
0
 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!");
     }
 }
コード例 #9
0
 public ActionResult AddAppointment(Appointment_Master am)
 {
     am.U_ID = GetDetail.U_ID;
     am.add();
     return(RedirectToAction("Appointment"));
 }