public VendorBalance(Period period, Vendor vendor, Currency currency, VendorBalanceType type) { PERIOD = period; VENDOR = vendor; CURRENCY = currency; VENDOR_BALANCE_TYPE = type; }
public static string FindByVendorBalanceByCustomer(int supid, VendorBalanceType type) { return(String.Format(@"Select vbe.* from table_vendorbalanceentry vbe, table_vendorbalance vb where vbe.vb_id = vb.vb_id and vb.vendor_id = {0} and vb.vb_vendorbalancetype = '{1}'", supid, type.ToString())); }
public static string FindByVendorPeriod(int vendor, int period, VendorBalanceType t) { return(String.Format("SELECT * from table_vendorbalance where period_id = {0} and vendor_id = {1} and vb_vendorbalancetype ='{2}'", period, vendor, t.ToString())); }
public static VendorBalance FindVendorBalance(MySql.Data.MySqlClient.MySqlCommand cmd, long vendor, long currency, long periodId, VendorBalanceType type) { cmd.CommandText = String.Format("select * from table_vendorbalance where vendor_id = {0} and ccy_id = {1} and period_id = {2} and vb_vendorbalancetype = '{3}'", vendor, currency, periodId, type.ToString()); MySql.Data.MySqlClient.MySqlDataReader r = cmd.ExecuteReader(); VendorBalance sc = VendorBalance.TransformReader(r); r.Close(); if (sc != null) { sc.PERIOD = PeriodRepository.FindPeriod(cmd, sc.PERIOD.ID); cmd.CommandText = VendorBalanceEntry.FindByVendorBalance(sc.ID); MySql.Data.MySqlClient.MySqlDataReader rx = cmd.ExecuteReader(); sc.VENDOR_BALANCE_ENTRIES = VendorBalanceEntry.TransformReaderList(rx); rx.Close(); } return(sc); }