public ActionResult SaveToDateTimeTable(FormCollection fc) { BODateTime bDateTime = new BODateTime(); BOAppointmentDetails bAppointment = new BOAppointmentDetails(); var companyId = fc["dropdownCompany"].ToString(); //CompanyId var vipId = fc["dropdownVIP"].ToString(); //VipId var dateId = fc["dropdownDate"].ToString(); var dateValue = bllAvailable.GetAllAvailableTiming().Where(u => u.Id == Convert.ToInt32(dateId)).SingleOrDefault().Date; ////date bDateTime.Date = Convert.ToDateTime(dateValue); //string resultString = Regex.Match(bDateTime.Date.ToString(), @"\d{4}-\d{2}-\d{2}").Value; bDateTime.FromTime = fc["dropdownInterval"].ToString(); bDateTime.ToTime = endTime; bDateTime.IsCanceled = false; int i = bllDateTime.CreateDateTime(bDateTime); bAppointment.DepartmentId = Convert.ToInt32(fc["dropdownDepartment"].ToString()); bAppointment.AppointmentFrom = emailId; bAppointment.AppointmentTo = bllVIP.GetAllVIP().Where(u => u.Id == Convert.ToInt32(vipId)).SingleOrDefault().Email; bAppointment.DateTimeId = bllDateTime.GetLastId(); bAppointment.Details = fc["Details"].ToString(); bAppointment.status = "True"; int j = bllAppointment.CreateAppointment(bAppointment); if (j > 0) { ViewBag.Appointment = "Successfully Created"; } else { ViewBag.Appointment = "Failed"; } return(RedirectToAction("FixAppointment")); }
public int UpdateDateTime(BODateTime model) { tblDateTime datetime = _db.tblDateTimes.Where(u => u.Id == model.Id).FirstOrDefault(); datetime.Id = model.Id; datetime.Date = model.Date; datetime.FromTime = model.FromTime; datetime.ToTime = model.ToTime; datetime.IsCanceled = model.IsCanceled; return(_db.SaveChanges()); }
public int CreateDateTime(BODateTime model) { tblDateTime datetime = new tblDateTime(); datetime.Date = model.Date; datetime.FromTime = model.FromTime; datetime.ToTime = model.ToTime; datetime.IsCanceled = model.IsCanceled; _db.tblDateTimes.Add(datetime); return(_db.SaveChanges()); }
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 List <BODateTime> GetAllDateTime() { List <BODateTime> lst = new List <BODateTime>(); var temp = _db.tblDateTimes.ToList(); foreach (var model in temp) { BODateTime datetime = new BODateTime(); datetime.Date = model.Date; datetime.Id = model.Id; datetime.FromTime = model.FromTime; datetime.ToTime = model.ToTime; datetime.IsCanceled = model.IsCanceled; lst.Add(datetime); } return(lst); }
public ActionResult UpdatingAppointment(BODateTime bDateTime) { if (ModelState.IsValid) { int i = bllDateTime.UpdateDateTime(bDateTime); if (i > 0) { return(RedirectToAction("ViewAppointment")); } else { return(View()); } } else { return(View()); } }