private void btnAptSave_Click(object sender, RoutedEventArgs e)
 {
     var viewModel = new ECCAppointmentsViewModel();
     viewModel.AppointmentName = DisplayText.Text;
     viewModel.Date = Convert.ToDateTime(datetxtBlk.Text);
     StudioRepository.SaveAppointment(viewModel);
     var msgBox = new BookerStudioMessageBox("Saved successfully.", "The appointment is saved successfully!", GuestBookerMessageBoxButtons.Ok, IconType.Attention);
     msgBox.ShowDialog();
 }
  public static void UpdateAppointment(ECCAppointmentsViewModel viewModel)
  {
 
  }
 public static void SaveAppointment(ECCAppointmentsViewModel viewModel)
 {
     var model = Repository.ECCAppointments.Where(c => c.FromDate == viewModel.Date).SingleOrDefault();
     if (model != null)
     {
         model.AppointmentName = viewModel.AppointmentName;
         model.FromDate = viewModel.Date;
         model.AptDate = viewModel.Date.Day + "-" + viewModel.Date.Month + "-" + viewModel.Date.Year; 
         Repository.SubmitChanges();
     }
     else
     {
         var newModel = new ECCAppointment();
         newModel.AppointmentName = viewModel.AppointmentName;
         newModel.FromDate = viewModel.Date;
         newModel.AptDate = viewModel.Date.Day + "-" + viewModel.Date.Month + "-" + viewModel.Date.Year;
         Repository.ECCAppointments.InsertOnSubmit(newModel);
         Repository.SubmitChanges();
     }
 }