public ActionResult Details(int?id) { tblDoctorTime D = db.tblDoctorTimes.SingleOrDefault(x => x.intTimeID == id); DoctorTimeModel N = new DoctorTimeModel() { TimeId = D.intTimeID, DoctorId = (int)D.intDoctorID, ClinicId = (int)D.intClinicID, DayNo = (int)D.intDayNo, FromTime = (DateTime)D.dtmFromTime, ToTime = (DateTime)D.dtmToTime, Charges = (decimal)D.decCharges, }; return(View(N)); }
public ActionResult Edit(DoctorTimeModel dm) { tblDoctorTime t = db.tblDoctorTimes.SingleOrDefault(x => x.intTimeID == dm.TimeId); if (t != null) { t.dtmFromTime = dm.FromTime; t.dtmToTime = dm.ToTime; t.decCharges = dm.Charges; t.intClinicID = dm.ClinicId; t.intDayNo = dm.DayNo; t.intDoctorID = dm.DoctorId; db.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult Create(DoctorTimeModel D) { tblDoctorTime dr = new tblDoctorTime(); // dr.intTimeID = D.TimeId; dr.intDoctorID = Convert.ToInt32(Session["doctorid"].ToString()); dr.intClinicID = D.ClinicId; dr.intDayNo = D.DayNo; dr.dtmFromTime = D.FromTime; dr.dtmToTime = D.ToTime; dr.decCharges = D.Charges; db.tblDoctorTimes.Add(dr); db.SaveChanges(); return(RedirectToAction("Index")); }