public List <clsBillables> sp_getBillableSummary(clsBillablesKeys keys) { SqlCommand sqlCommand = new SqlCommand(); sqlCommand.CommandText = "dbo.[sp_getBillableSummary]"; sqlCommand.CommandType = CommandType.StoredProcedure; // Use connection object of base class sqlCommand.Connection = MainConnection; try { sqlCommand.Parameters.Add(new SqlParameter("@Month", keys.MONTH)); sqlCommand.Parameters.Add(new SqlParameter("@Year", keys.YEAR)); MainConnection.Open(); IDataReader dataReader = sqlCommand.ExecuteReader(); return(PopulateObjectsFromReader2(dataReader)); } catch (Exception ex) { throw new Exception("clsAttendance::sp_getBillableSummary::Error occured.", ex); } finally { MainConnection.Close(); sqlCommand.Dispose(); } }
public List <clsBillables> sp_getBillabilityHoursByEmpID(clsBillablesKeys keys) { SqlCommand sqlCommand = new SqlCommand(); sqlCommand.CommandText = "dbo.[sp_getBillabilityHoursByEmpID]"; sqlCommand.CommandType = CommandType.StoredProcedure; // Use connection object of base class sqlCommand.Connection = MainConnection; try { sqlCommand.Parameters.Add(new SqlParameter("@empID", keys.EMPID)); sqlCommand.Parameters.Add(new SqlParameter("@dateStart", keys.DATESTART)); sqlCommand.Parameters.Add(new SqlParameter("@dateFinish", keys.DATEFINISH)); sqlCommand.Parameters.Add(new SqlParameter("@userChoice", keys.USERCHOICE)); MainConnection.Open(); IDataReader dataReader = sqlCommand.ExecuteReader(); return(PopulateObjectsFromReader(dataReader)); } catch (Exception ex) { throw new Exception("clsAttendance::sp_getBillabilityHoursByEmpID::Error occured.", ex); } finally { MainConnection.Close(); sqlCommand.Dispose(); } }