EchoTex_Payroll/HRM.DA/DA/Vendor/VendorBillDA.cs

40 lines
1.6 KiB
C#
Raw Permalink Normal View History

2024-10-14 10:01:49 +06:00
using HRM.BO;
using Ease.Core.DataAccess;
using System;
using System.Collections.Generic;
using System.Data;
namespace HRM.DA
{
class VendorBillDA
{
internal static System.Data.IDataReader GetByVendorID(Ease.Core.DataAccess.TransactionContext tc, int id)
{
return tc.ExecuteReader("SELECT * FROM VendorBill where VendorID=%n", id);
}
internal static void Insert(TransactionContext tc, VendorBill item)
{
string sql = SQLParser.MakeSQL(
"INSERT INTO VendorBill(VendorBillID,VendorID, ChallanNumber, EffectDate,Amount,PaymentMode, Remarks, IsAdvance,IsFullPaid)" +
" VALUES(%n,%n,%s, %d, %n, %n, %s,%b,%b)", item.ID, item.VendorID, item.ChalanNumber, item.EffectDate,
item.Amount, item.PaymentMode, item.Remarks, item.IsAdvance, item.IsFullPaid);
tc.ExecuteNonQuery(sql);
}
internal static void Update(TransactionContext tc, VendorBill item)
{
string sql =
SQLParser.MakeSQL(
"UPDATE VendorBill SET ChallanNumber=%s, EffectDate=%d, Amount=%n, PaymentMode=%n, Remarks=%s,IsAdvance=%b,IsFullPaid=%b" +
" WHERE VendorBillID=%n", item.ChalanNumber, item.EffectDate, item.Amount, item.PaymentMode,
item.Remarks, item.IsAdvance, item.IsFullPaid, item.ID);
tc.ExecuteNonQuery(sql);
}
internal static void Delete(TransactionContext tc, int id)
{
tc.ExecuteNonQuery("DELETE FROM VendorBill WHERE VendorBillID=%n", id);
}
}
}