Ejemplo n.º 1
0
 public Leave()
 {
     InitializeComponent();
     admin = new Admin();
     leave = new Leaves();
     //FillComboInstructor();
 }
Ejemplo n.º 2
0
 public Leave()
 {
     InitializeComponent();
     admin = new Admin();
     leave = new Leaves();
     //FillComboInstructor();
 }
Ejemplo n.º 3
0
 public void EditRow(Leaves leave, int index)
 {
     DataRow selectedRow = dataSet.Tables["JoinEmployeeLeave"].Rows[index];
     selectedRow["StartDate"] = leave.StartDate;
     selectedRow["EndDate"] = leave.EndDate;
     selectedRow["Reason"] = leave.Reason;
     selectedRow["NoOfDays"] = leave.NoOfDays;
     EditRecord(leave, index);
 }
Ejemplo n.º 4
0
        public void DeleteRow(Leaves leave, int index)
        {
            DataRow selectedRow = dataSet.Tables["JoinEmployeeLeave"].Rows[index];
            selectedRow.Delete();

            DeleteRecord(leave, index);
        }
Ejemplo n.º 5
0
 public void AddRecord(Leaves leave)
 {
     connection.Open();
     //set up command
     SqlCommand command = new SqlCommand("gprocedureInsertEmployeeLeave", connection);
     //set up commandType
     command.CommandType = CommandType.StoredProcedure;
     //set up parameters
     command.Parameters.AddWithValue("@EmployeeID", leave.Employee.EmoloyeeID);
     command.Parameters.AddWithValue("@StartDate", leave.StartDate);
     command.Parameters.AddWithValue("@EndDate", leave.EndDate);
     command.Parameters.AddWithValue("@Reason", leave.Reason);
     command.Parameters.AddWithValue("@NoOfDays", leave.NoOfDays);
     command.ExecuteNonQuery();
     connection.Close();
 }
Ejemplo n.º 6
0
 private void EditRecord(Leaves leave, int index)
 {
     SqlCommand command = new SqlCommand();
     command.Connection = connection;
     command.CommandType = CommandType.StoredProcedure;
     command.CommandText = "gprocedureUpdateEmployeeLeave";
     dataAdapter.UpdateCommand = command;
     command.Parameters.AddWithValue("@LeaveID", leave.LeaveID);
     command.Parameters.AddWithValue("@StartDate", leave.StartDate);
     command.Parameters.AddWithValue("@EndDate", leave.EndDate);
     command.Parameters.AddWithValue("@Reason", leave.Reason);
     command.Parameters.AddWithValue("@NoOfDays", leave.NoOfDays);
     dataAdapter.Update(dataSet, "JoinEmployeeLeave");
 }
Ejemplo n.º 7
0
        private void DeleteRecord(Leaves leave, int index)
        {
            SqlCommand command = new SqlCommand();
            command.Connection = connection;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "gprocedureDeleteEmployeeLeave";
            dataAdapter.DeleteCommand = command;

            command.Parameters.AddWithValue("@LeaveID", leave.LeaveID);
            dataAdapter.Update(dataSet, "JoinEmployeeLeave");
        }