private void Remove_Click(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); try { int temp = index1; int i; int k = 1;; for (i = index1; list[i].ToString() != "*****"; i++) { k++; } list.RemoveRange(temp, k); account_BO.createAccount(list); MessageBox.Show("Account remove successfull..."); this.Hide(); Home_Admin home_Admin = new Home_Admin(); home_Admin.Show(); } catch { MessageBox.Show("Wrong!!!"); } }
private void Update_Click(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); try { int temp = index1; if (updateUserName.Text != "" && updateUserAddress.Text != "" && updatePhoneNo.Text != "" && imagePath != null) { list[temp + 1] = updateUserName.Text; list[temp + 2] = updateUserAddress.Text; list[temp + 3] = updatePhoneNo.Text; int i; for (i = index1; list[i].ToString() != "*****"; i++) { } int j = i - 1; list[j] = imagePath; account_BO.createAccount(list); Home_Admin_AccountUpdate_Update_Show home_Admin_AccountStatement_Update_Show = new Home_Admin_AccountUpdate_Update_Show(); home_Admin_AccountStatement_Update_Show.giveIndex(index1); home_Admin_AccountStatement_Update_Show.Show(); this.Hide(); } else { MessageBox.Show("Wrong!!! Enter the information carefully"); } } catch (Exception) { MessageBox.Show("Error !!"); } }
private void Document_Load(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); int user = 0; int paid = 0; try { for (int i = 0; i < list.Count; i++) { if (list[i].ToString() == y) { if (checker(list[i + 1].ToString(), m)) { user++; for (int j = i + 1; list[j].ToString() != "*****"; j++) { if (list[j].ToString() == "January" || list[j].ToString() == "February" || list[j].ToString() == "March" || list[j].ToString() == "April" || list[j].ToString() == "May" || list[j].ToString() == "June" || list[j].ToString() == "July" || list[j].ToString() == "August" || list[j].ToString() == "September" || list[j].ToString() == "October" || list[j].ToString() == "November" || list[j].ToString() == "December") { if (list[j].ToString() == m) { paid++; } } else { break; } } } } } year.Text = y; month.Text = m; totalUser.Text = user.ToString(); int n = user * 120; totalBill.Text = n.ToString(); int n1 = paid * 120; totalPaid.Text = n1.ToString(); int n2 = n - n1; totalDue.Text = n2.ToString(); } catch (Exception) { MessageBox.Show("Error!!"); } }
private void Home_Admin_AccountUpdate_Update_Show_Load(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); int i; for (i = index; list[i].ToString() != "*****"; i++) { } string k = list[i - 1].ToString(); updatedAccountNo.Text = list[index].ToString(); updatedAccountType.Text = list[index + 1].ToString(); updatedHolderName.Text = list[index + 2].ToString(); updatedaddress.Text = list[index + 3].ToString(); updatedPictureBox.Load(k); }
private void logIn_Click(object sender, EventArgs e) { try { Account_BO account_BO = new Account_BO(); if (loginUserName_txt.Text == "" || loginPassword_txt.Text == "") { MessageBox.Show("Wrong!!! Enter the information fully"); } else { Member member = account_BO.getAdminOrMember(loginUserName_txt.Text); if (member.password == loginPassword_txt.Text) { if (member.type == "Admin") { Home_Admin ha = new Home_Admin(); ha.Show(); this.Hide(); } else { Home_Member hm = new Home_Member(); hm.getMemberStatus("Member"); hm.Show(); this.Hide(); } } else { MessageBox.Show("Incorect UserName or Password"); loginUserName_txt.Clear(); loginPassword_txt.Clear(); } } } catch { MessageBox.Show("Incorect UserName or Password"); } }
private void Home_Admin_AccountRemove_Remove_Load(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); int i; for (i = index1; list[i].ToString() != "*****"; i++) { } string k = list[i - 1].ToString(); int index = index1; int temp = index1; userID.Text = list[index].ToString(); userName.Text = list[index + 1].ToString(); address.Text = list[index + 2].ToString(); phoneNo.Text = list[index + 3].ToString(); presentPictureBox.Load(k); }
private void yesADD_Click_1(object sender, EventArgs e) { string x; Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); ArrayList savelist = new ArrayList(); int y1 = 0; y1 = Convert.ToInt32(y); y1 += 1; x = Convert.ToString(y1); int i; for (i = index1; list[i].ToString() != "*****"; i++) { if (list[i].ToString() == x) { y1++; x = Convert.ToString(y1); } } int j2 = i - 2; int j1 = i - 1; for (int k = 0; k <= j2; k++) { savelist.Add(list[k]); } savelist.Add(x); int j = 0; for (j = j1; j < list.Count; j++) { savelist.Add(list[j]); } account_BO.createAccount(savelist); this.Hide(); MessageBox.Show("Year " + x + " Added Succssfully, Please Re-enter ID & This Year"); Home_Admin_AccountWithdraw h = new Home_Admin_AccountWithdraw(); h.Show(); }
private void GoRemoveAccount_Click(object sender, EventArgs e) { Account_BO accountBO = new Account_BO(); ArrayList list = new ArrayList(accountBO.readAccount()); if (searchRemoveAccount.Text == "") { MessageBox.Show("Wrong!!! Enter the information fully"); } else { try { int flag = 0; for (int i = 0; i < list.Count; i++) { if (list[i].ToString() == searchRemoveAccount.Text) { Home_Admin_AccountRemove_Remove home_Admin_AccountRemove_Remove = new Home_Admin_AccountRemove_Remove(); home_Admin_AccountRemove_Remove.giveIndex(list.IndexOf(list[i].ToString())); home_Admin_AccountRemove_Remove.Show(); this.Hide(); flag = 1; break; } } if (flag == 0) { MessageBox.Show("Sorry!!! This account number isn't Exist"); searchRemoveAccount.Clear(); } } catch (Exception) { MessageBox.Show("No User Exists"); } } }
private void logIn_Click(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); if (userName.Text == "" || password.Text == "") { MessageBox.Show("Wrong!!! Enter the information fully"); } else { if (account_BO.security_Checker(userName.Text, password.Text)) { this.Hide(); Home_Admin home_Admin = new Home_Admin(); home_Admin.Show(); } else { MessageBox.Show("Wrong UserName or Password"); userName.Clear(); password.Clear(); } } }
private void GoWithdrawAccount_Click(object sender, EventArgs e) { Account_BO accountBO = new Account_BO(); ArrayList list = new ArrayList(accountBO.readAccount()); if (searchUserID.Text == "" || stYear.Text == "") { MessageBox.Show("Wrong!!! Enter the information fully"); } else { try { int flag = 0; int flag1 = 0; int i1 = 0, i2 = 0; for (int i = 0; i < list.Count; i++) { if (list[i].ToString() == searchUserID.Text) { flag = 1; i1 = i; break; } } for (int i = i1; list[i].ToString() != "*****"; i++) { if (list[i].ToString() == stYear.Text) { flag1 = 1; i2 = i; break; } } if (flag == 1 && flag1 == 1) { try { Home_Admin_AccountWithdraw_Withdraw home_Admin_AccountWithdraw_Withdraw = new Home_Admin_AccountWithdraw_Withdraw(); home_Admin_AccountWithdraw_Withdraw.giveIndex(i1); home_Admin_AccountWithdraw_Withdraw.giveYear(i2); this.Hide(); home_Admin_AccountWithdraw_Withdraw.Show(); } catch (Exception) { MessageBox.Show("Error!!!"); } } if (flag == 0) { MessageBox.Show("Sorry!!! This account number isn't Exist"); searchUserID.Clear(); } if (flag1 == 0) { MessageBox.Show("Sorry!!! This year isn't Exist"); stYear.ResetText(); } } catch (Exception) { MessageBox.Show("No User Exists"); } } }
public void Home_Admin_AccountStatement_Show_Load(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); DataTable dt = new DataTable(); try { int j; for (j = index1; list[j].ToString() != "*****"; j++) { } string k = list[j - 1].ToString(); int index = index1; int temp = index1; userID.Text = list[index].ToString(); userName.Text = list[index + 1].ToString(); address.Text = list[index + 2].ToString(); phoneNo.Text = list[index + 3].ToString(); presentPictureBox.Load(k); userName.Text = list[index1 + 1].ToString(); dt.Columns.Add("Year"); dt.Columns.Add("Jan"); dt.Columns.Add("Feb"); dt.Columns.Add("Mar"); dt.Columns.Add("Apr"); dt.Columns.Add("May"); dt.Columns.Add("June"); dt.Columns.Add("July"); dt.Columns.Add("Aug"); dt.Columns.Add("Sep"); dt.Columns.Add("Oct"); dt.Columns.Add("Nov"); dt.Columns.Add("Dec"); dt.Rows.Add("DUE", "DUE", "DUE", "DUE", "DUE", "DUE", "DUE", "DUE", "DUE", "DUE", "DUE", "DUE", "DUE"); if (index2 - index1 == 5) { if (list[index2 + 1].ToString() == "February") { dt.Rows.Add("PAID"); } else if (list[index2 + 1].ToString() == "February") { dt.Rows.Add("NILL", "PAID"); } else if (list[index2 + 1].ToString() == "March") { dt.Rows.Add("NILL", "NILL", "PAID"); } else if (list[index2 + 1].ToString() == "April") { dt.Rows.Add("NILL", "NILL", "NILL", "PAID"); } else if (list[index2 + 1].ToString() == "May") { dt.Rows.Add("NILL", "NILL", "NILL", "NILL", "PAID"); } else if (list[index2 + 1].ToString() == "June") { dt.Rows.Add("NILL", "NILL", "NILL", "NILL", "NILL", "PAID"); } else if (list[index2 + 1].ToString() == "July") { dt.Rows.Add("NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "PAID"); } else if (list[index2 + 1].ToString() == "August") { dt.Rows.Add("NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "PAID"); } else if (list[index2 + 1].ToString() == "September") { dt.Rows.Add("NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "PAID"); } else if (list[index2 + 1].ToString() == "October") { dt.Rows.Add("NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "PAID"); } else if (list[index2 + 1].ToString() == "November") { dt.Rows.Add("NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "PAID"); } else if (list[index2 + 1].ToString() == "December") { dt.Rows.Add("NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "NILL", "PAID"); } } /*for (int i = index2 + 1; list[i].ToString() != "*****"; i++) * { * if (list[i].ToString() == "January" || list[i].ToString() == "February" || list[i].ToString() == "March" || list[i].ToString() == "April" || list[i].ToString() == "May" || list[i].ToString() == "June" || list[i].ToString() == "July" || list[i].ToString() == "August" || list[i].ToString() == "September" || list[i].ToString() == "October" || list[i].ToString() == "November" || list[i].ToString() == "December") * { * if (list[i].ToString() == "January") * { * lt.SubItems.Add("PAID"); * } * if (list[i].ToString() == "February") * { * lt.SubItems.Add("PAID"); * } * if (list[i].ToString() == "March") * { * lt.SubItems.Add("PAID"); * } * if (list[i].ToString() == "April") * { * lt.SubItems.Add("PAID"); * } * if (list[i].ToString() == "May") * { * lt.SubItems.Add("PAID"); * } * if (list[i].ToString() == "June") * { * lt.SubItems.Add("PAID"); * } * if (list[i].ToString() == "July") * { * lt.SubItems.Add("PAID"); * } * if (list[i].ToString() == "August") * { * lt.SubItems.Add("PAID"); * } * if (list[i].ToString() == "September") * { * lt.SubItems.Add("PAID"); * } * if (list[i].ToString() == "October") * { * lt.SubItems.Add("PAID"); * } * if (list[i].ToString() == "November") * { * lt.SubItems.Add("PAID"); * } * if (list[i].ToString() == "December") * { * lt.SubItems.Add("PAID"); * } * } * else * { * break; * } * * * }*/ userData.DataSource = dt; } catch (Exception) { MessageBox.Show("Error !!!"); } }
private void yes_Click(object sender, EventArgs e) { int j = index2 + 2; int j1 = index2 + 1; Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); ArrayList lastList = new ArrayList(); ArrayList saveList = new ArrayList(); if (account_BO.security_Checker("rintu", password.Text)) { if (index2 - index1 == 5) { if (index1 != 0) { for (int i = 0; i < index1; i++) { saveList.Add(list[i]); } for (int i = index1; i <= index2 + 1; i++) { saveList.Add(list[i]); } for (int k = j; k < list.Count; k++) { lastList.Add(list[k]); } if (m == 1) { saveList.Add("January"); } if (m == 2) { saveList.Add("February"); } if (m == 3) { saveList.Add("March"); } if (m == 4) { saveList.Add("April"); } if (m == 5) { saveList.Add("May"); } if (m == 6) { saveList.Add("June"); } if (m == 7) { saveList.Add("July"); } if (m == 8) { saveList.Add("August"); } if (m == 9) { saveList.Add("September"); } if (m == 10) { saveList.Add("October"); } if (m == 11) { saveList.Add("November"); } if (m == 12) { saveList.Add("December"); } for (int i = 0; i < lastList.Count; i++) { saveList.Add(lastList[i]); } account_BO.createAccount(saveList); MessageBox.Show("Payment Successfully Done"); this.Hide(); home_admin.Show(); } else { for (int i = index1; i <= index2 + 1; i++) { saveList.Add(list[i]); } for (int k = j; k < list.Count; k++) { lastList.Add(list[k]); } if (m == 1) { saveList.Add("January"); } if (m == 2) { saveList.Add("February"); } if (m == 3) { saveList.Add("March"); } if (m == 4) { saveList.Add("April"); } if (m == 5) { saveList.Add("May"); } if (m == 6) { saveList.Add("June"); } if (m == 7) { saveList.Add("July"); } if (m == 8) { saveList.Add("August"); } if (m == 9) { saveList.Add("September"); } if (m == 10) { saveList.Add("October"); } if (m == 11) { saveList.Add("November"); } if (m == 12) { saveList.Add("December"); } for (int i = 0; i < lastList.Count; i++) { saveList.Add(lastList[i]); } account_BO.createAccount(saveList); MessageBox.Show("Payment Successfully Done"); this.Hide(); home_admin.Show(); } } else { if (index1 != 0) { for (int i = 0; i < index1; i++) { saveList.Add(list[i]); } for (int i = index1; i <= index2; i++) { saveList.Add(list[i]); } for (int k = j1; k < list.Count; k++) { lastList.Add(list[k]); } if (m == 1) { saveList.Add("January"); } if (m == 2) { saveList.Add("February"); } if (m == 3) { saveList.Add("March"); } if (m == 4) { saveList.Add("April"); } if (m == 5) { saveList.Add("May"); } if (m == 6) { saveList.Add("June"); } if (m == 7) { saveList.Add("July"); } if (m == 8) { saveList.Add("August"); } if (m == 9) { saveList.Add("September"); } if (m == 10) { saveList.Add("October"); } if (m == 11) { saveList.Add("November"); } if (m == 12) { saveList.Add("December"); } for (int i = 0; i < lastList.Count; i++) { saveList.Add(lastList[i]); } account_BO.createAccount(saveList); MessageBox.Show("Payment Successfully Done"); this.Hide(); home_admin.Show(); } else { for (int i = index1; i <= index2; i++) { saveList.Add(list[i]); } for (int k = j1; k < list.Count; k++) { lastList.Add(list[k]); } if (m == 1) { saveList.Add("January"); } if (m == 2) { saveList.Add("February"); } if (m == 3) { saveList.Add("March"); } if (m == 4) { saveList.Add("April"); } if (m == 5) { saveList.Add("May"); } if (m == 6) { saveList.Add("June"); } if (m == 7) { saveList.Add("July"); } if (m == 8) { saveList.Add("August"); } if (m == 9) { saveList.Add("September"); } if (m == 10) { saveList.Add("October"); } if (m == 11) { saveList.Add("November"); } if (m == 12) { saveList.Add("December"); } for (int i = 0; i < lastList.Count; i++) { saveList.Add(lastList[i]); } account_BO.createAccount(saveList); MessageBox.Show("Payment Successfully Done"); this.Hide(); home_admin.Show(); } } } else { MessageBox.Show("Wrong Password !"); password.Clear(); } }
private void Home_Admin_AccountWithdraw_Withdraw_Load(object sender, EventArgs e) { Home_Admin_Withdraw_New home_add_new = new Home_Admin_Withdraw_New(); try { Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); userName.Text = list[index1 + 1].ToString(); year.Text = list[index2].ToString(); userID1.Text = list[index1].ToString(); stYearP.Text = list[index1 + 5].ToString(); stMonthP.Text = list[index1 + 6].ToString(); jan.Text = "DUE"; feb.Text = "DUE"; mar.Text = "DUE"; apr.Text = "DUE"; may.Text = "DUE"; june.Text = "DUE"; july.Text = "DUE"; augu.Text = "DUE"; sep.Text = "DUE"; oct.Text = "DUE"; nov.Text = "DUE"; dec.Text = "DUE"; if (index2 - index1 == 5) { if (list[index2 + 1].ToString() == "February") { jan.Text = "NILL"; } else if (list[index2 + 1].ToString() == "March") { jan.Text = "NILL"; feb.Text = "NILL"; } else if (list[index2 + 1].ToString() == "April") { jan.Text = "NILL"; feb.Text = "NILL"; mar.Text = "NILL"; } else if (list[index2 + 1].ToString() == "May") { jan.Text = "NILL"; feb.Text = "NILL"; mar.Text = "NILL"; apr.Text = "NILL"; } else if (list[index2 + 1].ToString() == "June") { jan.Text = "NILL"; feb.Text = "NILL"; mar.Text = "NILL"; apr.Text = "NILL"; may.Text = "NILL"; } else if (list[index2 + 1].ToString() == "July") { jan.Text = "NILL"; feb.Text = "NILL"; mar.Text = "NILL"; apr.Text = "NILL"; may.Text = "NILL"; june.Text = "NILL"; } else if (list[index2 + 1].ToString() == "August") { jan.Text = "NILL"; feb.Text = "NILL"; mar.Text = "NILL"; apr.Text = "NILL"; may.Text = "NILL"; june.Text = "NILL"; july.Text = "NILL"; } else if (list[index2 + 1].ToString() == "September") { jan.Text = "NILL"; feb.Text = "NILL"; mar.Text = "NILL"; apr.Text = "NILL"; may.Text = "NILL"; june.Text = "NILL"; july.Text = "NILL"; augu.Text = "NILL"; } else if (list[index2 + 1].ToString() == "October") { jan.Text = "NILL"; feb.Text = "NILL"; mar.Text = "NILL"; apr.Text = "NILL"; may.Text = "NILL"; june.Text = "NILL"; july.Text = "NILL"; augu.Text = "NILL"; sep.Text = "NILL"; } else if (list[index2 + 1].ToString() == "November") { jan.Text = "NILL"; feb.Text = "NILL"; mar.Text = "NILL"; apr.Text = "NILL"; may.Text = "NILL"; june.Text = "NILL"; july.Text = "NILL"; augu.Text = "NILL"; sep.Text = "NILL"; oct.Text = "NILL"; } else if (list[index2 + 1].ToString() == "December") { jan.Text = "NILL"; feb.Text = "NILL"; mar.Text = "NILL"; apr.Text = "NILL"; may.Text = "NILL"; june.Text = "NILL"; july.Text = "NILL"; augu.Text = "NILL"; sep.Text = "NILL"; oct.Text = "NILL"; nov.Text = "NILL"; } } for (int i = index2 + 1; list[i].ToString() != "*****"; i++) { if (list[i].ToString() == "January" || list[i].ToString() == "February" || list[i].ToString() == "March" || list[i].ToString() == "April" || list[i].ToString() == "May" || list[i].ToString() == "June" || list[i].ToString() == "July" || list[i].ToString() == "August" || list[i].ToString() == "September" || list[i].ToString() == "October" || list[i].ToString() == "November" || list[i].ToString() == "December") { if (list[i].ToString() == "January") { jan.Text = "PAID"; } if (list[i].ToString() == "February") { feb.Text = "PAID"; } if (list[i].ToString() == "March") { mar.Text = "PAID"; } if (list[i].ToString() == "April") { apr.Text = "PAID"; } if (list[i].ToString() == "May") { may.Text = "PAID"; } if (list[i].ToString() == "June") { june.Text = "PAID"; } if (list[i].ToString() == "July") { july.Text = "PAID"; } if (list[i].ToString() == "August") { augu.Text = "PAID"; } if (list[i].ToString() == "September") { sep.Text = "PAID"; } if (list[i].ToString() == "October") { oct.Text = "PAID"; } if (list[i].ToString() == "November") { nov.Text = "PAID"; } if (list[i].ToString() == "December") { dec.Text = "PAID"; } } else { break; } } } catch (Exception) { MessageBox.Show("Error !!!"); } }
private void Create_Click(object sender, EventArgs e) { Account_BO account_Bo = new Account_BO(); Account_ENTITY account_Entity = new Account_ENTITY(); ArrayList listAccount = new ArrayList(account_Bo.readAccount()); try { if (userName.Text != "" && userID.Text != "" && address.Text != "" && phoneNo.Text != "" && this.dateTimePicker1.Text != null && regFee != null && imagePath != null) { if (Convert.ToDouble(regFee.Text) == 120) { int flag = 0; for (int i = 0; i < listAccount.Count; i++) { if (listAccount[i].ToString() == userID.Text) { MessageBox.Show("Wrong!!! This User ID is already in used"); flag = 1; break; } } account_Entity.identity = "*****"; account_Entity.userID = userID.Text; account_Entity.userName = userName.Text; account_Entity.address = address.Text; account_Entity.phoneNo = phoneNo.Text; account_Entity.regFee = Convert.ToInt32(regFee.Text); account_Entity.date = this.dateTimePicker1.Text; if (flag == 0) { listAccount.Add(account_Entity.userID); listAccount.Add(account_Entity.userName); listAccount.Add(account_Entity.address); listAccount.Add(account_Entity.phoneNo); listAccount.Add(account_Entity.regFee); listAccount.Add(account_Entity.date); listAccount.Add(imagePath); listAccount.Add(account_Entity.identity); account_Bo.createAccount(listAccount); MessageBox.Show("The Account create successful"); this.Hide(); Home_Admin home_admin = new Home_Admin(); home_admin.Show(); } userID.Clear(); userName.Clear(); address.Clear(); phoneNo.Clear(); regFee.ResetText(); } else { MessageBox.Show("Wrong!! You have to must deposit at least 120TK"); } } else { MessageBox.Show("Wrong!!! Enter the information fully"); } } catch (Exception) { MessageBox.Show("Error!!! Please Retry"); } }