private void lblAllBranch_Click(object sender, EventArgs e) { AdminShowForm AdminShow = new AdminShowForm(dataAccess.GetData <Branch>(""), (int)Entities.Show.AdminShow.allBranch, userTable); AdminShow.Show(); this.Hide(); }
private void Action_According_Dialog_Result_2(DialogResult dialogResult, DataGridViewCellEventArgs e) { if (dialogResult == DialogResult.Yes) { DialogResult dialog = MessageBox.Show("If you Delete the branch all the worker in this branch will also be deleted\nDo you want to delete?", "Confirmation", MessageBoxButtons.YesNo); if (dialog == DialogResult.Yes) { string id = gridShowTable.Rows[e.RowIndex].Cells[2].Value.ToString(); int rowsAffected = dataAccess.Delete("Branch", "Id", id); if (rowsAffected > 0) { rowsAffected = dataAccess.Delete("Employee", "Branch_id", id); if (rowsAffected > 0) { MessageBox.Show("Branch deleted Successfully\nAlso all the worker of the branch Deleted"); DataTable BranchTable = dataAccess.GetData <Branch>(""); AdminShowForm AdminShow = new AdminShowForm(BranchTable, (int)Entities.Show.AdminShow.allBranch, userTable); AdminShow.Show(); this.Hide(); } else { MessageBox.Show("Something Went Wrong!!!"); } } else { MessageBox.Show("Something Went Wrong!!!"); } } } }
public void WorkerList(int i) { DataTable employeeTable = dataAccess.GetData <Employee>(""); AdminShowForm AdminShow = new AdminShowForm(employeeTable, i, userTable); AdminShow.Show(); this.Hide(); }
private void lblAllBranch_Click(object sender, EventArgs e) { DataTable branchTable = dataAcess.GetData <Branch>(""); AdminShowForm view = new AdminShowForm(branchTable, (int)Entities.Show.AdminShow.allBranch, userDataTable); view.Show(); this.Hide(); }
private void lblSolveWorkerProblem_Click(object sender, EventArgs e) { string sql = $"select e.User_Id,e.Name,e.Contact,ep.Problem from Employee as e, Employee_Problem as ep where e.User_Id = ep.User_id"; DataTable problemTable = dataAccess.Execute(sql); AdminShowForm adminShow = new AdminShowForm(problemTable, (int)Entities.Show.AdminShow.workerProblem, userTable); adminShow.Show(); this.Hide(); }
private void FormToGo2() { string sql = $"select e.User_Id,e.Name,e.Contact,ep.Problem from Employee as e, Employee_Problem as ep where e.User_Id = ep.User_id"; DataTable EmployeeTable = dataAccess.Execute(sql); AdminShowForm AdminShow = new AdminShowForm(EmployeeTable, (int)Entities.Show.AdminShow.workerProblem, userTable); AdminShow.Show(); this.Hide(); }