protected override void Update(string conditionSql, int unionType, string comboValue) { string sql = SqlForComHistory.GetListSql(conditionSql, unionType, comboValue); System.Data.DataTable table = m_db.getDataTable(sql); comHistory.DataContext = table; }
public ComHistory() { InitializeComponent(); string localeCode = CommonUtil.GetAppLocaleCode(); // コンボボックスの初期化 InitCombo(SqlForComHistory.SelectNameSql(localeCode), this.comboEquip); // 検索条件を初期化 InitCondition(); }
/// <summary> /// 検索条件SQLを取得 /// </summary> /// <returns></returns> public override string GetConditionSql() { List <string> values = new List <string>(); // 検索期間 if (this.checkStartEnd.IsChecked == true) { if (this.dateStart.SelectedDate != null) { string sql = SqlForComHistory.GetStartSql((DateTime)this.dateStart.SelectedDate); values.Add(sql); } if (this.dateEnd.SelectedDate != null) { string sql = SqlForComHistory.GetEndSql((DateTime)this.dateEnd.SelectedDate); values.Add(sql); } } // 機器名称 if (this.checkEquip.IsChecked == true) { string sql = SqlForComHistory.GetNameSql((string)this.comboEquip.SelectedValue); values.Add(sql); } // 送受信 if (this.radioSend.IsChecked == true) { string sql = SqlForComHistory.GetDirSql(1); values.Add(sql); } if (this.radioReceive.IsChecked == true) { string sql = SqlForComHistory.GetDirSql(2); values.Add(sql); } return(string.Join(" and ", values)); }