private void MakeAppoint(object record) { InfoAppoint myRecord = (InfoAppoint)record; if (myRecord.Text == "Free" || myRecord.Text == "Booked") { DoRecord dr = new DoRecord(myRecord); dr.ShowDialog(); } else { MessageBox.Show("Record anavailable"); } }
public MakeAnAppointment(InfoAppoint IA) { pat = new Patient() { Policy = "" }; record = IA; year = record.Date.Year; month = record.Date.Month; day = record.Date.Day; hour = Convert.ToInt32(record.Time.Substring(0, record.Time.LastIndexOf(':'))); visibleRec = "Visibile"; VisibleDel = "Hidden"; CurrentDateTime = new DateTime(year, month, day, hour, 0, 0); if (record.Text == "Booked") { VisibleDel = "Visible"; visibleRec = "Hidden"; TakeInfoAboutPat(); DelAppoint = new RelayCommand(x => DelRecord()); } showDate = CurrentDateTime.ToString("g"); MakeAppoint = new RelayCommand(x => MakeRecord(CurrentDateTime)); }