using System; using System.Collections.Generic; using System.Linq; using System.Text; using Ease.CoreV35.DataAccess; using Payroll.BO; using Ease.CoreV35.Model; using System.Data; namespace Payroll.Service { public class AppraisalPointDA { 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,CreatedBy,CreatedDate,Sequence,status) Values(%n,%s,%s,%n,%d,%n,%n)", item.ID.Integer, item.Code, item.Name, item.CreatedBy.Integer, item.CreatedDate, item.Sequence, item.Status); } internal static void Update(TransactionContext tc, AppraisalPoint item) { tc.ExecuteNonQuery("Update AppraisalPoint Set Code = %s, Name = %s , ModifiedBy = %n, ModifiedDate = %d,Status = %n Where AppraisalPointID = %n", item.Code, item.Name, item.ModifiedBy.Integer, item.ModifiedDate,item.Status, item.ID.Integer); } internal static void Delete(TransactionContext tc, ID id) { tc.ExecuteNonQuery("Delete From AppraisalPoint Where AppraisalPointID = %n", id.Integer); } internal static DataSet CheckCode(TransactionContext tc, string code) { return tc.ExecuteDataSet("Select * From AppraisalPoint Where Code = %s", code); } } }