private void btn_DateClear_Click(object sender, EventArgs e) { DS_Zaposlenici.EmployeePayHistoryDataTable dt_EmployeePayHistory = ds_Zaposlenici.EmployeePayHistory; DA_Zaposlenici.getPlate_by_EmployeeID(dt_EmployeePayHistory, (int)dGV_Zaposlenici.SelectedRows[0].Cells["EmployeeID"].Value); dGV_Plate.DataSource = dt_EmployeePayHistory; dTP_From.Value = new DateTime(2000, 1, 1); dTP_To.Value = DateTime.Today; }
public frm_plateZaposlenika(DS_Zaposlenici.view_ZaposleniciRow row, DS_Zaposlenici.EmployeePayHistoryDataTable dt_payHistory, DateTime dateFrom, DateTime dateTo) { this.row = row; this.dt_payHistory = dt_payHistory; this.dateFrom = dateFrom; this.dateTo = dateTo; InitializeComponent(); }
public static void getPlate_by_EmployeeID(DS_Zaposlenici.EmployeePayHistoryDataTable dt_Plate, int employeeID) { using (SqlConnection cn = Connection.GetOpenConnection()) { dt_Plate.Clear(); SqlCommand com = new SqlCommand("usp_getPlate_by_Employee", cn); com.CommandType = System.Data.CommandType.StoredProcedure; com.Parameters.AddWithValue("@EmployeeID", employeeID); SqlDataAdapter adapter = new SqlDataAdapter(com); adapter.Fill(dt_Plate); } }
private void dGV_Zaposlenici_CellContentClick(object sender, DataGridViewCellEventArgs e) { DS_Zaposlenici.EmployeePayHistoryDataTable dt_EmployeePayHistory = ds_Zaposlenici.EmployeePayHistory; DA_Zaposlenici.getPlate_by_EmployeeID(dt_EmployeePayHistory, (int)dGV_Zaposlenici.SelectedRows[0].Cells["EmployeeID"].Value); dGV_Plate.AutoGenerateColumns = false; dGV_Plate.DataSource = dt_EmployeePayHistory; if (dt_EmployeePayHistory.Count > 1) { enable_buttons(true); } else { enable_buttons(true); } }