private void Button_Click(object sender, RoutedEventArgs e) { Window back = new CSWindow(employee); back.Show(); this.Close(); }
private void bacl(object sender, RoutedEventArgs e) { Window a = new CSWindow(employee); a.Show(); this.Close(); }
private void submit(object sender, RoutedEventArgs e) { if (accnumtxt.Text == "") { MessageBox.Show("Account Number must be inputted!"); accnumtxt.Text = ""; amountxt.Text = ""; combobox.SelectedIndex = -1; return; } if (amountxt.Text == "") { MessageBox.Show("Amount must not be empty!"); amountxt.Text = ""; combobox.SelectedIndex = -1; accnumtxt.Text = ""; return; } if (combobox.SelectedIndex == -1) { MessageBox.Show("Must choose loan reason!"); amountxt.Text = ""; combobox.SelectedIndex = -1; accnumtxt.Text = ""; return; } if (Int32.Parse(amountxt.Text.ToString()) < 10000000 || Int32.Parse(amountxt.Text.ToString()) > 100000000) { MessageBox.Show("Amount must be between 10000000 and 100000000!"); amountxt.Text = ""; combobox.SelectedIndex = -1; accnumtxt.Text = ""; return; } DataTable dt = new DataTable(); dt = connect.executeQuery("select sum(amount) as 'Loan' from guaranteedocument where accountnumber = '" + accnumtxt.Text.ToString() + "'"); DataRow data = dt.Rows[0]; if (Int32.Parse(data["Loan"].ToString()) < Int32.Parse(amountxt.Text.ToString())) { MessageBox.Show("Loan not accepted!"); return; } connect.executeQuery("insert into loanrequest values ('" + accnumtxt.Text.ToString() + "', 'Individual', '" + combobox.SelectedValue.ToString() + "'," + Int32.Parse(amountxt.Text.ToString()) + ", 'Pending')"); connect.executeQuery("insert into financenotif values ('Customer Service', '" + employee.id + "', 'Individual Loan Request'," + Int32.Parse(amountxt.Text.ToString()) + ")"); MessageBox.Show("Request submitted!"); Window cswindow = new CSWindow(employee); cswindow.Show(); this.Close(); }
private void Button_Click(object sender, RoutedEventArgs e) { DataTable dt = new DataTable(); connect.executeUpdate("update queue set status = 'Done' where division = 'Customer Service' and status in ('Not Done') limit 1"); dt = connect.executeQuery("select * from queue where division = 'Customer Service' and status in ('Not Done') limit 1"); csq.erase(); if (dt.Rows.Count == 1) { DataRow data = dt.Rows[0]; csq.setValue(data["queueno"].ToString(), data["uniquequeue"].ToString()); } connect.executeUpdate("update employee set rating = (((rating*ratecount) + " + float.Parse(star.ToString()) + ")/(ratecount+1)), ratecount = (ratecount + 1) where id = '" + employee.id + "'"); MessageBox.Show("Thank You For Your Rating! "); Window cswindow = new CSWindow(employee); cswindow.Show(); this.Close(); }
private void submit(object sender, RoutedEventArgs e) { string itemid = itemtxt.Text; DataTable dt = new DataTable(); dt = connect.executeQuery("select * from item where employee = '" + employee.id + "' and itemid = '" + itemid + "' limit 1"); if (dt.Rows.Count == 0) { label.Content = "Invalid item!"; return; } else { DataRow data; data = dt.Rows[0]; string emp = data["employee"].ToString(); if (data["itemstatus"].ToString() == "Broken") { label.Content = "Item is already reported!"; return; } else { MessageBox.Show("Success Reporting Item"); connect.executeUpdate("insert into schedule values ('" + itemid + "', 'Teller " + data["itemname"].ToString() + "', CURRENT_DATE + (SELECT((COUNT(*) + 1) / 3) + 1 from item where itemstatus = 'Broken'),'Not Fixed')"); connect.executeUpdate("update item set itemstatus = 'Broken' where itemid = '" + itemid + "'"); Window back = new CSWindow(employee); back.Show(); this.Close(); } } }
private void submitbtn(object sender, RoutedEventArgs e) { if (accnumtxt.Text == "") { MessageBox.Show("Account number must be inputted!"); accnumtxt.Text = ""; amountxt.Text = ""; return; } DataTable dt = new DataTable(); dt = connect.executeQuery("select * from customer where accountnumber = '" + accnumtxt.Text + "'"); if (dt.Rows.Count == 0) { MessageBox.Show("User must be registered in this bank!"); accnumtxt.Text = ""; amountxt.Text = ""; return; } DataTable dt2 = new DataTable(); dt2 = connect.executeQuery("select * from saving where accountnumber = '" + accnumtxt.Text.ToString() + "'"); if (dt2.Rows.Count > 0) { MessageBox.Show("User has already registered saving account!"); accnumtxt.Text = ""; amountxt.Text = ""; return; } connect.executeUpdate("insert into saving values('" + accnumtxt.Text + "','SA+cast ((select count(*)+1 from saving) as varchar)'," + amountxt.Text + ",current_Date)"); MessageBox.Show("Success!"); Window a = new CSWindow(employee); a.Show(); this.Close(); }
private void Button_Click(object sender, RoutedEventArgs e) { if (username.Text == "") { MessageBox.Show("USERNAME MUST NOT BE EMPTY!"); return; } if (password.Password == "") { MessageBox.Show("PASSWORD MUST NOT BE EMPTY!"); return; } string id = username.Text; string pass = password.Password; DataTable dt = new DataTable(); dt = connect.executeQuery("select * from employee where id = '" + id + "' and password = '******' and status = 'Active' limit 1"); if (dt.Rows.Count == 0) { MessageBox.Show("Invalid Username/Password!"); return; } else { DataRow data = dt.Rows[0]; Employee emp = new Employee(data["id"].ToString(), data["name"].ToString(), data["password"].ToString(), Int32.Parse(data["salary"].ToString()), float.Parse(data["rating"].ToString()), Int32.Parse(data["ratecount"].ToString())); MessageBox.Show("Success!"); if (id[0] == 'T') { Window tellerwindow = new TellerWindow(emp); tellerwindow.Show(); this.Close(); } else if (id[0] == 'C') { Window cswindow = new CustomerService.CSWindow(emp); cswindow.Show(); this.Close(); } else if (id[0] == 'S') { Window swindow = new Security_and_Maintenance_Team.SMWindow(emp); swindow.Show(); this.Close(); } else if (id[0] == 'M') { Window mwindow = new Manager.ManagerWindow(emp); mwindow.Show(); this.Close(); } else if (id[0] == 'H') { Window hwindow = new Human_Resource_Management_Team.HRMWindow(emp); hwindow.Show(); this.Close(); } else if (id[0] == 'F') { Window fwindow = new Finance.FinanceWindow(emp); fwindow.Show(); this.Close(); } } }
private void nextbtn(object sender, RoutedEventArgs e) { if (idcardtxt.Text == "") { MessageBox.Show("Identity Card must not be empty!"); idcardtxt.Text = ""; nametxt.Text = ""; fcardtxt.Text = ""; dobpicker.SelectedDate = new DateTime(2001, 08, 26); return; } if (fcardtxt.Text == "") { MessageBox.Show("Family Card must not be empty!"); idcardtxt.Text = ""; nametxt.Text = ""; fcardtxt.Text = ""; dobpicker.SelectedDate = new DateTime(2001, 08, 26); return; } if (nametxt.Text == "") { MessageBox.Show("Name must not be empty!"); idcardtxt.Text = ""; nametxt.Text = ""; fcardtxt.Text = ""; dobpicker.SelectedDate = new DateTime(2001, 08, 26); return; } if (combobox.SelectedIndex == -1) { MessageBox.Show("Combo Box must be chosen!"); idcardtxt.Text = ""; nametxt.Text = ""; fcardtxt.Text = ""; dobpicker.SelectedDate = new DateTime(2001, 08, 26); return; } if (amountxt.Text == "") { MessageBox.Show("Amount must be inputted!"); idcardtxt.Text = ""; nametxt.Text = ""; fcardtxt.Text = ""; dobpicker.SelectedDate = new DateTime(2001, 08, 26); return; } if (DateTime.Now.Year - DateTime.Parse(dobpicker.SelectedDate.Value.ToString()).Year > 15) { if (combobox.SelectedValue.ToString() == "Student") { MessageBox.Show("You cannot make student acc!"); return; } } if (combobox.SelectedValue.ToString() != "Student") { if (Int32.Parse(amountxt.Text.ToString()) < 50000) { MessageBox.Show("Minimal amount of bronze account is 50000!"); return; } } else if (combobox.SelectedValue.ToString() == "Student") { if (Int32.Parse(amountxt.Text.ToString()) < 5000) { MessageBox.Show("Minimal amount of bronze account is 5000!"); return; } } DataTable dt = new DataTable(); dt = connect.executeQuery("select * from customer where identitycard = '" + idcardtxt.Text.ToString() + "'"); if (dt.Rows.Count > 0) { MessageBox.Show("User has already registered!"); idcardtxt.Text = ""; nametxt.Text = ""; fcardtxt.Text = ""; dobpicker.SelectedDate = new DateTime(2001, 08, 26); return; } DataTable dt2 = new DataTable(); dt2 = connect.executeQuery("select * from customer where familycard = '" + fcardtxt.Text.ToString() + "' and age > 15"); if (dt2.Rows.Count == 0) { MessageBox.Show("User must have a guardian registered in this bank!"); return; } connect.executeUpdate("insert into customer values ('(select cast(accountnumber as int) + 1 from customer order by accountnumber desc limit 1)', " + "'" + combobox.SelectedValue.ToString() + "','123456','" + nametxt.Text.ToString() + ",'" + idcardtxt.Text.ToString() + "','" + fcardtxt.Text.ToString() + "', " + (DateTime.Now.Year - DateTime.Parse(dobpicker.SelectedDate.Value.ToString()).Year) + "," + amountxt.Text + ", current_date )"); MessageBox.Show("Success!"); Window a = new CSWindow(employee); a.Show(); this.Close(); }
private void submitbtn(object sender, RoutedEventArgs e) { if (accnumtxt.Text == "") { MessageBox.Show("Account number must be inputted!"); accnumtxt.Text = ""; amountxt.Text = ""; checkbox.IsChecked = false; return; } if (amountxt.Text == "") { MessageBox.Show("Amount must not be empty!"); accnumtxt.Text = ""; amountxt.Text = ""; checkbox.IsChecked = false; return; } if (combobox_time.SelectedIndex == -1) { MessageBox.Show("Time must be selected!"); accnumtxt.Text = ""; amountxt.Text = ""; checkbox.IsChecked = false; return; } else if (Int32.Parse(amountxt.Text) < 1000000 && combobox.SelectedValue.ToString().Equals("IDR")) { MessageBox.Show("Deposit amount must be minimal IDR 1000000!"); accnumtxt.Text = ""; amountxt.Text = ""; checkbox.IsChecked = false; return; } else if (Int32.Parse(amountxt.Text) < 94 && combobox.SelectedValue.ToString().Equals("SGD")) { MessageBox.Show("Deposit amount must be minimal SGD 94!"); accnumtxt.Text = ""; amountxt.Text = ""; checkbox.IsChecked = false; return; } else if (Int32.Parse(amountxt.Text) < 70 && combobox.SelectedValue.ToString().Equals("USD")) { MessageBox.Show("Deposit amount must be minimal USD 70!"); accnumtxt.Text = ""; amountxt.Text = ""; checkbox.IsChecked = false; return; } DataTable dt = new DataTable(); dt = connect.executeQuery("select * from customer where accountnumber = '" + accnumtxt.Text + "'"); if (dt.Rows.Count == 0) { MessageBox.Show("User must be registered in this bank!"); accnumtxt.Text = ""; amountxt.Text = ""; checkbox.IsChecked = false; return; } DataTable dt2 = new DataTable(); dt2 = connect.executeQuery("select * from deposit where accountnumber = '" + accnumtxt.Text.ToString() + "'"); if (dt2.Rows.Count != 0) { MessageBox.Show("User has already registered deposit account!"); accnumtxt.Text = ""; amountxt.Text = ""; checkbox.IsChecked = false; return; } int time = 0; if (combobox_time.SelectedIndex == 0) { time = 3; } else if (combobox_time.SelectedIndex == 1) { time = 6; } else { time = 12; } int aro = 0; if (checkbox.IsChecked == true) { aro = 0; } else { aro = 1; } connect.executeUpdate("insert into deposit values('" + accnumtxt.Text + "'," + amountxt.Text + ",'" + combobox.SelectedValue + "', current_date, current_Date + interval " + time + " month, " + time + ", " + aro + ")"); MessageBox.Show("Success!"); Window a = new CSWindow(employee); a.Show(); this.Close(); }