public ChildcardEditForm(String tabNumber) { InitializeComponent(); dbLinker = new DBLinker(); List <Child> allChilds = dbLinker.GetChildList(); if (!tabNumber.Equals("New")) { New = false; // try // { foreach (Child kid in allChilds) { if (kid.TabNumber.Equals(tabNumber)) { this.child = kid; break; } } DisplayChild(); /* } * catch(Exception e) * { * MessageBox.Show("Child with this tab number was not found"); * this.Dispose(); * }*/ } else { New = true; child = new Child(); child.TabNumber = (Int32.Parse(allChilds[allChilds.Count - 1].TabNumber) + 1).ToString(); } }
public HomeController() { dbLinker = new DBLinker(); Childs = new List <Child>(); LoadChilds(); CalculateSum(); Groups = dbLinker.GetAllGroups(); Privileges = dbLinker.GetAllPrivileges(); }
public AdminAddForm() { InitializeComponent(); dbLinker = new DBLinker(); }