private void checkDictionarySource(DataTable dtCase) { DataTable dtSource = dbF.getDataByTable("frmsource", "visiofile='" + vsdFile + "'"); foreach (DataRow drSource in dtSource.Rows) { checkSource(drSource, dtCase); } }
private void checkSource(DataRow drSource, DataTable dtCase) { string streamName = drSource["streamname"].ToString(); string sourceType = drSource["sourcetype"].ToString(); DataTable dtDic_Source = db.getDataByTable("dictionarysource", "categoryvalue='" + sourceType + "'"); DataRow dr = dtDic_Source.Rows[0]; foreach (DataRow drCase in dtCase.Rows) { string caseid = drCase["case_id"].ToString(); string caseName = drCase["casename"].ToString(); string sql = "update frmcase_feed set flowstop=0 where streamname='" + streamName + "' and case_id=" + caseid; if (dr[caseName].ToString() == "0") { sql = "update frmcase_feed set flowstop=1 where streamname='" + streamName + "' and case_id=" + caseid; } dbF.saveDataBySQL(sql); } }
private void Window_Loaded_1(object sender, RoutedEventArgs e) { DataTable dtSource = db.getDataByTable("dictionarysource", ""); gridSource.ItemsSource = dtSource.DefaultView; DataTable dtSink = db.getDataByTable("dictionarysink", ""); gridSink.ItemsSource = dtSink.DefaultView; DataTable dtCondenser = db.getDataByTable("dictionarycondenser", ""); gridCondenser.ItemsSource = dtCondenser.DefaultView; DataTable dtReboiler = db.getDataByTable("dictionaryreboiler", ""); gridReboiler.ItemsSource = dtReboiler.DefaultView; }