public CustomerCommentsForAppointmentPage(AddAppointments objAddAppointments, Customer Cust, string Day, DateTime DateOfBooking, string pagename) { try { InitializeComponent(); PageName = pagename; day = Day; dateOfBooking = DateOfBooking; obj = new AddAppointments(); obj.CompanyId = objAddAppointments.CompanyId; obj.ServiceId = objAddAppointments.ServiceId; obj.EmployeeId = objAddAppointments.EmployeeId; obj.EmployeeName = objAddAppointments.EmployeeName; obj.ServiceName = objAddAppointments.ServiceName; obj.Cost = objAddAppointments.Cost; obj.StartTime = objAddAppointments.StartTime; obj.EndTime = objAddAppointments.EndTime; obj.TimePeriod = objAddAppointments.TimePeriod; objCust = new Customer(); objCust.Id = Cust.Id; objCust.FirstName = Cust.FirstName; objCust.LastName = Cust.LastName; objCust.UserName = Cust.UserName; objCust.Email = Cust.Email; objCust.TelephoneNo = Cust.TelephoneNo; objCust.Address = Cust.Address; } catch (Exception e) { e.ToString(); } }
public CustomerForCalendarAppointmentPage(AddAppointments obj, string page) { try { InitializeComponent(); //var hrs = obj.DurationInMinutes; //var min = obj.DurationInMinutes; objaddAppointment = new AddAppointments(); objaddAppointment.ServiceId = obj.ServiceId; objaddAppointment.ServiceName = obj.ServiceName; objaddAppointment.EmployeeId = obj.EmployeeId; objaddAppointment.EmployeeName = obj.EmployeeName; objaddAppointment.Cost = obj.Cost; objaddAppointment.StartTime = obj.StartTime; objaddAppointment.CompanyId = obj.CompanyId; objaddAppointment.EndTime = obj.EndTime; objaddAppointment.TimePeriod = obj.TimePeriod; objaddAppointment.DurationInHours = obj.DurationInHours; objaddAppointment.DurationInMinutes = obj.DurationInMinutes; objaddAppointment.DateOfBooking = obj.DateOfBooking; var customerlist = GetAllCustomer(); if (customerlist.Count > 5) { CustomerSearchBar.IsVisible = true; } } catch (Exception e) { e.ToString(); } }
public CalendarTimeSlotsPage(AddAppointments obj, string pagename) { try { InitializeComponent(); EmployeeId = obj.EmployeeId; //EmployeeName = EmpName; serviceID = obj.ServiceId; PageName = pagename; //TimePeriods=tPeriod; CurrentSelectedDay = obj.DateOfBooking; objAddAppointment = new AddAppointments(); objAddAppointment.CompanyId = obj.CompanyId; objAddAppointment.Cost = obj.Cost; objAddAppointment.Currency = obj.Currency; //objAddAppointment.DateOfBooking = obj.DateOfBooking; var selectDate = Convert.ToDateTime(obj.DateOfBooking); var dateOfBookings = selectDate.ToString("dd-MM-yyyy"); var currentDay = selectDate.DayOfWeek; CurrentSelectedDay = currentDay.ToString(); SelectedDateOfBooking = selectDate; var s = SelectedDateOfBooking.ToString("dd-MM-yyyy"); var BookingDate = CurrentSelectedDay + "," + SelectedDateOfBooking.ToString("dd-MMM-yyyy"); objAddAppointment.DateOfBooking = BookingDate; objAddAppointment.DurationInHours = obj.DurationInHours; objAddAppointment.DurationInMinutes = obj.DurationInMinutes; objAddAppointment.EmployeeId = obj.EmployeeId; objAddAppointment.EmployeeName = obj.EmployeeName; objAddAppointment.EndTime = obj.EndTime; objAddAppointment.ServiceId = obj.ServiceId; objAddAppointment.ServiceName = obj.ServiceName; objAddAppointment.StartTime = obj.StartTime; objAddAppointment.TimePeriod = obj.TimePeriod; GetAvailableTime(); //schedulee = new SfSchedule(); var CurrentDate = DateTime.Now; DateTime SpecificDate = new DateTime(CurrentDate.Year, CurrentDate.Month, CurrentDate.Day, 0, 0, 0); //schedulee.NavigateTo(SpecificDate); //schedule.CellTapped += GetAvailableTimeForAppointments; calender.SelectedDate = Convert.ToDateTime(obj.DateOfBooking); calender.DateClicked += GetAvailableTimeForAppointments; } catch (Exception e) { e.ToString(); } }
public CreateNewAppointmentsPage(int ServiceID, string ServiceName, int EmpID, string empName, double Cost, int DurationInHours, int DurationInMinutes, string pagename, string dateofBooking, int statusID) { try { InitializeComponent(); PageName = pagename; serviceID = ServiceID; StatusID = statusID; EmployeeId = EmpID; selectCalendarPageDateofBooking = dateofBooking; //DurationInMinutes = DurationInMinutes; //DurationInHours = DurationInHours; EmployeeName = empName; objAddAppointment = new AddAppointments(); objAddAppointment.CompanyId = Convert.ToInt32(CompanyId); objAddAppointment.EmployeeId = EmployeeId; objAddAppointment.EmployeeName = EmployeeName; objAddAppointment.ServiceId = serviceID; objAddAppointment.ServiceName = ServiceName; objAddAppointment.Cost = Cost; objAddAppointment.DurationInHours = DurationInHours; objAddAppointment.DurationInMinutes = DurationInMinutes; objAddAppointment.Status = statusID; //var TotalHours = DurationInHours; //var Minutes = DurationInMinutes; //var t = TotalHours * 60; //var totalMinutes = t + Minutes; //objAddAppointment.DurationInMinutes = totalMinutes; GetAvailableTime(); //schedulee = new SfSchedule(); var CurrentDate = System.DateTime.Now; DateTime SpecificDate = new System.DateTime(CurrentDate.Year, CurrentDate.Month, CurrentDate.Day, 0, 0, 0); //schedulee.NavigateTo(SpecificDate); //schedule.CellTapped += GetAvailableTimeForAppointments; //GetAppointmentWorkinghours(); calender.SelectedDate = Convert.ToDateTime(dateofBooking); calender.CalendarStartDate(DateTime.Now); calender.DateClicked += GetAvailableTimeForAppointments; } catch (Exception e) { e.ToString(); } }
public NewCustomerPage(AddAppointments obj, string page) { pageN = page; InitializeComponent(); if (obj != null) { objaddAppointment = new AddAppointments(); objaddAppointment.ServiceId = obj.ServiceId; objaddAppointment.ServiceName = obj.ServiceName; objaddAppointment.EmployeeId = obj.EmployeeId; objaddAppointment.EmployeeName = obj.EmployeeName; objaddAppointment.Cost = obj.Cost; objaddAppointment.StartTime = obj.StartTime; objaddAppointment.CompanyId = obj.CompanyId; objaddAppointment.EndTime = obj.EndTime; objaddAppointment.TimePeriod = obj.TimePeriod; objaddAppointment.DurationInHours = obj.DurationInHours; objaddAppointment.DurationInMinutes = obj.DurationInMinutes; objaddAppointment.DateOfBooking = obj.DateOfBooking; } }
private void GetTimeforNewAppointmentClick(object sender, SelectedItemChangedEventArgs e) { if (e.SelectedItem == null) { return; } var d = e.SelectedItem as AssignedServicetoStaff; AddAppointments Data = new AddAppointments(); Data.CompanyId = d.CompanyId; Data.Cost = d.Cost; Data.Currency = d.Currency; Data.DateOfBooking = dateofBooking; Data.DurationInHours = d.DurationInHours; Data.DurationInMinutes = d.DurationInMinutes; Data.EmployeeId = EmpID; Data.EmployeeName = EmpName; Data.ServiceName = d.Name; Data.ServiceId = d.Id; //Data.Status = 0; Navigation.PushAsync(new CalendarTimeSlotsPage(Data, "CalandarAppointment")); ((ListView)sender).SelectedItem = null; }
public CalendarCreateAppointmentPage(AddAppointments objAddAppointment) { InitializeComponent(); try { GetSelectedCustomerById(); //StartHour = objAddAppointment.StartTime; //StartMinutes = objAddAppointment.EndTime; TimePeriods = objAddAppointment.TimePeriod; EmpID = objAddAppointment.EmployeeId; //EmpName = objAddAppointment.EmployeeName; ServiceID = objAddAppointment.ServiceId; EndHour = objAddAppointment.DurationInHours; EndMinute = objAddAppointment.DurationInMinutes; //ServiceName = objAddAppointment.ServiceName; objdata = new AddAppointments(); objdata.CompanyId = objAddAppointment.CompanyId; objdata.Cost = objAddAppointment.Cost; objdata.Currency = objAddAppointment.Currency; objdata.DateOfBooking = objAddAppointment.DateOfBooking; objdata.DurationInHours = objAddAppointment.DurationInHours; objdata.DurationInMinutes = objAddAppointment.DurationInMinutes; objdata.EmployeeId = objAddAppointment.EmployeeId; objdata.EmployeeName = objAddAppointment.EmployeeName; objdata.EndTime = objAddAppointment.EndTime; objdata.ServiceId = objAddAppointment.ServiceId; objdata.ServiceName = objAddAppointment.ServiceName; objdata.StartTime = objAddAppointment.StartTime; objdata.TimePeriod = objAddAppointment.TimePeriod; dateOfBooking = Convert.ToDateTime(objAddAppointment.DateOfBooking.Split(',')[1]); book = objAddAppointment.DateOfBooking; AppointmentTime.Text = objAddAppointment.TimePeriod; if (objCust != null) { CustID = objCust.Id; CustName.Text = objCust.FirstName; CustEmail.Text = objCust.Email; CustPhoneNo.Text = objCust.TelephoneNo; } BindingContext = objAddAppointment; Data = new Dictionary <string, int> { { "No Label", 1 }, { "Pending", 2 }, { "Confirmed", 3 }, { "Done", 4 }, { "No-Show", 5 }, { "Paid", 6 }, { "Running Late", 7 }, //{ "Custom Label",8} }; foreach (var item in Data.Keys) { newAppointmentsPicker.Items.Add(item); } newAppointmentsPicker.SelectedIndex = 0; } catch (Exception e) { e.ToString(); } }
public UpdateAppointmentDetailsPage(AddAppointments appointment, string Day, DateTime DateOfBooking) { try { InitializeComponent(); GetSelectedCustomerById(); StartHour = appointment.StartTime; StartMinutes = appointment.EndTime; //TimePeriods = objAddAppointment.TimePeriod; EmpID = appointment.EmployeeId; //EmpName = objAddAppointment.EmployeeName; ServiceID = appointment.ServiceId; EndHour = appointment.DurationInHours; EndMinute = appointment.DurationInMinutes; //var h = TimeSpan.FromMinutes(appointment.DurationInMinutes); //var minutes= string.Format("{0:00}", (int)h.Minutes); //EndMinute = Convert.ToInt32(minutes); CompanyId = appointment.CompanyId; obj = new UpdateAppointments(); obj.BookingId = appointment.BookingId; obj.CompanyId = appointment.CompanyId; obj.Cost = appointment.Cost; obj.Currency = appointment.Currency; obj.DateOfBooking = appointment.DateOfBooking; obj.DurationInHours = appointment.DurationInHours; obj.DurationInMinutes = appointment.DurationInMinutes; obj.EmployeeId = appointment.EmployeeId; obj.EmployeeName = appointment.EmployeeName; obj.EndTime = appointment.EndTime; obj.ServiceId = appointment.ServiceId; obj.ServiceName = appointment.ServiceName; obj.StartTime = appointment.StartTime; obj.TimePeriod = appointment.TimePeriod; dateOfBooking = Convert.ToDateTime(appointment.DateOfBooking.Split(',')[1]); book = appointment.DateOfBooking; UpdateAppointmentTime.Text = appointment.TimePeriod; if (objCust != null) { CustID = objCust.Id; AppointmentCustomerName.Text = objCust.FirstName; AppointmentCustomerEmail.Text = objCust.Email; AppointmentCustomerMobNo.Text = objCust.TelephoneNo; } BindingContext = appointment; Data = new Dictionary <string, int> { { "No Label", 1 }, { "Pending", 2 }, { "Confirmed", 3 }, { "Done", 4 }, { "No-Show", 5 }, { "Paid", 6 }, { "Running Late", 7 }, //{ "Custom Label",8} }; foreach (var item in Data.Keys) { AppointmentsPicker.Items.Add(item); } appointment.Status = appointment.Status - 1; AppointmentsPicker.SelectedIndex = appointment.Status; service = new Service(); service.Id = appointment.ServiceId; service.Name = appointment.ServiceName; service.Cost = appointment.Cost; addAppointments = new AddAppointments(); addAppointments.CompanyId = appointment.CompanyId; addAppointments.EmployeeId = EmpID; addAppointments.EmployeeName = empName; addAppointments.ServiceId = ServiceID; addAppointments.ServiceName = ServiceName; addAppointments.Cost = Cost; addAppointments.StartTime = appointment.StartTime; addAppointments.EndTime = appointment.EndTime; addAppointments.TimePeriod = appointment.StartTime; //var NotesList = GetAllCustomerNotes(); //day = Day; //dateOfBooking = DateOfBooking; //EmpID = appointment.EmployeeId; //empName = appointment.EmployeeName; //Cost = appointment.Cost; //CustID = objCust.Id; //ServiceID = appointment.ServiceId; //ServiceName = appointment.ServiceName; //service = new Service(); //service.Id = Convert.ToInt32(appointment.ServiceId); //service.Name = appointment.ServiceName; //service.Cost = appointment.Cost; //addAppointments = new AddAppointments(); //addAppointments.CompanyId = Convert.ToInt32(Application.Current.Properties["CompanyId"]); //addAppointments.EmployeeId = EmpID; //addAppointments.EmployeeName = empName; //addAppointments.ServiceId = ServiceID; //addAppointments.ServiceName = ServiceName; //addAppointments.Cost = Cost; //addAppointments.StartTime = appointment.StartTime; //addAppointments.EndTime = appointment.EndTime; //addAppointments.TimePeriod = appointment.StartTime; //if (objCust != null) //{ // AppointmentCustomerName.Text = objCust.FirstName; // AppointmentCustomerEmail.Text = objCust.Email; // AppointmentCustomerMobNo.Text = objCust.TelephoneNo; //} //ObservableCollection<Notes> notesLst = new ObservableCollection<Notes>(); //foreach (var data in NotesList) //{ // Notes obj = new Notes(); // obj.CompanyId = data.CompanyId; // obj.CreationDate = Convert.ToDateTime(data.CreationDate); // obj.CustomerId = data.CustomerId; // obj.Description = data.Description; // obj.WhoAddedThis = data.WhoAddedThis; // notesLst.Add(obj); //} //notesLst.OrderByDescending(x => x.CreationDate); //UpdateComment.Text = notesLst[0].Description; //foreach (var item in NotesList) //{ // UpdateComment.Text = item.Description; //} //string strttime = appointment.StartTime.Split('-')[0]; //string endtime = appointment.StartTime.Split('-')[1]; //obj = new UpdateAppointments(); //obj.EmployeeId = appointment.EmployeeId; //obj.ServiceId = appointment.ServiceId; //obj.EmployeeName = appointment.EmployeeName; //obj.ServiceName = appointment.ServiceName; //obj.DurationInHours = appointment.DurationInHours; //obj.DurationInMinutes = appointment.DurationInMinutes; //obj.Cost = appointment.Cost; //obj.Currency = appointment.Currency; //obj.StartTime = strttime; //obj.EndTime = endtime; //obj.DateOfBooking = day + "," + dateOfBooking.ToString("dd-MMM-yyyy"); //obj.CommentNotes = objNotes == null ? "" : objNotes.Description; //obj.TimePeriod = appointment.StartTime; //BindingContext = obj; ////string[] Data = { "No Label", "Pending", "Confirmed", "Done", "No-Show", "Paid", "Running Late", "Custom Label" }; //Data = new Dictionary<string, int> //{ // { "No Label",1}, { "Pending",2}, { "Confirmed",3}, { "Done",4}, // { "No-Show",5}, { "Paid",6},{ "Running Late",7}, { "Custom Label",8}, //}; //foreach (var item in Data.Keys) //{ // AppointmentsPicker.Items.Add(item); //} //// var id = Data.TryGetValue("No Label", out StatusId); } catch (Exception e) { e.ToString(); } }
public NewAppointmentPage(AddAppointments objAddAppointments, string Day, DateTime DateOfBooking) { InitializeComponent(); try { var notesList = GetAllCustomerNotes(); GetSelectedCustomerById(); day = Day; //StartHour = objAddAppointments.StartTime; //StartMinutes = objAddAppointments.EndTime; TimePeriods = objAddAppointments.TimePeriod; EndHour = objAddAppointments.DurationInHours; EndMinute = objAddAppointments.DurationInMinutes; //dateOfBooking = DateOfBooking; EmpID = objAddAppointments.EmployeeId; empName = objAddAppointments.EmployeeName; ServiceID = objAddAppointments.ServiceId; ServiceName = objAddAppointments.ServiceName; if (objCust != null) { CustID = objCust.Id; } Cost = objAddAppointments.Cost; DurationInHours = objAddAppointments.DurationInHours; DurationInMinutes = objAddAppointments.DurationInMinutes; service = new Service(); service.Id = Convert.ToInt32(objAddAppointments.ServiceId); service.Name = objAddAppointments.ServiceName; service.Cost = objAddAppointments.Cost; service.DurationInHours = objAddAppointments.DurationInHours; service.DurationInMinutes = objAddAppointments.DurationInMinutes; obj = new AddAppointments(); obj.CompanyId = objAddAppointments.CompanyId; obj.ServiceId = objAddAppointments.ServiceId; obj.EmployeeId = objAddAppointments.EmployeeId; obj.EmployeeName = objAddAppointments.EmployeeName; obj.ServiceName = objAddAppointments.ServiceName; obj.Cost = objAddAppointments.Cost; obj.DurationInHours = objAddAppointments.DurationInHours; obj.DurationInMinutes = objAddAppointments.DurationInMinutes; obj.StartTime = objAddAppointments.StartTime; obj.EndTime = objAddAppointments.EndTime; obj.TimePeriod = objAddAppointments.TimePeriod; obj.Status = objAddAppointments.Status; AppointmentDatelbl.Text = objAddAppointments.StartTime; //objCust = new Customer(); //objCust.Id = Cust.Id; //objCust.FirstName = Cust.FirstName; //objCust.LastName = Cust.LastName; //objCust.UserName = Cust.UserName; //objCust.Email = Cust.Email; //objCust.TelephoneNo = Cust.TelephoneNo; //objCust.Address = Cust.Address; dateOfBooking = Convert.ToDateTime(objAddAppointments.DateOfBooking.Split(',')[1]); AppointmentDatelbl.Text = Day + ", " + DateOfBooking.ToString("dd-MMM-yyyy"); if (objCust != null) { CustName.Text = objCust.FirstName; CustEmail.Text = objCust.Email; CustPhoneNo.Text = objCust.TelephoneNo; } foreach (var item in notesList) { System.Text.RegularExpressions.Regex rx = new System.Text.RegularExpressions.Regex("<.+?>| "); item.Description = rx.Replace(item.Description, ""); //CustomerNote.Text = mystring; AddComment.Text = item.Description; } BindingContext = objAddAppointments; //string[] Data = { "No Label", "Pending", "Confirmed", "Done", "No-Show", "Paid", "Running Late", "Custom Label" }; Data = new Dictionary <string, int> { { "No Label", 1 }, { "Pending", 2 }, { "Confirmed", 3 }, { "Done", 4 }, { "No-Show", 5 }, { "Paid", 6 }, { "Running Late", 7 }, //{ "Custom Label",8} }; if (objAddAppointments.Status != 0) { foreach (var item in Data.Keys) { newAppointmentsPicker.Items.Add(item); } obj.Status = objAddAppointments.Status - 1; newAppointmentsPicker.SelectedIndex = obj.Status; } else { foreach (var item in Data.Keys) { newAppointmentsPicker.Items.Add(item); } newAppointmentsPicker.SelectedIndex = 0; } } catch (Exception e) { e.ToString(); } }
public AppointmentDetailsPage(AppointmentDetails appointment) { try { InitializeComponent(); GetSelectedCustomerById(); GetAppointmentDetails(); objNotes = new Notes(); objNotes.CompanyId = Convert.ToInt32(Application.Current.Properties["CompanyId"]); if (objCust != null) { objNotes.CustomerId = objCust.Id; } objNotes.Description = CommentNotes.Text; Application.Current.Properties["BookingID"] = appointment.BookingId; DateOfBooking = Convert.ToDateTime(appointment.BookingDate); Day = DateOfBooking.DayOfWeek.ToString(); ServiceID = Convert.ToInt32(appointment.ServiceId); ServiceName = appointment.ServiceName; EmpID = Convert.ToInt32(appointment.EmployeeId); empName = appointment.EmployeeName; Cost = appointment.Cost; DurationInHours = appointment.DurationInHours; DurationInMinutes = appointment.DurationInMinutes; DateTime startTime = Convert.ToDateTime(appointment.StartTime); string TimeStart = startTime.ToShortTimeString(); DateTime endTime = Convert.ToDateTime(appointment.EndTime); string TimeEnd = endTime.ToShortTimeString(); string TimePeriod = TimeStart + "-" + TimeEnd; StatusId = statusIDDDd; addAppointments = new AddAppointments(); addAppointments.CompanyId = Convert.ToInt32(Application.Current.Properties["CompanyId"]); addAppointments.BookingId = appointment.BookingId; addAppointments.EmployeeId = EmpID; addAppointments.EmployeeName = empName; addAppointments.ServiceId = ServiceID; addAppointments.ServiceName = ServiceName; addAppointments.Cost = Cost; addAppointments.DurationInHours = DurationInHours; addAppointments.DurationInMinutes = DurationInMinutes; addAppointments.StartTime = appointment.StartTime; addAppointments.EndTime = appointment.EndTime; addAppointments.TimePeriod = TimePeriod; addAppointments.DateOfBooking = appointment.BookingDate; service = new Service(); service.Id = Convert.ToInt32(appointment.ServiceId); service.Name = appointment.ServiceName; service.Cost = appointment.Cost; service.DurationInHours = appointment.DurationInHours; service.DurationInMinutes = appointment.DurationInMinutes; if (objCust != null) { AppointmentCustomerName.Text = objCust.FirstName; AppointmentCustomerEmail.Text = objCust.Email; AppointmentCustomerMobNo.Text = objCust.TelephoneNo; } obj = new AppointmentDetails(); obj.CustomerName = objCust.FirstName; obj.CustomerId = objCust.Id; obj.BookingId = appointment.BookingId; obj.EmployeeId = appointment.EmployeeId; obj.ServiceId = appointment.ServiceId; obj.EmployeeName = appointment.EmployeeName; obj.ServiceName = appointment.ServiceName; obj.DurationInHours = appointment.DurationInHours; obj.DurationInMinutes = appointment.DurationInMinutes; obj.Cost = appointment.Cost; obj.Currency = appointment.Currency; obj.status = statusIDDDd; obj.StartTime = appointment.StartTime; obj.EndTime = appointment.EndTime; obj.BookingDate = appointment.BookingDate; obj.Colour = appointment.Colour; obj.DurationHrsMin = appointment.DurationHrsMin; obj.AppointmentDetail = appointment.AppointmentDetail; obj.CommentNotes = appointment.CommentNotes; obj.TimePeriod = appointment.TimePeriod; BindingContext = obj; Data = new Dictionary <string, int> { { "No Label", 1 }, { "Pending", 2 }, { "Confirmed", 3 }, { "Done", 4 }, { "No-Show", 5 }, { "Paid", 6 }, { "Running Late", 7 }, //{ "Custom Label",8} }; foreach (var item in Data.Keys) { AppointmentsPicker.Items.Add(item); } obj.status = Convert.ToInt32(obj.status) - 1; AppointmentsPicker.SelectedIndex = obj.status; } catch (Exception e) { e.ToString(); } }