private void btn_Delete_Click(object sender, EventArgs e) { Role role = FormToRole(); EmployeeArr employeeArr = new EmployeeArr(); employeeArr.Fill(); if (role.Id == 0) { } else { if (employeeArr.DoesExist(role)) { MessageBox.Show("You can not delete this role, it is connected" + " to 1 or more Employee", "Can not delete role", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (MessageBox.Show("Are you sure you want to delete this" + " Role? ", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { role.Delete(); ClearForm(); RoleArrToForm(null); } } } }
public Employee GetEmployee(string Username, string Password) { EmployeeArr employeeArr = new EmployeeArr(); employeeArr.Fill(); employeeArr = employeeArr.FilterUsername(Username, Password); return(employeeArr[0] as Employee); }
private void EmployeeArrToForm() { //ממירה את הטנ"מ אוסף לקוחות לטופס EmployeeArr employeeArr = new EmployeeArr(); employeeArr.Fill(); listbox_Employees.DataSource = employeeArr; }
private bool CheckEmployee(string Username, string Password) { EmployeeArr employeeArr = new EmployeeArr(); employeeArr.Fill(); employeeArr = employeeArr.FilterUsername(Username, Encrypt(Password)); if (employeeArr.Count == 1) { return(true); } return(false); }
private void EmployeeArrToForm(Employee curemployee) { EmployeeArr employeeArr = new EmployeeArr(); employeeArr.Fill(); cmb_Employee.ValueMember = "Id"; cmb_Employee.DisplayMember = "FullRole"; cmb_Employee.DataSource = employeeArr; if (curemployee != null) { cmb_Employee.SelectedValue = curemployee.Id; } }
public EmployeeArr GetEmployees() { int id = 0; //אם המשתמש רשם ערך בשדה המזהה if (txt_Id.Text != "") { id = int.Parse(txt_Id.Text); } //מייצרים אוסף של כלל הלקוחות EmployeeArr employeeArr = new EmployeeArr(); employeeArr.Fill(); //מסננים את אוסף הלקוחות לפי שדות הסינון שרשם המשתמש employeeArr = employeeArr.Filter(id, txt_Name.Text, txt_PhoneNumber.Text); return(employeeArr); }
private void textBox_Filter_KeyUp(object sender, KeyEventArgs e) { int id = 0; //אם המשתמש רשם ערך בשדה המזהה if (txt_Id.Text != "") { id = int.Parse(txt_Id.Text); } //מייצרים אוסף של כלל הלקוחות EmployeeArr employeeArr = new EmployeeArr(); employeeArr.Fill(); //מסננים את אוסף הלקוחות לפי שדות הסינון שרשם המשתמש employeeArr = employeeArr.Filter(id, txt_Name.Text, txt_PhoneNumber.Text); //מציבים בתיבת הרשימה את אוסף הלקוחות }
private bool IsDataExsits(string Email, string Phone, string Username) { // מחזיר האם האיימיל כבר קיםם במערכת EmployeeArr employeeArr = new EmployeeArr(); employeeArr.Fill(); if (employeeArr.IsContainPhone(Phone)) { MessageBox.Show("Phone Number is already in use", "Phone Number is unvalid", MessageBoxButtons.OK, MessageBoxIcon.Error); return(true); } else { } if (employeeArr.IsContainEmail(Email)) { MessageBox.Show("Email is already in use", "Email is unvalid", MessageBoxButtons.OK, MessageBoxIcon.Error); return(true); } else { } if (employeeArr.IsContainUsername(Username)) { MessageBox.Show("Username is already in use", "Username is unvalid", MessageBoxButtons.OK, MessageBoxIcon.Error); return(true); } else { } return(false); }