///<summary>Fills ListShort and ListLong with all claimforms from the db. Also attaches corresponding claimformitems to each.</summary> public static void Refresh() { string command = "SELECT * FROM claimform"; DataTable table = General.GetTable(command); ListLong = new ClaimForm[table.Rows.Count]; ArrayList tempAL = new ArrayList(); for (int i = 0; i < table.Rows.Count; i++) { ListLong[i] = new ClaimForm(); ListLong[i].ClaimFormNum = PIn.PInt(table.Rows[i][0].ToString()); ListLong[i].Description = PIn.PString(table.Rows[i][1].ToString()); ListLong[i].IsHidden = PIn.PBool(table.Rows[i][2].ToString()); ListLong[i].FontName = PIn.PString(table.Rows[i][3].ToString()); ListLong[i].FontSize = PIn.PFloat(table.Rows[i][4].ToString()); ListLong[i].UniqueID = PIn.PString(table.Rows[i][5].ToString()); ListLong[i].PrintImages = PIn.PBool(table.Rows[i][6].ToString()); ListLong[i].OffsetX = PIn.PInt(table.Rows[i][7].ToString()); ListLong[i].OffsetY = PIn.PInt(table.Rows[i][8].ToString()); ListLong[i].Items = ClaimFormItems.GetListForForm(ListLong[i].ClaimFormNum); if (!ListLong[i].IsHidden) { tempAL.Add(ListLong[i]); } } ListShort = new ClaimForm[tempAL.Count]; for (int i = 0; i < ListShort.Length; i++) { ListShort[i] = (ClaimForm)tempAL[i]; } }
///<summary>Fills the specified array of Appointments using the supplied SQL command.</summary> private static Appointment[] FillList(string command) { DataTable table = General.GetTable(command); Appointment[] list = new Appointment[table.Rows.Count]; for (int i = 0; i < table.Rows.Count; i++) { list[i] = new Appointment(); list[i].AptNum = PIn.PInt(table.Rows[i][0].ToString()); list[i].PatNum = PIn.PInt(table.Rows[i][1].ToString()); list[i].AptStatus = (ApptStatus)PIn.PInt(table.Rows[i][2].ToString()); list[i].Pattern = PIn.PString(table.Rows[i][3].ToString()); list[i].Confirmed = PIn.PInt(table.Rows[i][4].ToString()); list[i].AddTime = PIn.PInt(table.Rows[i][5].ToString()); list[i].Op = PIn.PInt(table.Rows[i][6].ToString()); list[i].Note = PIn.PString(table.Rows[i][7].ToString()); list[i].ProvNum = PIn.PInt(table.Rows[i][8].ToString()); list[i].ProvHyg = PIn.PInt(table.Rows[i][9].ToString()); list[i].AptDateTime = PIn.PDateT(table.Rows[i][10].ToString()); list[i].NextAptNum = PIn.PInt(table.Rows[i][11].ToString()); list[i].UnschedStatus = PIn.PInt(table.Rows[i][12].ToString()); list[i].Lab = (LabCase)PIn.PInt(table.Rows[i][13].ToString()); list[i].IsNewPatient = PIn.PBool(table.Rows[i][14].ToString()); list[i].ProcDescript = PIn.PString(table.Rows[i][15].ToString()); list[i].Assistant = PIn.PInt(table.Rows[i][16].ToString()); list[i].InstructorNum = PIn.PInt(table.Rows[i][17].ToString()); list[i].SchoolClassNum = PIn.PInt(table.Rows[i][18].ToString()); list[i].SchoolCourseNum = PIn.PInt(table.Rows[i][19].ToString()); list[i].GradePoint = PIn.PFloat(table.Rows[i][20].ToString()); list[i].ClinicNum = PIn.PInt(table.Rows[i][21].ToString()); list[i].IsHygiene = PIn.PBool(table.Rows[i][22].ToString()); } return(list); }
///<summary>Gets all toothinitial entries for the current patient.</summary> public static ToothInitial[] Refresh(int patNum) { string command = "SELECT * FROM toothinitial" + " WHERE PatNum = " + POut.PInt(patNum); DataTable table = General.GetTable(command); ToothInitial[] List = new ToothInitial[table.Rows.Count]; for (int i = 0; i < List.Length; i++) { List[i] = new ToothInitial(); List[i].ToothInitialNum = PIn.PInt(table.Rows[i][0].ToString()); List[i].PatNum = PIn.PInt(table.Rows[i][1].ToString()); List[i].ToothNum = PIn.PString(table.Rows[i][2].ToString()); List[i].InitialType = (ToothInitialType)PIn.PInt(table.Rows[i][3].ToString()); List[i].Movement = PIn.PFloat(table.Rows[i][4].ToString()); } return(List); }
///<summary>Gets all claimformitems for all claimforms. Items for individual claimforms can later be extracted as needed.</summary> public static void Refresh() { string command = "SELECT * FROM claimformitem ORDER BY imagefilename desc"; DataTable table = General.GetTable(command); List = new ClaimFormItem[table.Rows.Count]; for (int i = 0; i < table.Rows.Count; i++) { List[i] = new ClaimFormItem(); List[i].ClaimFormItemNum = PIn.PInt(table.Rows[i][0].ToString()); List[i].ClaimFormNum = PIn.PInt(table.Rows[i][1].ToString()); List[i].ImageFileName = PIn.PString(table.Rows[i][2].ToString()); List[i].FieldName = PIn.PString(table.Rows[i][3].ToString()); List[i].FormatString = PIn.PString(table.Rows[i][4].ToString()); List[i].XPos = PIn.PFloat(table.Rows[i][5].ToString()); List[i].YPos = PIn.PFloat(table.Rows[i][6].ToString()); List[i].Width = PIn.PFloat(table.Rows[i][7].ToString()); List[i].Height = PIn.PFloat(table.Rows[i][8].ToString()); } }