public void InsertMeansOfPayment(MeansOfPayment mop) { using (ISession session = HibernateProvider.Factory.OpenSession()) { session.SaveOrUpdate(mop); session.Flush(); } }
public void DeleteMeansOfPayment(MeansOfPayment mop) { using (ISession session = HibernateProvider.Factory.OpenSession()) { session.Delete(mop); session.Flush(); } }
public List<MeansOfPayment> LoadMeansOfPayments(string whereClause) { List<MeansOfPayment> mopList = new List<MeansOfPayment>(); string sqlQuery = "SELECT * FROM " + MeansOfPayment._tableName; sqlQuery += ((whereClause != null && whereClause.Length > 0) ? " WHERE " + whereClause : ""); try { OleDbCommand sqlCommand = new OleDbCommand(sqlQuery, _accessConnection); OleDbDataReader reader = sqlCommand.ExecuteReader(); while (reader.Read()) { MeansOfPayment newMop = new MeansOfPayment(); newMop.Load(reader); mopList.Add(newMop); } } catch (Exception e) { } return mopList; }
/// <summary> /// Create a new MeansOfPayment object. /// </summary> /// <param name="paymentMethodID">Initial value of the PaymentMethodID property.</param> /// <param name="paymentType">Initial value of the PaymentType property.</param> public static MeansOfPayment CreateMeansOfPayment(global::System.Int32 paymentMethodID, global::System.String paymentType) { MeansOfPayment meansOfPayment = new MeansOfPayment(); meansOfPayment.PaymentMethodID = paymentMethodID; meansOfPayment.PaymentType = paymentType; return meansOfPayment; }
/// <summary> /// Deprecated Method for adding a new object to the MeansOfPayments EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToMeansOfPayments(MeansOfPayment meansOfPayment) { base.AddObject("MeansOfPayments", meansOfPayment); }