EchoTex_Payroll/HRM.DA/DA/Basic/HrNotificationDA.cs

55 lines
2.8 KiB
C#
Raw Permalink Normal View History

2024-10-14 10:01:49 +06:00
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ease.Core.DataAccess;
using HRM.BO.Basic;
namespace HRM.DA.DA.Basic
{
internal class HrNotificationDA
{
internal static IDataReader GetAll(TransactionContext tc)
{
return tc.ExecuteReader("select * from HrNotification");
}
internal static IDataReader Get(TransactionContext tc, int id)
{
return tc.ExecuteReader("select * from HrNotification where hrNotificationId = %n", id);
}
internal static void Insert(TransactionContext tc, HrNotification item)
{
tc.ExecuteNonQuery(@"INSERT INTO dbo.HrNotification (hrNotificationId,EntryDate,NotificationText,NotificationTextDetail,PublishDate,PublishEndDate,ShowAsNewDays,NotificationType,CreatedBy,CreatedDate,ModifiedBy,ModifiedDate,TotalNewDays)
VALUES (%n,%d,%s,%s,%d,%d,%n,%n,%n,%d,%n,%d,%n)", item.ID, item.EntryDate,item.NotificationText, item.NotificationTextDetail, item.PublishDate, item.PublishEndDate, item.ShowAsNewDays, item.NotificationType, item.CreatedBy, item.CreatedDate, item.ModifiedBy, item.ModifiedDate, item.TotalNewDays);
}
internal static void Update(TransactionContext tc, HrNotification item)
{
tc.ExecuteNonQuery(@"UPDATE dbo.HrNotification
SET
EntryDate = %d,
NotificationText = %s,
NotificationTextDetail = %s,
PublishDate = %d,
PublishEndDate = %d,
ShowAsNewDays = %n,
NotificationType = %n,
CreatedBy = %n,
CreatedDate = %d,
ModifiedBy = %n,
ModifiedDate = %d,
TotalNewDays = %n
WHERE hrNotificationId = %n", item.EntryDate, item.NotificationText, item.NotificationTextDetail, item.PublishDate, item.PublishEndDate, item.ShowAsNewDays, item.NotificationType, item.CreatedBy, item.CreatedDate, item.ModifiedBy, item.ModifiedDate, item.TotalNewDays, item.ID);
}
internal static void Delete(TransactionContext tc, int id)
{
tc.ExecuteNonQuery(@"Delete from HrNotification where hrNotificationId = %n", id);
}
}
}