private void GoWithdrawAccount_Click(object sender, EventArgs e) { Account_BO accountBO = new Account_BO(); ArrayList list = new ArrayList(accountBO.readAccount()); ArrayList userBill = new ArrayList(accountBO.getUserBill()); if (searchUserID.Text == "") { MessageBox.Show("Wrong!!! Enter the information fully"); } else { try { int flag = 0; int i; for (i = 0; i < list.Count; i++) { if (list[i].ToString() == searchUserID.Text) { flag = 1; break; } } if (flag == 0) { MessageBox.Show("Sorry!!! This account number isn't Exist"); searchUserID.Clear(); } if (flag == 1) { int m = 0; while (userBill[m].ToString() != searchUserID.Text) { m++; } int b; for (b = m; userBill[b].ToString() != "*"; b++) { } Home_Admin_AccountStatement_Show home_Admin_AccountRemove_Remove = new Home_Admin_AccountStatement_Show(); home_Admin_AccountRemove_Remove.giveIndex(list.IndexOf(list[i].ToString())); home_Admin_AccountRemove_Remove.giveUserBillIndex(m,b); home_Admin_AccountRemove_Remove.Show(); this.Hide(); } } catch (Exception) { MessageBox.Show("No User Exists"); } } }
private void Document_Load(object sender, EventArgs e) { setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); rightOptionPnlTimer.Start(); Account_BO ab = new Account_BO(); ArrayList list = new ArrayList(ab.readAccount()); for (int i = 0; i < list.Count; i=i+13) { totalUserGridView.Rows.Add(list[i].ToString(), list[i + 1].ToString(), list[i + 2].ToString(), list[i + 3].ToString(), list[i + 4].ToString(), list[i + 5].ToString(), list[i + 6].ToString(), list[i + 7].ToString(), list[i + 8].ToString(), list[i + 9].ToString(), list[i+10].ToString()); } totalUser_lbl.Text = ab.getTotalUser().ToString(); }
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 button1_Click(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); ArrayList note = new ArrayList(); dataGridView1.Rows.Clear(); note = account_BO.getNote(); int f = 0; for (int i = 0; i < note.Count; i++) { if (viewTimePicker.Text == note[i].ToString()) { for (int j = i+1; note[j].ToString() != "*"; j++) { dataGridView1.Rows.Add(note[i].ToString(), note[j].ToString()); f = 1; } } } if (f == 0) MessageBox.Show("This date is not exist"); }
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)) { Home_Admin home_Admin = new Home_Admin(); home_Admin.Show(); this.Hide(); } else { MessageBox.Show("Wrong UserName or Password"); userName.Clear(); password.Clear(); } } }
private void Home_Admin_ReturnToImporter_History_Load(object sender, EventArgs e) { setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); right_option_timer.Start(); try { Account_BO ab = new Account_BO(); member = ab.getMember(userName); memberFirstNameMetroLabel.Text = member.firstName.ToString(); memberLastNameMetroLabel.Text = member.lastName.ToString(); MemoryStream ms = new MemoryStream(member.image); pictureBox.Image = Image.FromStream(ms); } catch { } try { DataSet ds = account_Bo.getAllReturnProduct(); if (ds != null) { productMetroGrid.DataSource = ds.Tables[0]; if (productMetroGrid.Rows.Count > 1) { Mlabel.Text = (productMetroGrid.Rows.Count).ToString() + " results found"; } else if (productMetroGrid.Rows.Count == 1) { Mlabel.Text = "1 result found"; } else { Mlabel.Text = "No result found"; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void saveCost_btn_Click(object sender, EventArgs e) { try{ Account_BO ab = new Account_BO(); ArrayList note = new ArrayList(); ArrayList temp = new ArrayList(); note = ab.getNote(); int f = 0; for (int i = 0; i < note.Count; i++) { temp.Add(note[i].ToString()); if (note[i].ToString() == entryDtp.Text) { temp.Add(writeNote_txt.Text); for (int m = i + 1; m < note.Count ; m++) { temp.Add(note[m].ToString()); } ab.setNote(temp); MessageBox.Show("Save Successfully Done"); entryDtp.ResetText(); writeNote_txt.Clear(); f = 1; break; } } if (f == 0) { note.Add(entryDtp.Text); note.Add(writeNote_txt.Text); note.Add("*"); ab.setNote(note); MessageBox.Show("Save Successfully Done"); entryDtp.ResetText(); writeNote_txt.Clear(); } } catch(Exception) { MessageBox.Show("Error !!"); } }
private void Home_Admin_SearchProduct_Load(object sender, EventArgs e) { setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); right_option_timer.Start(); delete_Button.Enabled = false; update_btn.Enabled = false; try { Account_BO ab = new Account_BO(); member = ab.getMember(userName); memberFirstNameMetroLabel.Text = member.firstName.ToString(); memberLastNameMetroLabel.Text = member.lastName.ToString(); MemoryStream ms = new MemoryStream(member.image); pictureBox.Image = Image.FromStream(ms); } catch (Exception ex) { } }
private void Home_Admin_TotalMember_Load(object sender, EventArgs e) { setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); right_option_timer.Start(); try { Account_BO ab = new Account_BO(); member = ab.getMember(userName); memberFirstNameMetroLabel.Text = member.firstName.ToString(); memberLastNameMetroLabel.Text = member.lastName.ToString(); MemoryStream ms = new MemoryStream(member.image); pictureBox.Image = Image.FromStream(ms); DataSet ds = account_Bo.getAllMember(); memberMetroGrid.DataSource = ds.Tables[0]; if (memberMetroGrid.Rows.Count > 1) { Mlabel.Text = (memberMetroGrid.Rows.Count).ToString() + " results found"; } else if (memberMetroGrid.Rows.Count == 1) { Mlabel.Text = "1 result found"; } else { Mlabel.Text = "No result found"; } } catch { } }
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 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 serachMembertextBox_TextChanged(object sender, EventArgs e) { try { signUpPictureBox.Visible = true; Account_BO ab = new Account_BO(); member = ab.getMember(serachMembertextBox.Text); MemoryStream ms = new MemoryStream(member.image); signUpFirstNamemetroTextBox.Text = member.firstName; signUpLastNamemetroTextBox.Text = member.lastName; signUpEmailmetroTextBox.Text = member.email; signUpPhoneNoMetroTextBox.Text = member.phoneNo; signUpPictureBox.Image = Image.FromStream(ms); signUpSalarytextBox.Text = member.salary; } catch { signUpFirstNamemetroTextBox.Clear(); signUpLastNamemetroTextBox.Clear(); signUpEmailmetroTextBox.Clear(); imagePath = ""; signUpPictureBox.Visible = false; signUpPhoneNoMetroTextBox.Clear(); signUpSalarytextBox.Clear(); attendenceMetroGrid.DataSource = ""; Attendence_Label.ResetText(); } }
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 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); } }
private void Home_Admin_CreditHistory_Load(object sender, EventArgs e) { setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); right_option_timer.Start(); try { Account_BO ab = new Account_BO(); member = ab.getMember(userName); memberFirstNameMetroLabel.Text = member.firstName.ToString(); memberLastNameMetroLabel.Text = member.lastName.ToString(); MemoryStream ms = new MemoryStream(member.image); pictureBox.Image = Image.FromStream(ms); CreditHistory creditHistory = new CreditHistory(); creditHistory.invoiceNo = invoiceNo_TextBox.Text; creditHistory.name = clientName_TextBox.Text; creditHistory.address = address_TextBox.Text; creditHistory.mobileNo = phoneNo_TextBox.Text; creditHistory.date = date_TextBox.Text; creditHistory.reference = userName_textBox.Text; DataSet ds = account_Bo.getCreditHistory(creditHistory); clientHistoryMetroGrid.DataSource = ds.Tables[0]; } catch { } }
private void GoWithdrawAccount_Click(object sender, EventArgs e) { Account_BO accountBO = new Account_BO(); ArrayList list = new ArrayList(accountBO.readAccount()); if (searchUserID.Text == "") { MessageBox.Show("Wrong!!! Enter the information fully"); } else { try { int flag = 0; int i1 = 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) { 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()); ArrayList userBill = new ArrayList(account_BO.getUserBill()); setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); rightOptionPnlTimer.Start(); 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(); gender.Text = list[index + 3].ToString(); dateOfBirth.Text = list[index + 4].ToString(); occupation.Text = list[index + 5].ToString(); mob.Text = list[index + 7].ToString(); lan.Text = list[index + 8].ToString(); email.Text = list[index + 9].ToString(); stYear.Text = list[index + 10].ToString(); pictureBox.Load(k); userDataGridView.Rows.Clear(); for (int i = f +1; i < l; i = i+3) { userDataGridView.Rows.Add(userBill[i].ToString(), userBill[i + 1].ToString(), userBill[i + 2].ToString()); } /*jan.Text = "DUE"; feb.Text = "DUE"; mar.Text = "DUE"; apr.Text = "DUE"; may.Text = "DUE"; jun.Text = "DUE"; jul.Text = "DUE"; aug.Text = "DUE"; sep.Text = "DUE"; oct.Text = "DUE"; nov.Text = "DUE"; dec.Text = "DUE"; if (index2 - index1 == 10) { 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"; } else if (list[i].ToString() == "February") { feb.Text = "PAID"; } else if (list[i].ToString() == "March") { mar.Text = "PAID"; } else if (list[i].ToString() == "April") { apr.Text = "PAID"; } else if (list[i].ToString() == "May") { may.Text = "PAID"; } else if (list[i].ToString() == "June") { jun.Text = "PAID"; } else if (list[i].ToString() == "July") { jul.Text = "PAID"; } else if (list[i].ToString() == "August") { aug.Text = "PAID"; } else if (list[i].ToString() == "September") { sep.Text = "PAID"; } else if (list[i].ToString() == "October") { oct.Text = "PAID"; } else if (list[i].ToString() == "November") { nov.Text = "PAID"; } else if (list[i].ToString() == "December") { dec.Text = "PAID"; } } else { break; } } if (list[index2 + 1].ToString() == "February") { jan.Text = "N/A"; } else if (list[index2 + 1].ToString() == "March") { jan.Text = "N/A"; feb.Text = "N/A"; } else if (list[index2 + 1].ToString() == "April") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; } else if (list[index2 + 1].ToString() == "May") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; } else if (list[index2 + 1].ToString() == "June") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; may.Text = "N/A"; } else if (list[index2 + 1].ToString() == "July") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; may.Text = "N/A"; jun.Text = "N/A"; } else if (list[index2 + 1].ToString() == "August") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; may.Text = "N/A"; jun.Text = "N/A"; jul.Text = "N/A"; } else if (list[index2 + 1].ToString() == "September") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; may.Text = "N/A"; jun.Text = "N/A"; jul.Text = "N/A"; aug.Text = "N/A"; } else if (list[index2 + 1].ToString() == "October") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; may.Text = "N/A"; jun.Text = "N/A"; jul.Text = "N/A"; aug.Text = "N/A"; sep.Text = "N/A"; } else if (list[index2 + 1].ToString() == "November") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; may.Text = "N/A"; jun.Text = "N/A"; jul.Text = "N/A"; aug.Text = "N/A"; sep.Text = "N/A"; oct.Text = "N/A"; } else if (list[index2 + 1].ToString() == "December") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; may.Text = "N/A"; jun.Text = "N/A"; jul.Text = "N/A"; aug.Text = "N/A"; sep.Text = "N/A"; oct.Text = "N/A"; nov.Text = "N/A"; } } else { 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"; } else if (list[i].ToString() == "February") { feb.Text = "PAID"; } else if (list[i].ToString() == "March") { mar.Text = "PAID"; } else if (list[i].ToString() == "April") { apr.Text = "PAID"; } else if (list[i].ToString() == "May") { may.Text = "PAID"; } else if (list[i].ToString() == "June") { jun.Text = "PAID"; } else if (list[i].ToString() == "July") { jul.Text = "PAID"; } else if (list[i].ToString() == "August") { aug.Text = "PAID"; } else if (list[i].ToString() == "September") { sep.Text = "PAID"; } else if (list[i].ToString() == "October") { oct.Text = "PAID"; } else if (list[i].ToString() == "November") { nov.Text = "PAID"; } else if (list[i].ToString() == "December") { dec.Text = "PAID"; } } else { break; } } } /* 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; } }*/ } catch (Exception) { MessageBox.Show("Error !!!"); } }
private void SerachMembertextBox_TextChanged(object sender, EventArgs e) { try { signUpPictureBox.Visible = true; Account_BO ab = new Account_BO(); member = ab.getMember(serachMembertextBox.Text); //memberFirstNameMetroLabel.Text = member.firstName.ToString(); // memberLastNameMetroLabel.Text = member.lastName.ToString(); MemoryStream ms = new MemoryStream(member.image); //pictureBox.Image = Image.FromStream(ms); signUpFirstNamemetroTextBox.Text = member.firstName; signUpLastNamemetroTextBox.Text = member.lastName; signUpGendermetroComboBox.Text = member.gender; signUpDOBmetroDateTime.Text = member.DOB; signUpEmailmetroTextBox.Text = member.email; signUpPhoneNoMetroTextBox.Text = member.phoneNo; signUpPictureBox.Image = Image.FromStream(ms); signUpSalarytextBox.Text = member.salary; signUpUserNamemetroTextBox.Text = member.userName; } catch { signUpFirstNamemetroTextBox.Clear(); signUpLastNamemetroTextBox.Clear(); signUpGendermetroComboBox.ResetText(); signUpDOBmetroDateTime.ResetText(); signUpEmailmetroTextBox.Clear(); signUpUserNamemetroTextBox.Clear(); signUpPasswordmetroTextBox.Clear(); signUpRepeatPasswordmetroTextBox.Clear(); imagePath = ""; signUpPictureBox.Visible = false; signUpPhoneNoMetroTextBox.Clear(); signUpSalarytextBox.Clear(); } }
private void Home_Admin_NotesAndReminder_Load(object sender, EventArgs e) { setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); right_option_timer.Start(); try { Account_BO ab = new Account_BO(); member = ab.getMember(userName); memberFirstNameMetroLabel.Text = member.firstName.ToString(); memberLastNameMetroLabel.Text = member.lastName.ToString(); MemoryStream ms = new MemoryStream(member.image); pictureBox.Image = Image.FromStream(ms); } catch { } try { Note note = new Note(); note.date = last_dateTimePicker.Text; note.userName = userName; DataSet ds = account_Bo.getNote(note); historyGrid.DataSource = ds.Tables[0]; } catch { } }
private void update_Create_Click(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); try { int temp = index1; if (update_userName_txt.Text != "" && update_Ocupation_TextBox.Text != null && update_Gender_com.Text != null && update_address.Text != null && update_phoneNo.Text != "" && update_Landline.Text != null && update_EmailID.Text != null && imagePath != null && update_dop_dtp.Text != null) { list[temp + 1] = update_userName_txt.Text; list[temp + 2] = update_address.Text; list[temp + 3] = update_Gender_com.Text; list[temp + 4] = update_dop_dtp.Text; list[temp + 5] = update_Ocupation_TextBox.Text; list[temp + 7] = update_phoneNo.Text; list[temp + 8] = update_Landline.Text; list[temp + 9] = update_EmailID.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 Home_Admin_Withdraw_Show_Load(object sender, EventArgs e) { setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); rightOptionPnlTimer.Start(); Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); ArrayList userBill = new ArrayList(account_BO.getUserBill()); 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(); gender.Text = list[index + 3].ToString(); dateOfBirth.Text = list[index + 4].ToString(); occupation.Text = list[index + 5].ToString(); mob.Text = list[index + 7].ToString(); lan.Text = list[index + 8].ToString(); email.Text = list[index + 9].ToString(); stYear.Text = list[index + 10].ToString(); pictureBox.Load(k); //serYear.Text = list[index2].ToString(); //billing int m = 0; while (userBill[m].ToString() != list[index].ToString()) { m++; } int b; for (b = m; userBill[b].ToString() != "*"; b++) { } DateTime presentDate = DateTime.Now; lastPaidDate_lbl.Text = userBill[b - 3].ToString(); lastPaidAmount_lbl.Text = userBill[b - 2].ToString() + " TK"; previousDue_lbl.Text = userBill[b - 1].ToString() + " TK"; int dueBill = Convert.ToInt32(userBill[b - 1].ToString()); firstDate_lbl.Text = userBill[b - 3].ToString(); lastDate_lbl.Text = presentDate.ToShortDateString(); DateTime prevDate = DateTime.Parse(userBill[b - 3].ToString()); TimeSpan defDate = presentDate.Subtract(prevDate); string defDays = defDate.Days.ToString(); double temp1 = (Convert.ToDouble(defDays) / 30); int totalMonth = (int)temp1; totalMonth_lbl.Text = totalMonth.ToString(); totalBill_lbl.Text = (totalMonth * 120 + dueBill).ToString() + " TK"; } catch { } }
private void Home_Admin_Load(object sender, EventArgs e) { setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); right_option_timer.Start(); try { Account_BO ab = new Account_BO(); member = ab.getMember(userName.ToString()); memberNameMetroLabel.Text = member.firstName.ToString(); memberTypeMetroLabel.Text = member.lastName.ToString(); MemoryStream ms = new MemoryStream(member.image); pictureBox.Image = Image.FromStream(ms); pictureBox18.Image = Image.FromStream(ms); metroLabel4.Text = member.firstName.ToString(); metroLabel3.Text = member.lastName.ToString(); if(i==0) { soundPlay(); i = 1; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Home_Admin_Ownew_Expenditure_Details_Load(object sender, EventArgs e) { setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); rightOptionPnlTimer.Start(); try { Account_BO ab = new Account_BO(); ArrayList cost = new ArrayList(); cost = ab.getOwnerCost(); 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 Home_Admin_EntryNewProduct_Load(object sender, EventArgs e) { setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); right_option_timer.Start(); try { Account_BO ab = new Account_BO(); member = ab.getMember(userName); memberFirstNameMetroLabel.Text = member.firstName.ToString(); memberLastNameMetroLabel.Text = member.lastName.ToString(); MemoryStream ms = new MemoryStream(member.image); pictureBox.Image = Image.FromStream(ms); //explorer = new PosExplorer(); //scannerList1 = explorer.GetDevices(); //bsDevices.DataSource = scannerList1; //cboDevices.DisplayMember = scannerList1.ToString(); //scannerList = explorer.GetDevices(DeviceType.Scanner); //devicesBinidingSource.DataSource = scannerList; //lstDevices.DisplayMember = scannerList.ToString(); } catch (Exception ex) { } }
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 Home_Admin_AccountRemove_Remove_Load(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); rightOptionPnlTimer.Start(); 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(); gender.Text = list[index + 3].ToString(); dateOfBirth.Text = list[index + 4].ToString(); occupation.Text = list[index + 5].ToString(); mob.Text = list[index + 7].ToString(); lan.Text = list[index + 8].ToString(); email.Text = list[index + 9].ToString(); stDate.Text = list[index + 10].ToString(); pictureBox.Load(k); }
private void Home_Admin_AccountWithdraw_Withdraw_Load(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); ArrayList userBill = new ArrayList(account_BO.getUserBill()); setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); rightOptionPnlTimer.Start(); 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(); gender.Text = list[index + 3].ToString(); dateOfBirth.Text = list[index + 4].ToString(); occupation.Text = list[index + 5].ToString(); mob.Text = list[index + 7].ToString(); lan.Text = list[index + 8].ToString(); email.Text = list[index + 9].ToString(); stYear.Text = list[index + 10].ToString(); pictureBox.Load(k); //serYear.Text = list[index2].ToString(); //billing int m = 0; while (userBill[m].ToString() != list[index].ToString()) { m++; } int b; for (b = m; userBill[b].ToString() != "*"; b++) { } DateTime presentDate = DateTime.Now; lastPaidDate_lbl.Text = userBill[b - 3].ToString(); lastPaidAmount_lbl.Text = userBill[b - 2].ToString() + " TK"; previousDue_lbl.Text = userBill[b - 1].ToString() + " TK"; int dueBill = Convert.ToInt32(userBill[b - 1].ToString()); firstDate_lbl.Text = userBill[b-3].ToString(); lastDate_lbl.Text = presentDate.ToShortDateString(); DateTime prevDate = DateTime.Parse(userBill[b - 3].ToString()); TimeSpan defDate = presentDate.Subtract(prevDate); string defDays = defDate.Days.ToString(); double temp1 = (Convert.ToDouble(defDays) / 30); int totalMonth = (int)temp1; totalMonth_lbl.Text = totalMonth.ToString(); totalBill_lbl.Text = (totalMonth * 120 + dueBill).ToString(); /* jan.Text = "DUE"; feb.Text = "DUE"; mar.Text = "DUE"; apr.Text = "DUE"; may.Text = "DUE"; jun.Text = "DUE"; jul.Text = "DUE"; aug.Text = "DUE"; sep.Text = "DUE"; oct.Text = "DUE"; nov.Text = "DUE"; dec.Text = "DUE"; if (index2 - index1 == 10) { 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"; } else if (list[i].ToString() == "February") { feb.Text = "PAID"; } else if (list[i].ToString() == "March") { mar.Text = "PAID"; } else if (list[i].ToString() == "April") { apr.Text = "PAID"; } else if (list[i].ToString() == "May") { may.Text = "PAID"; } else if (list[i].ToString() == "June") { jun.Text = "PAID"; } else if (list[i].ToString() == "July") { jul.Text = "PAID"; } else if (list[i].ToString() == "August") { aug.Text = "PAID"; } else if (list[i].ToString() == "September") { sep.Text = "PAID"; } else if (list[i].ToString() == "October") { oct.Text = "PAID"; } else if (list[i].ToString() == "November") { nov.Text = "PAID"; } else if (list[i].ToString() == "December") { dec.Text = "PAID"; } } else { break; } } if (list[index2 + 1].ToString() == "February") { jan.Text = "N/A"; } else if (list[index2 + 1].ToString() == "March") { jan.Text = "N/A"; feb.Text = "N/A"; } else if (list[index2 + 1].ToString() == "April") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; } else if (list[index2 + 1].ToString() == "May") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; } else if (list[index2 + 1].ToString() == "June") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; may.Text = "N/A"; } else if (list[index2 + 1].ToString() == "July") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; may.Text = "N/A"; jun.Text = "N/A"; } else if (list[index2 + 1].ToString() == "August") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; may.Text = "N/A"; jun.Text = "N/A"; jul.Text = "N/A"; } else if (list[index2 + 1].ToString() == "September") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; may.Text = "N/A"; jun.Text = "N/A"; jul.Text = "N/A"; aug.Text = "N/A"; } else if (list[index2 + 1].ToString() == "October") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; may.Text = "N/A"; jun.Text = "N/A"; jul.Text = "N/A"; aug.Text = "N/A"; sep.Text = "N/A"; } else if (list[index2 + 1].ToString() == "November") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; may.Text = "N/A"; jun.Text = "N/A"; jul.Text = "N/A"; aug.Text = "N/A"; sep.Text = "N/A"; oct.Text = "N/A"; } else if (list[index2 + 1].ToString() == "December") { jan.Text = "N/A"; feb.Text = "N/A"; mar.Text = "N/A"; apr.Text = "N/A"; may.Text = "N/A"; jun.Text = "N/A"; jul.Text = "N/A"; aug.Text = "N/A"; sep.Text = "N/A"; oct.Text = "N/A"; nov.Text = "N/A"; } } else { 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"; } else if (list[i].ToString() == "February") { feb.Text = "PAID"; } else if (list[i].ToString() == "March") { mar.Text = "PAID"; } else if (list[i].ToString() == "April") { apr.Text = "PAID"; } else if (list[i].ToString() == "May") { may.Text = "PAID"; } else if (list[i].ToString() == "June") { jun.Text = "PAID"; } else if (list[i].ToString() == "July") { jul.Text = "PAID"; } else if (list[i].ToString() == "August") { aug.Text = "PAID"; } else if (list[i].ToString() == "September") { sep.Text = "PAID"; } else if (list[i].ToString() == "October") { oct.Text = "PAID"; } else if (list[i].ToString() == "November") { nov.Text = "PAID"; } else if (list[i].ToString() == "December") { dec.Text = "PAID"; } } else { break; } } }*/ } catch (Exception) { MessageBox.Show("Error !!!"); } }
private void Pay_btn_Click(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); ArrayList userBill = new ArrayList(account_BO.getUserBill()); try { int temp = index1; int i; int k = 1; ; for (i = index1; list[i].ToString() != "*****"; i++) { k++; } int m = 0; while (userBill[m].ToString() != list[index1].ToString()) { m++; } int n; int o = 1; for (n = m; userBill[n].ToString() != "*"; n++) { o++; } userBill.RemoveRange(m, o); list.RemoveRange(temp, k); account_BO.createAccount(list); account_BO.decreaseTotalUser(); account_BO.setUserBill(userBill); MessageBox.Show("Account remove successfull..."); this.Hide(); Home_Admin home_Admin = new Home_Admin(); home_Admin.Show(); } catch { MessageBox.Show("Wrong!!!"); } }
private void Home_Admin_CreditHistoryBalance_Load(object sender, EventArgs e) { setFullScreen(); setMainPanelPosition(); setRightOptionPanel(); right_option_timer.Start(); try { Account_BO ab = new Account_BO(); member = ab.getMember(userName); memberFirstNameMetroLabel.Text = member.firstName.ToString(); memberLastNameMetroLabel.Text = member.lastName.ToString(); MemoryStream ms = new MemoryStream(member.image); pictureBox.Image = Image.FromStream(ms); } catch { } }
private void update_button_Click(object sender, EventArgs e) { Client client = new Client(); client.name = clientNametextbox.Text; client.mobileNo = clientMobileNo.Text; client.address = clientAddresstextbox.Text; try { if (MessageBox.Show("Are you sure?", "Update Client", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { Account_BO account_Bo = new Account_BO(); account_Bo.updateClient(client); DataSet ds = account_Bo.getAllClient(); clientMetroGrid.DataSource = ds.Tables[0]; clientMobileNo.Clear(); clientNametextbox.Clear(); clientAddresstextbox.Clear(); } } catch { } }