///<Summary>Supply a datarow that contains all the database values needed for the appointment that is being added.</Summary> public ContrApptSingle AddAppointment(DataRow row, DataTable tableApptFields, DataTable tablePatFields) { //if appointment is already on the pinboard, just select it. for (int i = 0; i < apptList.Count; i++) { if (apptList[i].AptNum.ToString() == row["AptNum"].ToString()) { //Highlight it selectedIndex = i; apptList[i].IsSelected = true; Invalidate(); } } ContrApptSingle pinApptSingle = new ContrApptSingle( row, tableApptFields, tablePatFields, new Point(0, 13 * apptList.Count)) { ThisIsPinBoard = true, IsSelected = true, }; pinApptSingle.Width = Width - 2; apptList.Add(pinApptSingle); selectedIndex = apptList.Count - 1; Invalidate(); return(pinApptSingle); }
///<Summary>Supply a datarow that contains all the database values needed for the appointment that is being added.</Summary> public void AddAppointment(DataRow row,DataTable tableApptFields,DataTable tablePatFields){ //if appointment is already on the pinboard, just select it. for(int i=0;i<apptList.Count;i++){ if(apptList[i].DataRoww["AptNum"].ToString()==row["AptNum"].ToString()){ //Highlight it selectedIndex=i; apptList[i].IsSelected=true; Invalidate(); //throw new ApplicationException(Lan.g(this,"Appointment is already on the pinboard.")); } } ContrApptSingle PinApptSingle=new ContrApptSingle(); PinApptSingle.ThisIsPinBoard=true; PinApptSingle.DataRoww=row; PinApptSingle.TableApptFields=tableApptFields; PinApptSingle.TablePatFields=tablePatFields; PinApptSingle.Size=ApptSingleDrawing.SetSize(row); PinApptSingle.PatternShowing=ApptSingleDrawing.GetPatternShowing(row["Pattern"].ToString()); PinApptSingle.Width=Width-2; PinApptSingle.IsSelected=true; PinApptSingle.Location=new Point(0,13*apptList.Count); apptList.Add(PinApptSingle); selectedIndex=apptList.Count-1; Invalidate(); }
///<summary>If an appt is already on the pinboard, and the information in it is change externally, this 'refreshes' the data.</summary> public void ResetData(long aptNum) { ContrApptSingle ctrl = apptList.FirstOrDefault(x => x.AptNum == aptNum); if (ctrl == null) { return; } DataTable tableAppts = Appointments.RefreshOneApt(aptNum, false).Tables["Appointments"]; DataRow row = tableAppts.Rows[0]; if (row["AptStatus"].ToString() == "6") //planned so do it again the right way { tableAppts = Appointments.RefreshOneApt(aptNum, true).Tables["Appointments"]; row = tableAppts.Rows[0]; } //The appt fields are not in DS.Tables["ApptFields"] since the appt is not visible on the schedule. DataTable tableApptFields = Appointments.GetApptFields(tableAppts); ctrl.ResetData(row , tableApptFields , Appointments.GetPatFields(tableAppts.Select().Select(x => PIn.Long(x["PatNum"].ToString())).ToList()) , ctrl.Location , false); ctrl.Width = this.Width - 2; Invalidate(); }
///<Summary>Supply a datarow that contains all the database values needed for the appointment that is being added.</Summary> public void AddAppointment(DataRow row, DataTable tableApptFields, DataTable tablePatFields) { //if appointment is already on the pinboard, just select it. for (int i = 0; i < apptList.Count; i++) { if (apptList[i].DataRoww["AptNum"].ToString() == row["AptNum"].ToString()) { //Highlight it selectedIndex = i; apptList[i].IsSelected = true; Invalidate(); //throw new ApplicationException(Lan.g(this,"Appointment is already on the pinboard.")); } } ContrApptSingle PinApptSingle = new ContrApptSingle(); PinApptSingle.ThisIsPinBoard = true; PinApptSingle.DataRoww = row; PinApptSingle.TableApptFields = tableApptFields; PinApptSingle.TablePatFields = tablePatFields; PinApptSingle.Size = ApptSingleDrawing.SetSize(row); PinApptSingle.PatternShowing = ApptSingleDrawing.GetPatternShowing(row["Pattern"].ToString()); PinApptSingle.Width = Width - 2; PinApptSingle.IsSelected = true; PinApptSingle.Location = new Point(0, 13 * apptList.Count); apptList.Add(PinApptSingle); selectedIndex = apptList.Count - 1; Invalidate(); }