public static string getPendingDetails() { Database db = new Database(); try { DataTable table = db.query("select ticket,stock_id,portfolio_id,type from pendingDetails where portfolio_id=" + account_id); string orders = ""; foreach (DataRow row in table.Rows) { orders += row["ticket"] + ";"; } if (orders.Length == 0) { return(""); } else { return(orders.Substring(0, orders.Length - 1)); } } catch (Exception e) { Database.log_sql_error(e); return(""); } }
public static string getOpen() { String sql = ""; try { Database db = new Database(); sql = "select stock_id,portfolio_id,type,volume,avgPrice,rec,date from stockinportfolio where rec like 'OPEN%' and portfolio_id=" + account_id; DataTable dt = db.query(sql); string order = ""; foreach (DataRow Row in dt.Rows) { order += Row["stock_id"].ToString() + ","; order += Row["portfolio_id"].ToString() + ","; order += Row["type"].ToString() + ","; order += Row["volume"].ToString() + ","; order += Row["avgPrice"].ToString() + ","; order += Row["rec"].ToString() + ","; order += Row["date"].ToString(); order += ";"; } if (order.Length == 0) { return(""); } else { return(order.Substring(0, order.Length - 1)); } } catch (Exception e) { Database.log_sql_error(e, sql); return(""); } }