public string GetInsertSQL() { return(String.Format(@"insert into table_vendorbalance ( vb_vendorbalancetype, period_id, vendor_id, ccy_id, vb_balance ) VALUES ('{0}',{1},{2},{3},{4})", VENDOR_BALANCE_TYPE.ToString(), PERIOD.ID, VENDOR.ID, CURRENCY.ID, BALANCE )); }
public static VendorBalance FindVendorBalanceHeader(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); } return(sc); }
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())); }