private void EditTradeAlert() { if (tradeAlertSource.Current == null) { return; } databases.baseDS.tradeAlertRow row = (databases.baseDS.tradeAlertRow)((DataRowView)tradeAlertSource.Current).Row; EditTradeAlert(row.id); }
public bool ShowNew(databases.baseDS.tradeAlertRow alertRow) { this.Refresh(); qtyEd.Value = 0; subTotalEd.Value = 0; feeAmtEd.Value = 0; totalAmtEd.Value = 0; portfolioCb.myValue = alertRow.portfolio; codeEd.Text = alertRow.stockCode.Trim(); transTypeCb.myValue = (AppTypes.TradeActions)alertRow.tradeAction; statusCb.myValue = AppTypes.CommonStatus.New; SetFocus(); ShowDialog(); return(true); }
private void orderBtn_Click(object sender, EventArgs e) { this.ShowMessage(""); if (this.myCurrentRow == null) { this.ShowMessage(Languages.Libs.GetString("noData")); return; } //Trade order databases.baseDS.tradeAlertRow row = this.myCurrentRow; myNewTradeOrderForm.ShowNew(row); }
public static void InitData(databases.baseDS.tradeAlertRow row) { row.type = ""; row.portfolio = ""; row.stockCode = ""; row.strategy = ""; row.timeScale = ""; row.onTime = DateTime.Today; row.status = 0; row.tradeAction = (byte)AppTypes.TradeActions.None; row.subject = common.Settings.sysNewDataText; row.msg = ""; }
private static void CreateTradeAlert(databases.baseDS.tradeAlertDataTable tradeAlertTbl, string portfolioCode, string stockCode, string strategy, AppTypes.TimeScale timeScale, TradePointInfo info, DateTime onTime, string msg) { databases.baseDS.tradeAlertRow row = tradeAlertTbl.NewtradeAlertRow(); databases.AppLibs.InitData(row); row.onTime = onTime; row.portfolio = portfolioCode; row.stockCode = stockCode; row.timeScale = timeScale.Code; row.strategy = strategy; row.status = (byte)AppTypes.CommonStatus.New; row.tradeAction = (byte)info.TradeAction; row.subject = info.TradeAction.ToString(); row.msg = msg; tradeAlertTbl.AddtradeAlertRow(row); }
public virtual void SetEditData(databases.baseDS.tradeAlertRow row) { transCodeEd.Text = ""; databases.tmpDS.stockCodeRow stockCodeRow = DataAccess.Libs.myStockCodeTbl.FindBycode(row.stockCode); if (stockCodeRow != null) { databases.baseDS.stockExchangeRow stockExchangeRow = DataAccess.Libs.myStockExchangeTbl.FindBycode(stockCodeRow.stockExchange); if (stockExchangeRow != null) { feePercEd.Value = stockExchangeRow.tranFeePerc; } } codeEd.Text = row.stockCode; onTimeEd.myDateTime = row.onTime; portfolioCb.myValue = row.portfolio; qtyEd.Value = 0; subTotalEd.Value = 0; feeAmtEd.Value = 0; totalAmtEd.Value = 0; transTypeCb.myValue = (AppTypes.TradeActions)row.tradeAction; statusCb.myValue = AppTypes.CommonStatus.New; CalculatePriceAndFeePercentage(); codeEd.Focus(); }
private void recoverBtn_Click(object sender, EventArgs e) { try { this.ShowMessage(""); if (this.myCurrentRow == null) { this.ShowMessage(Languages.Libs.GetString("noData")); return; } databases.baseDS.tradeAlertRow row = this.myCurrentRow; if (row.status == (byte)AppTypes.CommonStatus.New) { return; } row.status = (byte)AppTypes.CommonStatus.New; DataAccess.Libs.UpdateData(row); this.ShowMessage(Languages.Libs.GetString("alertRecovered")); } catch (Exception er) { this.ShowError(er); } }