private bool IsValidForCalculations() { GuardianInfoDB parentDB = new GuardianInfoDB(); ChildInfoDatabase childDB = new ChildInfoDatabase(); if (!parentDB.GuardianNameExists(txt_GuardianName.Text)) { return(false); } if (!childDB.ChildNameExists(txt_ChildName.Text)) { return(false); } if (cmb_EventName.SelectedIndex < 0) { return(false); } if (!ValidTime(txt_CheckIn.Text)) { return(false); } if (!ValidTime(txt_CheckOut.Text)) { return(false); } if (!ValidDate(txt_Date.Text)) { return(false); } return(true); }
public LinkExistingChild(string pID, ArrayList connectedChildren) { InitializeComponent(); this.db = new ChildInfoDatabase(); this.ID = pID; this.connectedChildren = connectedChildren; setChildBox(); this.MouseDown += WindowMouseDown; }
public Link_DeLinkChild(int link, string cID) { linked = link; childID = cID; InitializeComponent(); this.db = new ChildInfoDatabase(); this.MouseDown += WindowMouseDown; txt_GuardianID.Focus(); }
private void ReadyTransaction(object sender, RoutedEventArgs e) { TransactionDB transDB = new TransactionDB(); ConnectionsDB conDB = new ConnectionsDB(); ChildInfoDatabase childDB = new ChildInfoDatabase(); GuardianInfoDB parentDB = new GuardianInfoDB(); if (parentDB.GuardianNameExists(txt_GuardianName.Text) && childDB.ChildNameExists(txt_ChildName.Text)) { SetAllowanceID(); this.transaction = new TransactionCharge(conDB.GetGuardianID(allowanceID), allowanceID); CalculateTransaction(sender, e); } }
private bool VerifyFormData() { GuardianInfoDB parentDB = new GuardianInfoDB(); ChildInfoDatabase childDB = new ChildInfoDatabase(); EventDB eventDB = new EventDB(); if (!parentDB.GuardianNameExists(txt_GuardianName.Text)) { WPFMessageBox.Show("The guardian name you entered does not exist in the database! Please verify you have spelled it correctly."); txt_GuardianName.Focus(); return(false); } if (!childDB.ChildNameExists(txt_ChildName.Text)) { WPFMessageBox.Show("The child name you entered does not exist in the database! Please verify you have spelled it correctly."); txt_ChildName.Focus(); return(false); } if (cmb_EventName.SelectedIndex < 0) { WPFMessageBox.Show("You must select an event from the drop down menu!"); cmb_EventName.Focus(); return(false); } if (!ValidTime(txt_CheckIn.Text)) { WPFMessageBox.Show("You must enter a valid time in the checked in text box!"); txt_CheckIn.Focus(); return(false); } if (!ValidTime(txt_CheckOut.Text)) { WPFMessageBox.Show("You must enter a valid time in the checked out text box!"); txt_CheckOut.Focus(); return(false); } if (!ValidDate(txt_Date.Text)) { WPFMessageBox.Show("You must enter a valid date in the transaction date text box!"); txt_Date.Focus(); return(false); } if (!ValidTransactionTotal(txt_TransactionTotal.Text)) { WPFMessageBox.Show("You must enter a valid transaction total in the transaction total text box!"); txt_TransactionTotal.Focus(); return(false); } return(true); }
public AdminEditChildInfo(string parentID) { InitializeComponent(); this.ID = parentID; this.db = new ChildInfoDatabase(); var bc = new BrushConverter(); cnv_ChildIcon.Background = (Brush)bc.ConvertFrom("#FFE6EAE0"); //setting canvas color so we can see it btn_Delete.Background = new SolidColorBrush(Colors.Red); LoadParentInfo(parentID); setChildBox(); lst_ChildBox.SelectionChanged += ListBoxSelectionChanged; this.MouseDown += WindowMouseDown; this.dte_Birthday.Loaded += delegate { var textBox = (TextBox)dte_Birthday.Template.FindName("PART_TextBox", dte_Birthday); textBox.Background = dte_Birthday.Background; }; }
private void LoadData() { ChildInfoDatabase childDB = new ChildInfoDatabase(); TransactionDB transDB = new TransactionDB(); GuardianInfoDB parentDB = new GuardianInfoDB(); ConnectionsDB conDB = new ConnectionsDB(); this.txt_ChildName.Text = childDB.GetChildName(this.transactionID); this.txt_GuardianName.Text = transDB.GetParentNameFromTrans(this.transactionID); this.originalFee = transDB.GetTransactionTotal(this.transactionID); this.txt_TransactionTotal.Text = String.Format("{0:0.00}", transDB.GetTransactionTotal(this.transactionID)); this.originalEventName = transDB.GetTransEventName(this.transactionID); string eventName = this.originalEventName; LoadEventCMB(eventName); this.txt_CheckIn.Text = transDB.GetTwelveHourTime(this.transactionID, "CheckedIn"); this.txt_CheckOut.Text = transDB.GetTwelveHourTime(this.transactionID, "CheckedOut"); this.txt_Date.Text = transDB.GetTransactionDate(this.transactionID); this.transaction = new TransactionCharge(transDB.GetGuardianIDFromTrans(this.transactionID), conDB.GetAllowanceID(this.transactionID)); }
public void SetUpCheckInBox() { ChildInfoDatabase childDB = new ChildInfoDatabase(); string[,] childrenData = childDB.FindChildren(this.guardianID); if (childrenData == null) { return; } for (int x = 0; x < childrenData.GetLength(0); x++) { Image image = BuildImage(childrenData[x, 6], 70); if (!db.IsCheckedIn(childrenData[x, 0], this.guardianID)) { lst_CheckInBox.Items.Add(new Child(childrenData[x, 0], childrenData[x, 1], childrenData[x, 2], image, childrenData[x, 3], childrenData[x, 4], childrenData[x, 5], childrenData[x, 6])); } else { lst_CheckOutBox.Items.Add(new Child(childrenData[x, 0], childrenData[x, 1], childrenData[x, 2], image, childrenData[x, 3], childrenData[x, 4], childrenData[x, 5], childrenData[x, 6])); } } }