using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using Ease.CoreV35.DataAccess; using Ease.CoreV35.Model; using Payroll.BO; namespace Payroll.Service { class VendorBillDA { internal static System.Data.IDataReader GetByVendorID(Ease.CoreV35.DataAccess.TransactionContext tc, Ease.CoreV35.Model.ID id) { return tc.ExecuteReader("SELECT * FROM VendorBill where VendorID=%n", id.Integer); } 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.Integer, item.VendorID.Integer, 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.Integer); tc.ExecuteNonQuery(sql); } internal static void Delete(TransactionContext tc, ID id) { tc.ExecuteNonQuery("DELETE FROM VendorBill WHERE VendorBillID=%n", id.Integer); } } }