using HRM.BO; using Ease.Core.DataAccess; using System; using System.Data; namespace HRM.DA { class YearEndValueDetailsRatingDA { internal static IDataReader Get(TransactionContext tc) { string sql = SQLParser.MakeSQL("SELECT * FROM YearEndValueDetailsRating"); return tc.ExecuteReader(sql); } internal static IDataReader GetByPMPYear(TransactionContext tc, int iD) { string sql = SQLParser.MakeSQL( "select * from YearEndValueDetailsRating where objectivesetid in(select objectivesetid from objectiveset where pmpyearid=%n)", iD); return tc.ExecuteReader(sql); } internal static IDataReader GetByObjectiveSetID(TransactionContext tc, int ObjectiveSetID) { string sql = SQLParser.MakeSQL("SELECT * FROM YearEndValueDetailsRating where ObjectiveSetID=%n", ObjectiveSetID); return tc.ExecuteReader(sql); } internal static IDataReader Get(TransactionContext tc, int id) { string sql = SQLParser.MakeSQL("SELECT * FROM YearEndValueDetailsRating WHERE YearEndValueDetailsRatingID = %n", id); return tc.ExecuteReader(sql); } internal static void Update(TransactionContext tc, YearEndValueDetailsRating item) { string sql = SQLParser.MakeSQL( "Update YearEndValueDetailsRating Set ObjectivesetID=%n,ValueDetailID = %n, RatingID = %n, EmpComments = %s, LMComments = %s, EmpCommentsDate = %d, LMRatingDate = %d where YearEndValueDetailsRatingID= %n", item.ObjectiveSetID, item.ValueDetailID, item.RatingID, item.EmpComments, item.LMComments, DataReader.GetNullValue(item.EmpCommentsDate), item.LMRatingDate, item.ID); tc.ExecuteNonQuery(sql); } internal static void Save(TransactionContext tc, YearEndValueDetailsRating item) { string sql = SQLParser.MakeSQL( "Insert Into YearEndValueDetailsRating(YearEndValueDetailsRatingID, ValueDetailID,ObjectivesetID) Values(%n, %n, %n)", item.ID, item.ValueDetailID, item.ObjectiveSetID); tc.ExecuteNonQuery(sql); } internal static void Delete(TransactionContext tc, int id) { string sql = SQLParser.MakeSQL("Delete From YearEndValueDetailsRating Where YearEndValueDetailsRatingID = %n", id); tc.ExecuteNonQuery(sql); } } }