public static void Main(String[] args) { int UserChoice; do { Console.WriteLine("1-Add Employee Details"); Console.WriteLine("2-Exit"); Console.WriteLine("Enter Your Choice"); UserChoice = int.Parse(Console.ReadLine()); switch (UserChoice) { case 1: Employee emp = new Employee(); AddEmployeeDetails(emp); AssignDepartment dep = new AssignDepartment(DepCheck); String stream = dep(emp.setQualification); if (stream != "Invalid") { Console.WriteLine("Employee Added under " + stream); } break; case 2: Console.WriteLine("Thank You"); break; default: Console.WriteLine("Invalid Input"); break; } } while (UserChoice != 2); }
protected void OnRowUpdating(object sender, GridViewUpdateEventArgs e) { GridViewRow row = AssignStoreClerkGridView.Rows[e.RowIndex]; int storeClerkId = Convert.ToInt32((row.FindControl("StoreClerkIdList") as DropDownList).Text); String deptId = (row.FindControl("DeptIdTextBox") as Label).Text; AssignDepartment.updateStoreClerkDepartment(storeClerkId, deptId); AssignStoreClerkGridView.EditIndex = -1; AssignStoreClerkGridView.DataSource = AssignDepartment.getStoreClerkDepartmentList(); BindGrid(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Updated successfully!');", true); }
protected void Page_Load(object sender, EventArgs e) { if (!Context.User.IsInRole("Store Supervisor")) { Response.Redirect("~/ErrorPages/Unauthorised"); } else { if (!IsPostBack) { DataBind(); AssignStoreClerkGridView.DataSource = AssignDepartment.getStoreClerkDepartmentList(); AssignStoreClerkGridView.DataBind(); } } }
private void BindGrid() { AssignStoreClerkGridView.DataSource = AssignDepartment.getStoreClerkDepartmentList(); AssignStoreClerkGridView.DataBind(); }