private void Pay_btn_Click(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(); ArrayList userBill = new ArrayList(account_BO.getUserBill()); DateTime dt = DateTime.Now; try { if (enterAmount_tb.Text != null) { int paymentBill = Convert.ToInt32(enterAmount_tb.Text); if (paymentBill % 120 == 0) { int m = 0; while (userBill[m].ToString() != userID.Text) { m++; } int b; for (b = m; userBill[b].ToString() != "*"; b++) { } int totalBill = Convert.ToInt32(totalBill_lbl.Text); if (paymentBill <= totalBill) { for (int j = 0; j < b; j++) { list.Add(userBill[j].ToString()); } list.Add(dt.ToShortDateString()); list.Add(enterAmount_tb.Text); list.Add((totalBill - paymentBill).ToString()); for (int k = b; k < userBill.Count; k++) { list.Add(userBill[k].ToString()); } account_BO.setUserBill(list); try { ArrayList cost = new ArrayList(); ArrayList temp = new ArrayList(); cost = account_BO.getOwnerincome(); int f = 0; for (int i = 0; i < cost.Count; i++) { temp.Add(cost[i].ToString()); if (cost[i].ToString() == lastDate_lbl.Text) { temp.Add("Bill"); temp.Add(enterAmount_tb.Text); for (int m1 = i + 1; m1 < cost.Count; m1++) { temp.Add(cost[m1].ToString()); } account_BO.setOwerIncome(temp); f = 1; } } if (f == 0) { cost.Add(lastDate_lbl.Text); cost.Add("Bill"); cost.Add(enterAmount_tb.Text); cost.Add("*"); account_BO.setOwerIncome(cost); } } catch { } Home_Admin_Withdraw_Show hs = new Home_Admin_Withdraw_Show(); hs.giveIndex(index1); this.Hide(); hs.Show(); } else { MessageBox.Show("You can not entry any amount more than the due bill"); enterAmount_tb.Clear(); } } else { MessageBox.Show("Enter the amount in correct format"); enterAmount_tb.Clear(); } } else { MessageBox.Show("Please enter amount"); } } catch { MessageBox.Show("Please enter amount"); } }
private void view2_btn_Click(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); if (year1 != null && month != null) { ArrayList cost = new ArrayList(); cost = account_BO.getOwnerincome(); int[] index = new int[200]; int[] index2 = new int[200]; int j = 0; int i1; for (i1 = 0; i1 < cost.Count; i1++) { if (cost[i1].ToString() == "*") { index[j] = i1 + 1; j++; } } index[j - 1] = 0; int month_value = 0; int year_value = 0; try { year_value = Convert.ToInt32(year1.Text); } catch { } if (month.Text == "January") { month_value = 1; } else if (month.Text == "February") { month_value = 2; } else if (month.Text == "March") { month_value = 3; } else if (month.Text == "April") { month_value = 4; } else if (month.Text == "May") { month_value = 5; } else if (month.Text == "June") { month_value = 6; } else if (month.Text == "July") { month_value = 7; } else if (month.Text == "August") { month_value = 8; } else if (month.Text == "September") { month_value = 9; } else if (month.Text == "October") { month_value = 10; } else if (month.Text == "November") { month_value = 11; } else if (month.Text == "December") { month_value = 12; } int d1 = 0, d2 = 0; DateTime dt = DateTime.Parse(cost[0].ToString()); int m = dt.Month; int y = dt.Year; int k = 0; if (month_value == m && year_value == y) { index2[0] = 1; k = 1; d1 = 1; } for (int i = 0; index[i] != 0; i++) { DateTime dt1 = DateTime.Parse(cost[index[i]].ToString()); int m1 = dt1.Month; int y1 = dt1.Year; if (month_value == m1 && year_value == y1) { index2[k] = index[i]; k++; d2 = 1; } } if (d1 != 1 && d2 != 1) { MessageBox.Show("This month or year is not exist"); } else { Home_Admin_Owner_Income_Details he = new Home_Admin_Owner_Income_Details(); he.giveIndex1(index2); this.Hide(); he.Show(); } } else { MessageBox.Show("Enter the information fully"); month.ResetText(); year1.ResetText(); } }
private void view1_btn_Click(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); ArrayList cost = new ArrayList(); cost = account_BO.getOwnerincome(); int f = 0; Home_Admin_Owner_Income_Details he = new Home_Admin_Owner_Income_Details(); for (int i = 0; i < cost.Count; i++) { if (search_dtp.Text == cost[i].ToString()) { he.giveIndex(i); this.Hide(); he.Show(); f = 1; break; } } if (f == 0) MessageBox.Show("This date is not exist"); }
private void veiwdetils_btn2_Click(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); if (year2 != null) { ArrayList cost = new ArrayList(); cost = account_BO.getOwnerincome(); int[] index = new int[200]; int[] index2 = new int[200]; int j = 0; int i1; for (i1 = 0; i1 < cost.Count; i1++) { if (cost[i1].ToString() == "*") { index[j] = i1 + 1; j++; } } index[j - 1] = 0; int year_value = 0; try { year_value = Convert.ToInt32(year2.Text); } catch { } int d1 = 0, d2 = 0; DateTime dt = DateTime.Parse(cost[0].ToString()); int y = dt.Year; int k = 0; if (year_value == y) { index2[0] = 1; k = 1; d1 = 1; } for (int i = 0; index[i] != 0; i++) { DateTime dt1 = DateTime.Parse(cost[index[i]].ToString()); int y1 = dt1.Year; if (year_value == y1) { index2[k] = index[i]; k++; d2 = 1; } } if (d1 != 1 && d2 != 1) { MessageBox.Show("This month or year is not exist"); } else { Home_Admin_Owner_Income_Details he = new Home_Admin_Owner_Income_Details(); he.giveIndex1(index2); this.Hide(); he.Show(); } } else { MessageBox.Show("Enter the information fully"); year2.ResetText(); } }
private void Print_Document_Load(object sender, EventArgs e) { setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); rightOptionPnlTimer.Start(); try { Account_BO ab = new Account_BO(); ArrayList cost = new ArrayList(); cost = ab.getOwnerincome(); if (f1 == 1) { int f = 0; int b; for (b = i; cost[b].ToString() != "*"; b++) { } for (int a = i; a < b - 1; a = a + 2) { if (f == 0) { ownerDataGridView.Rows.Add(cost[a].ToString(), cost[a + 1].ToString(), cost[a + 2].ToString()); f = 1; } else { ownerDataGridView.Rows.Add(cost[i].ToString(), cost[a + 1].ToString(), cost[a + 2].ToString()); } } int sum = 0; for (int j = 0; j < ownerDataGridView.Rows.Count; j++) { sum += Convert.ToInt32(ownerDataGridView.Rows[j].Cells[2].Value); } ownerDataGridView.Rows.Add("", "", ""); ownerDataGridView.Rows.Add("Total", "", sum.ToString()); } if (f1 == 2) { for (int i = 0; index2[i] != 0; i++) { if (index2[i] == 1) { int f = 0; int b; for (b = 0; cost[b].ToString() != "*"; b++) { } for (int a = 0; a < b - 1; a = a + 2) { if (f == 0) { ownerDataGridView.Rows.Add(cost[a].ToString(), cost[a + 1].ToString(), cost[a + 2].ToString()); f = 1; } else { ownerDataGridView.Rows.Add(cost[0].ToString(), cost[a + 1].ToString(), cost[a + 2].ToString()); } } } else { int f = 0; int b; for (b = index2[i]; cost[b].ToString() != "*"; b++) { } for (int a = index2[i]; a < b - 1; a = a + 2) { if (f == 0) { ownerDataGridView.Rows.Add(cost[a].ToString(), cost[a + 1].ToString(), cost[a + 2].ToString()); f = 1; } else { ownerDataGridView.Rows.Add(cost[index2[i]].ToString(), cost[a + 1].ToString(), cost[a + 2].ToString()); } } } } int sum = 0; for (int j = 0; j < ownerDataGridView.Rows.Count; j++) { sum += Convert.ToInt32(ownerDataGridView.Rows[j].Cells[2].Value); } ownerDataGridView.Rows.Add("", "", ""); ownerDataGridView.Rows.Add("Total", "", sum.ToString()); } } catch { MessageBox.Show("Error"); } }
private void Create_Click_1(object sender, EventArgs e) { Account_BO account_Bo = new Account_BO(); Account_ENTITY account_Entity = new Account_ENTITY(); ArrayList bill = new ArrayList(account_Bo.getUserBill()); ArrayList listAccount = new ArrayList(account_Bo.readAccount()); try { if (userName.Text != "" &&entryDate_dtp.Text != null && ocupation_TextBox.Text != null && userID.Text != "" && genderCombo.Text != null && address.Text != "" && phoneNo.Text != "" && landline.Text != null && emailID.Text != null && this.dateOfBirth.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.gender = genderCombo.Text; account_Entity.dateOfBirth = dateOfBirth.Text; account_Entity.occupation = ocupation_TextBox.Text; account_Entity.regFee = Convert.ToInt32(regFee.Text); account_Entity.phoneNo = phoneNo.Text; account_Entity.landlineNo = landline.Text; account_Entity.emailID = emailID.Text; account_Entity.imagePath = imagePath; account_Entity.entryDate = entryDate_dtp.Text; if (flag == 0) { listAccount.Add(account_Entity.userID); listAccount.Add(account_Entity.userName); listAccount.Add(account_Entity.address); listAccount.Add(account_Entity.gender); listAccount.Add(account_Entity.dateOfBirth); listAccount.Add(account_Entity.occupation); listAccount.Add(account_Entity.regFee); listAccount.Add(account_Entity.phoneNo); listAccount.Add(account_Entity.landlineNo); listAccount.Add(account_Entity.emailID); listAccount.Add(account_Entity.entryDate); listAccount.Add(imagePath); listAccount.Add(account_Entity.identity); account_Bo.createAccount(listAccount); account_Bo.increaseTotalUser(); bill.Add(account_Entity.userID); bill.Add(account_Entity.entryDate); bill.Add(account_Entity.regFee); bill.Add("0"); bill.Add("*"); account_Bo.setUserBill(bill); try { Account_BO account_BO = new Account_BO(); ArrayList cost = new ArrayList(); ArrayList temp = new ArrayList(); cost = account_BO.getOwnerincome(); int f = 0; for (int i = 0; i < cost.Count; i++) { temp.Add(cost[i].ToString()); if (cost[i].ToString() == entryDate_dtp.Text) { temp.Add("Bill"); temp.Add(regFee.Text); for (int m = i + 1; m < cost.Count; m++) { temp.Add(cost[m].ToString()); } account_BO.setOwerIncome(temp); f = 1; } } if (f == 0) { cost.Add(entryDate_dtp.Text); cost.Add("Bill"); cost.Add(regFee.Text); cost.Add("*"); account_BO.setOwerIncome(cost); } } catch { } MessageBox.Show("The Account create successful"); account_Bo.setID_Generator(); Home_Admin ha = new Home_Admin(); this.Hide(); ha.Show(); } } else { MessageBox.Show("Wrong!! You have to must deposit at least 120TK"); regFee.Clear(); } } else MessageBox.Show("Wrong!!! Enter the information fully"); } catch (Exception e1) { MessageBox.Show(e1.Message); } }