private void Button1_Click(object sender, EventArgs e) { if (checkBox3.Checked) { Enrollee.plan = true; } else { Enrollee.plan = false; } String fullname = textBox1.Text; String ssn = textBox2.Text; String bAddress = textBox3.Text; String mAddress = textBox4.Text; String username = textBox5.Text; String password = textBox6.Text; string pin = PINTextBox.Text; DBMng.insertIntoPrimaryEnrollee(plantype, fullname, username, password, mAddress, bAddress, ssn, pin); int id; id = DBMng.validateEnrollee(username, password); if (DBMng.getPlanTypeEnrollee(id) == "basic") { DBMng.updateDeductible(id, 250); } this.Hide(); EnrolleeHomePage newEnrolleeInfo = new EnrolleeHomePage(id); newEnrolleeInfo.ShowDialog(); }
public Bills(double amount, int enrid, int servicenumber) { amt = amount; enid = enrid; service = setService(servicenumber); plan = DBMng.getPlanTypeEnrollee(enrid); }
private void button1_Click(object sender, EventArgs e) { String username = this.textBox1.Text; String password = this.textBox2.Text; id = DBMng.validateEnrollee(username, password); if (id != 0) { // We can make a list of users for the next iteration // I don't feel like it right now // this should be in an if-else branch Enrollee.CurrentUser = username; this.Hide(); EnrolleeHomePage newform = new EnrolleeHomePage(id); newform.ShowDialog(); } else { this.label3.Visible = true; } this.textBox1.Text = ""; this.textBox2.Text = ""; }
public string createNewBill(double amt, int id, int servicenumber) { Bills b = new Bills(amt, id, servicenumber); DBMng.insertIntoBills(b); return("Successfully billed"); }
private void Button1_Click(object sender, EventArgs e) { String name = companyNameTxtBox.Text; string services = ""; foreach (object itemChecked in checkedListBox1.CheckedIndices) { services = services + itemChecked.ToString() + ","; } services = services.Remove(services.Length - 1, 1); string username = textBox1.Text; string password = textBox2.Text; String phoneNumber = phoneNumberTxtBox.Text; String companyEmail = companyEmailTxtBox.Text; String remittanceAddress = addressTxtBox.Text; String bank = bankTxtBox.Text; String accountNum = accountNumTxtBox.Text; String routingNum = routingNumTxtBox.Text; String loginPIN = loginPinTxtBox.Text; DBMng.insertIntohsp(name, services, username, password, companyEmail, phoneNumber, remittanceAddress, bank, accountNum, routingNum, loginPIN); int id = DBMng.validateHSPWithPin(loginPIN); this.Hide(); HSPinfoGUI info = new HSPinfoGUI(id); info.ShowDialog(); }
private void Button1_Click(object sender, EventArgs e) { if (whoLogged == 0) { userId = DBMng.validateEnrolleeWithPin(textBox1.Text); if (userId != 0) { this.Hide(); EnrolleeHomePage newform = new EnrolleeHomePage(userId); newform.ShowDialog(); } label2.Visible = true; textBox1.Text = ""; } else { userId = DBMng.validateHSPWithPin(textBox1.Text); if (userId != 0) { this.Hide(); HSPinfoGUI info = new HSPinfoGUI(userId); info.ShowDialog(); } label2.Visible = true; textBox1.Text = ""; } }
private void Button1_Click(object sender, EventArgs e) { DBMng.changePlan(userId); this.Hide(); EnrolleeHomePage newform = new EnrolleeHomePage(userId); newform.ShowDialog(); }
private void Button2_Click(object sender, EventArgs e) { int index; index = billBox.SelectedIndex; Bills b = DBMng.getBill(index); label2.Text = cntrl.payBill(b); billBox.Items.RemoveAt(index); }
public CashReport(int id) { idNum = id; int numEnrollees = DBMng.getTotalNumOfEnrollees(); int income = DBMng.getIncome(); InitializeComponent(); label4.Text = numEnrollees.ToString(); label5.Text = income.ToString(); }
public ManagerDisplay() { InitializeComponent(); numOfEnrollees = DBMng.getNumOfEnrollees(); enrollees = DBMng.getEnrollees(numOfEnrollees); for (int i = 0; i < numOfEnrollees; i++) { listBox1.Items.Add(enrollees[i, 2]); } }
public static void changePlan(int id) { int planid = 0; MySqlConnection mycon = connectOutOfSIUE(); MySqlDataReader rd; mycon.Open(); string query = "select plan$id from primaryEnrollee where id=" + id; MySqlCommand cmd = new MySqlCommand(); cmd.Connection = mycon; cmd.CommandText = query; cmd.Prepare(); rd = cmd.ExecuteReader(); while (rd.Read()) { planid = rd.GetInt32(0); } string type = ""; query = "select type from plan where id=" + planid; cmd.CommandText = query; cmd.Prepare(); rd.Close(); rd = cmd.ExecuteReader(); while (rd.Read()) { type = rd.GetString(0); } if (type == "basic") { query = "update plan set type = 'extended' where id=" + planid; } else { query = "update plan set type = 'basic' where id=" + planid; } rd.Close(); cmd.CommandText = query; cmd.Prepare(); cmd.ExecuteNonQuery(); mycon.Close(); if (type == "basic") { DBMng.updateDeductible(id, 250); } else { DBMng.updateDeductible(id, 0); } }
public SeeBillsGUI(int id) { InitializeComponent(); enrid = id; billList = DBMng.getBillsFromEnrollee(enrid); foreach (Bills bill in billList) { if (bill.getIsPaid() != true) { billBox.Items.Add(cntrl.getEnrolleePayAmt(bill).ToString()); } } }
private void button1_Click(object sender, EventArgs e) { string username = textBox1.Text; string password = textBox2.Text; string billingA = textBox3.Text; string mailingA = textBox4.Text; string name = textBox5.Text + " " + textBox6.Text; string phoneNum = textBox7.Text; string email = textBox8.Text; string pin = textBox9.Text; DBMng.editPrimaryEnrollee(enrolleeID, name, username, password, mailingA, billingA, email, phoneNum, pin); }
public submitBills(int id) { InitializeComponent(); numEnrollees = DBMng.getNumOfEnrollees(); enrollees = DBMng.getEnrollees(numEnrollees); for (int i = 0; i < numEnrollees; i++) { listBox2.Items.Add(enrollees[i, 2]); } string[] info = DBMng.getHSPInfo(id); string[] services = info[2].Split(','); displayServices(services); }
private void Button1_Click(object sender, EventArgs e) { bool found = false; string HSPName = hspNameTxtBox.Text; found = DBMng.findHSP(HSPName); if (found) { HSPFound.Text = "HSP found: Y"; } else { HSPFound.Text = "HSP found: N"; } }
public HSPinfoGUI(int id) { InitializeComponent(); hspid = id; string[] info = DBMng.getHSPInfo(hspid); string[] services = info[2].Split(','); displayServices(services); NameTxt.Text = info[1]; phoneTxt.Text = info[7]; addressTxt.Text = info[8]; bankTxt.Text = info[9]; acctNumTxt.Text = info[10]; routingTxt.Text = info[11]; pinTxt.Text = info[5]; }
private void button1_Click(object sender, EventArgs e) { string username = textBox2.Text; string password = textBox1.Text; int id = DBMng.validateHSP(username, password); if (id != 0) { this.Hide(); HSPinfoGUI info = new HSPinfoGUI(id); info.ShowDialog(); } else { label4.Visible = true; } }
public string payBill(Bills bill) { int id = bill.getBillId(); int enrid = bill.getEnrolleeId(); double deductible = Convert.ToDouble(DBMng.getDeductible(enrid)); if (deductible > bill.getAmount()) { DBMng.updateDeductible(enrid, Convert.ToInt32(deductible - bill.getAmount())); DBMng.updateIsPaid(id); } else { DBMng.updateDeductible(enrid, 0); DBMng.updateIsPaid(id); } return("Bill has been paid."); }
private void button5_Click(object sender, EventArgs e) { string adminnum = textBox1.Text; string fullname = textBox2.Text; if (DBMng.validateManager(adminnum, fullname)) { this.Hide(); ManagerDisplay newform = new ManagerDisplay(); newform.ShowDialog(); } else { textBox1.Text = ""; textBox2.Text = ""; this.label3.Visible = true; } }
public static string getPlanTypeEnrollee(int id) { int planid = 0; string plantype; MySqlConnection mycon = connectOutOfSIUE(); MySqlDataReader rd; mycon.Open(); string query = "select plan$id from primaryEnrollee where id=" + id; MySqlCommand cmd = new MySqlCommand(); cmd.Connection = mycon; cmd.CommandText = query; cmd.Prepare(); rd = cmd.ExecuteReader(); while (rd.Read()) { planid = rd.GetInt32(0); } rd.Close(); mycon.Close(); plantype = DBMng.getPlanType(planid); return(plantype); }
private void Button1_Click(object sender, EventArgs e) { int serviceid; serviceid = getServiceIndex(listBox1.GetItemText(listBox1.SelectedItem)); if (serviceid == -1) { label4.Text = "No Service"; } else if (listBox1.SelectedIndex == -1) { label4.Text = "Please Select a Service"; } else if (listBox2.SelectedIndex == -1) { label4.Text = "Please Select an Enrollee to Bill"; } else { Bills b = new Bills(double.Parse(textBox1.Text), listBox2.SelectedIndex, serviceid); DBMng.insertIntoBills(b); label4.Text = "Success"; } }
//-------------------------// //WHY ARE THERE NO COMMENTS// //-------------------------// public double getEnrolleePayAmt(Bills bill) { int id = bill.getEnrolleeId(); double deductible = Convert.ToDouble(DBMng.getDeductible(id)); if (deductible > bill.getAmount()) { return(bill.getAmount()); } else if ((bill.getAmount() > deductible) && (bill.getCopay() > 0)) { if (bill.getCopay() > deductible) { return(bill.getCopay()); } else if (bill.getNetworkCharge() < 1) { double chargedAmt = bill.getAmount(); displayamt = deductible + bill.getCopay() + ((bill.getAmount() - deductible - bill.getCopay()) * (1.0 - bill.getNetworkCharge())); switch (bill.getServiceNumber()) { case 0: if (chargedAmt > 2000) { displayamt = displayamt + (chargedAmt - 2000); } break; case 1: if (chargedAmt > 1500) { displayamt = displayamt + (chargedAmt - 1500); } break; case 2: if (chargedAmt > 1000) { displayamt = displayamt + (chargedAmt - 1000); } break; case 3: if (chargedAmt > 4000) { displayamt = displayamt + (chargedAmt - 4000); } break; case 4: if (chargedAmt > 10000) { displayamt = displayamt + (chargedAmt - 10000); } break; case 5: if (chargedAmt > 30000) { displayamt = displayamt + (chargedAmt - 30000); } break; case 6: if (chargedAmt > 500) { displayamt = displayamt + (chargedAmt - 500); } break; case 7: if (chargedAmt > 150) { displayamt = displayamt + (chargedAmt - 150); } break; case 8: if (chargedAmt > 300) { displayamt = displayamt + (chargedAmt - 300); } break; case 9: if (chargedAmt > 25) { displayamt = displayamt + (chargedAmt - 25); } break; case 10: if (chargedAmt > 300) { displayamt = displayamt + (chargedAmt - 300); } break; case 11: if (chargedAmt > 300) { displayamt = displayamt + (chargedAmt - 300); } break; case 12: if (chargedAmt > 250) { displayamt = displayamt + (chargedAmt - 250); } break; case 13: if (chargedAmt > 100) { displayamt = displayamt + (chargedAmt - 100); } break; default: break; } return(displayamt); } else { return(deductible + bill.getCopay()); } } else { if (bill.getNetworkCharge() < 1) { return(bill.getAmount() * (1 - bill.getNetworkCharge())); } else { return(0); } } }
public EnrolleeInfo(int id, int accessed) { InitializeComponent(); enrolleeID = id; this.richTextBox1.Text = DBMng.getEnrolleeInfo(enrolleeID); }