/// <summary> /// @author : TrungMT /// @CreateDate:04/03/2008 /// @Description: Retrieves all Customer /// </summary> public static DataSet RetrievesAll() { ConnectionFactory Connection = InternalGlobal.MakeConnectionFactory(); PrCustomer Customer = new PrCustomer(Connection); try { Connection.Open(); return Customer.Search(); } catch (Exception exp) { throw exp; } finally { Connection.Close(); } }
/// <summary> /// @author : TrungMT /// @CreateDate:04/03/2008 /// @Description: Insert 1 Customer and return Customer_id auto increment /// </summary> public int Add(Customer pCustomer) { PrCustomer Customer = new PrCustomer(Connection); int intCustomerID = -1; try { Open(); intCustomerID = Customer.Create(pCustomer); Commit(); } catch (Exception exp) { Rollback(); throw exp; } finally { Close(); } return intCustomerID; }
/// <summary> /// @author : TrungMT /// @CreateDate:04/03/2008 /// @Description: Delete 1 Customer with Customer_id /// </summary> public int Delete(Customer pCustomer) { PrCustomer Customer = new PrCustomer(Connection); int intRowAffected = 0; try { Open(); intRowAffected = Customer.Delete(pCustomer); Commit(); } catch (Exception exp) { Rollback(); throw exp; } finally { Close(); } return intRowAffected; }
/// <summary> /// @author : TrungMT /// @CreateDate:04/03/2008 /// @Description: Retrieves all Customer /// </summary> public DataSet Retrieves(Customer pCustomer) { PrCustomer Customer = new PrCustomer(Connection); try { Open(); return Customer.Search(pCustomer); } catch (Exception exp) { throw exp; } finally { Close(); } }