예제 #1
0
 public void EditRow(Loan loan, int index)
 {
     DataRow selectedRow = dataSet.Tables["JoinEmployeeLoan"].Rows[index];
     selectedRow["StartDate"] = loan.StartDate;
     selectedRow["EndDate"] = loan.EndDate;
     selectedRow["TotalAmorzitation"] = loan.TotalAmorzitation;
     selectedRow["AmountLoan"] = loan.Amountloan;
     selectedRow["TypeOfLoan"] = loan.TypeLoan;
     EditRecord(loan, index);
 }
예제 #2
0
        public void DeleteRow(Loan loan, int index)
        {
            DataRow selectedRow = dataSet.Tables["JoinEmployeeLoan"].Rows[index];
            selectedRow.Delete();

            DeleteRecord(loan, index);
        }
예제 #3
0
 private void EditRecord(Loan loan, int index)
 {
     SqlCommand command = new SqlCommand();
     command.Connection = connection;
     command.CommandType = CommandType.StoredProcedure;
     command.CommandText = "iprocedureUpdateEmployeeLoan";
     dataAdapter.UpdateCommand = command;
     command.Parameters.AddWithValue("@EmployeeID", loan.Employee.EmoloyeeID);
     command.Parameters.AddWithValue("@StartDate", loan.StartDate);
     command.Parameters.AddWithValue("@EndDate", loan.EndDate);
     command.Parameters.AddWithValue("@AmountLoan", loan.Amountloan);
     command.Parameters.AddWithValue("@TotalAmorzitation", loan.TotalAmorzitation);
     command.Parameters.AddWithValue("@LoanID", loan.LoanID);
     command.Parameters.AddWithValue("@TypeLoan", loan.TypeLoan);
     dataAdapter.Update(dataSet, "JoinEmployeeLoan");
 }
예제 #4
0
 public void AddRecord(Loan loan)
 {
     connection.Open();
     //set up command
     SqlCommand command = new SqlCommand("iprocedureInsertEmployeeLoan", connection);
     //set up commandType
     command.CommandType = CommandType.StoredProcedure;
     //set up parameters
     command.Parameters.AddWithValue("@EmployeeID", loan.Employee.EmoloyeeID);
     command.Parameters.AddWithValue("@StartDate", loan.StartDate);
     command.Parameters.AddWithValue("@EndDate", loan.EndDate);
     command.Parameters.AddWithValue("@AmountLoan", loan.Amountloan);
     command.Parameters.AddWithValue("@TotalAmorzitation",loan.TotalAmorzitation);
     command.Parameters.AddWithValue("@TypeLoan", loan.TypeLoan);
     command.ExecuteNonQuery();
     connection.Close();
 }
예제 #5
0
        private void DeleteRecord(Loan loan, int index)
        {
            SqlCommand command = new SqlCommand();
            command.Connection = connection;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "iprocedureDeleteEmployeeLoan";
            dataAdapter.DeleteCommand = command;

            command.Parameters.AddWithValue("@LoanID", loan.LoanID);
            dataAdapter.Update(dataSet, "JoinEmployeeLoan");
        }