コード例 #1
0
        public ActionResult Edit(int id)
        {
            TempData["UpdateId"] = id;
            tblDoctorSlot ad = dc.tblDoctorSlots.SingleOrDefault(ob => ob.DoctorSlotId == id);

            return(View(ad));
        }
コード例 #2
0
        public ActionResult Delete(int id)
        {
            tblDoctorSlot ad = dc.tblDoctorSlots.SingleOrDefault(ob => ob.DoctorSlotId == id);

            dc.tblDoctorSlots.Remove(ad);
            dc.SaveChanges();
            return(RedirectToAction("Index", "DoctorSlot"));
        }
コード例 #3
0
        public ActionResult Details(int id)
        {
            tblDoctorSlot ad = dc.tblDoctorSlots.SingleOrDefault(ob => ob.DoctorSlotId == id);

            ViewBag.DoctorName = (from ob in dc.tblDoctors where ob.DoctorId == ad.DoctorId select ob).Take(1).SingleOrDefault().FirstName;
            string name = ViewBag.DoctorName;

            return(View(ad));
        }
コード例 #4
0
        public ActionResult Insert(FormCollection form)
        {
            tblDoctorSlot ad = new tblDoctorSlot();

            ad.DoctorId   = Convert.ToInt32(form["DoctorId"]);
            ad.StartTime  = TimeSpan.Parse(form["StartTime"]);
            ad.DayWeek    = Convert.ToInt32(form["DayWeek"]);
            ad.EndTime    = TimeSpan.Parse(form["EndTime"]);
            ad.OpdShedule = Convert.ToDateTime(form["OpdShedule"]);
            dc.tblDoctorSlots.Add(ad);
            dc.SaveChanges();
            return(RedirectToAction("Index", "DoctorSlot"));
        }
コード例 #5
0
        public ActionResult Edit(FormCollection form)
        {
            int id = Convert.ToInt32(TempData["UpdateId"]);

            tblDoctorSlot ad = dc.tblDoctorSlots.SingleOrDefault(ob => ob.DoctorSlotId == id);

            ad.DoctorId   = Convert.ToInt32(form["DoctorId"]);
            ad.StartTime  = TimeSpan.Parse(form["StartTime"]);
            ad.EndTime    = TimeSpan.Parse(form["EndTime"]);
            ad.DayWeek    = Convert.ToInt32(form["DayWeek"]);
            ad.OpdShedule = Convert.ToDateTime(form["OpdShedule"]);
            dc.SaveChanges();
            return(RedirectToAction("Index", "DoctorSlot"));
        }