using HRM.BO; using Ease.Core.DataAccess; using System; using System.Collections.Generic; using System.Data; namespace HRM.DA { public class TrainingAssessmentDA { #region Get Function public static IDataReader Get(TransactionContext tc, int id) { return tc.ExecuteReader("SELECT * from TrainingAssessment WHERE TrainingAssessmentID=%n", id); } public static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * from TrainingAssessment"); } #endregion #region Insert Function public static void Insert(TransactionContext tc, TrainingAssessment oItem) { tc.ExecuteNonQuery("INSERT INTO TrainingAssessment(TrainingAssessmentID, TrainingId, EmployeeId," + "Duration,IsAssessmentCompleted,IvaluationPoint,ObtainedIvaluationPoint,Location, Remarks, CREATEDBY,CREATEDDATE)" + " VALUES(%n,%n,%n, %s, %b, %n, %n, %s, %s, %s, %s, %n, %d)", oItem.ID, oItem.TrainingId, oItem.EmployeeId, oItem.Duration, oItem.IsAssessmentCompleted, oItem.IvaluationPoint, oItem.ObtainedIvaluationPoint, oItem.Location, oItem.Remarks, DataReader.GetNullValue(oItem.CreatedBy), DataReader.GetNullValue(oItem.CreatedDate)); } #endregion #region Update Function public static void Update(TransactionContext tc, TrainingAssessment oItem) { tc.ExecuteNonQuery("UPDATE TrainingAssessment SET TrainingId=%n, EmployeeId=%n,Duration=%s," + "IsAssessmentCompleted=%b,IvaluationPoint=%n,ObtainedIvaluationPoint=%n,Location=%s, " + "Remarks = %s, MODIFIEDBY=%n, MODIFIEDDATE=%d " + " WHERE TrainingAssessmentID=%n", oItem.TrainingId, oItem.EmployeeId, oItem.Duration, oItem.IsAssessmentCompleted, oItem.IvaluationPoint, oItem.ObtainedIvaluationPoint, oItem.Location, oItem.Remarks, oItem.ModifiedBy, oItem.ModifiedDate, oItem.ID); } #endregion #region Delete Function public static void Delete(TransactionContext tc, int id) { tc.ExecuteNonQuery("Delete from TrainingAssessment where TrainingAssessmentID=%n", id); } #endregion } }