private void button1_Click(object sender, EventArgs e) { //[CONNECTION STRINGS] var connectionString = ConfigurationManager.ConnectionStrings["EmployeeManagement"].ConnectionString; SqlConnection con = new SqlConnection(connectionString); //Go through all the data in TaskSchedule table and display con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "select * from TaskSchedule"; cmd.ExecuteNonQuery(); DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); TasksGrid.DataSource = dt; TasksGrid.Refresh(); con.Close(); Dashboard.Visible = true; panel2.Visible = false; panel3.Visible = false; panel4.Visible = false; holidayPanel.Visible = false; }
private void bindTasksView() { var id = Request.QueryString["Id"]; String strConnString = ConfigurationManager.ConnectionStrings["OFOConnectionString"].ConnectionString; SqlConnection con = new SqlConnection(strConnString); con.Open(); SqlCommand command = new SqlCommand("dbo.ViewTasks", con); command.Parameters.AddWithValue("@OFOCode", id); command.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(command); DataTable dt = new DataTable(); da.Fill(dt); TasksGrid.DataSource = dt; TasksGrid.DataBind(); TasksGrid.Visible = true; }
private void EmployeePanel_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'registerdUsersDataSet3.HolidayLeave' table. You can move, or remove it, as needed. this.holidayLeaveTableAdapter1.Fill(this.registerdUsersDataSet3.HolidayLeave); // TODO: This line of code loads data into the 'registerdUsersDataSet2.HolidayLeave' table. You can move, or remove it, as needed. this.holidayLeaveTableAdapter.Fill(this.registerdUsersDataSet2.HolidayLeave); NameLabel.Text = "Welcome, " + CurrentUser.Name + "!"; // TODO: This line of code loads data into the 'rolesTableData.Roles' table. You can move, or remove it, as needed. this.rolesTableAdapter.Fill(this.rolesTableData.Roles); // TODO: This line of code loads data into the 'employeesTableData.Employees' table. You can move, or remove it, as needed. this.employeesTableAdapter.Fill(this.employeesTableData.Employees); // TODO: This line of code loads data into the 'taskTableData.TaskSchedule' table. You can move, or remove it, as needed. this.taskScheduleTableAdapter.Fill(this.taskTableData.TaskSchedule); var connectionString = ConfigurationManager.ConnectionStrings["EmployeeManagement"].ConnectionString; SqlConnection con = new SqlConnection(connectionString); con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "select * from TaskSchedule"; cmd.ExecuteNonQuery(); DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); TasksGrid.DataSource = dt; TasksGrid.Refresh(); con.Close(); Dashboard.Visible = true; panel2.Visible = false; panel3.Visible = false; panel4.Visible = false; holidayPanel.Visible = false; }