using HRM.BO; using Ease.Core.DataAccess; using System; using System.Data; namespace HRM.DA { public class AppraisalPointDA { internal static IDataReader Get(TransactionContext tc, int nId) { return tc.ExecuteReader("Select * From AppraisalPoint where AppraisalPointId = %n", nId); } internal static IDataReader Get(TransactionContext tc, EnumStatus status) { if (status == EnumStatus.Regardless) { return tc.ExecuteReader("Select * From AppraisalPoint"); } else return tc.ExecuteReader("Select * From AppraisalPoint Where Status = %n", Convert.ToInt32(status)); } internal static void Insert(TransactionContext tc, AppraisalPoint item) { tc.ExecuteNonQuery( "Insert into AppraisalPoint(AppraisalPointID,Code,Name,Point,CreatedBy,CreatedDate,Sequence,status) Values(%n,%s,%s,%n,%d,%n,%n)", item.ID, item.Code, item.Name, item.Point, item.CreatedBy, item.CreatedDate, item.Sequence, item.Status); } internal static void Update(TransactionContext tc, AppraisalPoint item) { tc.ExecuteNonQuery( "Update AppraisalPoint Set Code = %s, Name = %s, Point = %n , ModifiedBy = %n, ModifiedDate = %d,Status = %n Where AppraisalPointID = %n", item.Code, item.Name, item.Point, item.ModifiedBy, item.ModifiedDate, item.Status, item.ID); } internal static void Delete(TransactionContext tc, int id) { tc.ExecuteNonQuery("Delete From AppraisalPoint Where AppraisalPointID = %n", id); } internal static DataSet CheckCode(TransactionContext tc, string code) { return tc.ExecuteDataSet("Select * From AppraisalPoint Where Code = %s", code); } } }