public List <BOVipViewModel> getAppointmentDetailsByUser(string emailId) { List <BOVipViewModel> lst = new List <BOVipViewModel>(); var result = from p in _db.tblDateTimes join q in _db.tblAppointments on p.Id equals q.DateTimeId where q.AppointmentFrom == emailId select new { p, q }; foreach (var item in result) { BOVipViewModel bb = new BOVipViewModel(); bb.Date = item.p.Date; ////string resultString = Regex.Match(item.p.Date.ToString(), @"\d{2}-\d{2}-\d{4}").Value; ////bb.Date = Convert.toresultString; //DateTime dt = DateTime.ParseExact(bb.Date.ToString(), "MM/dd/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture); //string s = dt.ToString("dd/M/yyyy", CultureInfo.InvariantCulture); bb.DepartmentId = item.q.DepartmentId; bb.FromTime = item.p.FromTime; bb.ToTime = item.p.ToTime; bb.AppointmentFrom = item.q.AppointmentFrom; bb.AppointmentTo = item.q.AppointmentTo; bb.Details = item.q.Details; bb.Id = item.p.Id; bb.IsCanceled = item.p.IsCanceled; lst.Add(bb); } return(lst); }
public ActionResult AppointmentDetails(BOVipViewModel model) { BODateTime datetime = new BODateTime(); datetime.AppointmentId = model.Id; datetime.Date = model.Date; datetime.Id = model.DateTimeId; datetime.FromTime = model.FromTime; datetime.ToTime = model.ToTime; datetime.IsCanceled = model.IsCanceled; bllDateTime.UpdateDateTime(datetime); return(RedirectToAction("ViewAppointment", new { id = VIPID })); }
public ActionResult DeleteUserAppointment(BOVipViewModel model) { int i = bllDateTime.DeleteDateTime(model.Id); if (i > 0) { int j = bllAppointment.DeleteAppointmentOnTheBasisOfDeletedDateTime(model.Id); if (j > 0) { ViewBag.AppointmentDetails = "Successfully Deleted user data"; } } return(View()); }
public List <BOVipViewModel> getAppointmentByVIP(int id) { //these code below is a temp code to get email id based on the id of the parameter var temp = _db.tblVIPUsers.SingleOrDefault(u => u.Id == id); string email = temp.Email; //temp code finished List <BOVipViewModel> lst = new List <BOVipViewModel>(); var result = from p in _db.tblDateTimes join q in _db.tblAppointments on p.Id equals q.DateTimeId where q.AppointmentTo == email select new { p, q }; foreach (var item in result) { BOVipViewModel bb = new BOVipViewModel(); bb.Date = item.p.Date; ////string resultString = Regex.Match(item.p.Date.ToString(), @"\d{2}-\d{2}-\d{4}").Value; ////bb.Date = Convert.toresultString; //DateTime dt = DateTime.ParseExact(bb.Date.ToString(), "MM/dd/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture); //string s = dt.ToString("dd/M/yyyy", CultureInfo.InvariantCulture); bb.DepartmentId = item.q.DepartmentId; bb.FromTime = item.p.FromTime; bb.ToTime = item.p.ToTime; bb.DateTimeId = item.p.Id; bb.AppointmentFrom = item.q.AppointmentFrom; bb.AppointmentTo = item.q.AppointmentTo; bb.Details = item.q.Details; bb.Id = item.p.Id; bb.IsCanceled = item.p.IsCanceled; lst.Add(bb); } return(lst); }