/// <summary> /// 根据车牌号判断当前车的订单状态 /// </summary> /// <param name="szTrunkNo"></param> /// <returns></returns> public static int GetOrderStateByTrunkNo(string szTrunkNo) { int state = -1; try { string sqlStr = "Select F_OrderStatus From T_Order Where F_TrunkNo = @F_TrunkNo; "; Dictionary <string, object> parm = new Dictionary <string, object>(); parm.Add("F_TrunkNo", szTrunkNo); IDatabaseBridge idb = DatabaseFactory.Create(); DataTable dt = idb.GetDataTable(sqlStr, parm); if (dt == null) { _errorText = idb.LastException.Message; return(-1); } if (dt.Rows.Count == 0) { return(-1); } state = CommonFunction.GetIntValue(dt.Rows[0]["F_OrderStatus"].ToString()); return(state); } catch (Exception ex) { _errorText = ex.Message; return(state); } }
/// <summary> /// 获取订单状态为大于新油单并未过皮重的车辆 /// </summary> /// <returns></returns> public static DataTable GetNoWeightbridgeFromState() { try { string strSql = "Select F_TrunkNo,F_DriverName,F_Company,F_OrderStatus,F_CallTime From T_Order Where F_OrderStatus > 0 and F_OrderStatus < 6;"; IDatabaseBridge idb = DatabaseFactory.Create(); DataTable dt = idb.GetDataTable(strSql); if (dt == null) { return(null); } if (dt.Rows.Count == 0) { _errorText = "没有找到状态大于0并且小于6的信息"; return(null); } return(dt); } catch (Exception ex) { _errorText = ex.Message; return(null); } }
public static T_TrunkNoRecognitionRecord GetRecordFromImageIndex(string szImageIndex) { try { string strSql = "Select * From T_TrunkNoRecognitionRecord Where F_ImageIndex = @F_ImageIndex;"; Dictionary <string, object> parm = new Dictionary <string, object>(); parm.Add("F_ImageIndex", szImageIndex); IDatabaseBridge idb = DatabaseFactory.Create(); DataTable dt = idb.GetDataTable(strSql, parm); if (dt == null) { return(null); } if (dt.Rows.Count == 0) { _errorText = "信息不存在"; return(null); } T_TrunkNoRecognitionRecord record = GetRecordFromDR(dt.Rows[0]); return(record); } catch (Exception ex) { _errorText = ex.Message; return(null); } }
/// <summary> /// 查询订单状态 /// </summary> /// <param name="szState"></param> /// <returns></returns> public static string GetStateNameForOrder(int szState) { string state = ""; try { string strSql = "Select F_Name From T_OrderStatus Where F_ID =@F_ID; "; Dictionary <string, object> param = new Dictionary <string, object>(); param.Add("F_ID", szState); IDatabaseBridge idb = DatabaseFactory.Create(); DataTable dt = idb.GetDataTable(strSql, param); if (dt == null) { _errorText = idb.LastException.Message; return(state); } if (dt.Rows.Count == 0) { state = "没有该车牌号状态"; return(state); } state = dt.Rows[0]["F_Name"].ToString(); return(state); } catch (Exception ex) { _errorText = ex.Message; return(state); } }
public static bool VerifyLicense(string szID, string szKey) { if (String.IsNullOrEmpty(szID)) { return(false); } bool bRet = false; try { string szSQL = String.Format("Select * From T_Aauthorization Where F_ID = '{0}'", szID); IDatabaseBridge idb = DatabaseFactory.Create(); DataTable dt = idb.GetDataTable(szSQL); foreach (DataRow dr in dt.Rows) { string szDBKey = dr["F_Value"].ToString(); if (szDBKey.CompareTo(szKey) == 0) { bRet = true; } break; } } catch (Exception ex) { _errorText = ex.Message; } return(bRet); }
public static bool InsertData(T_TrunkNoRecognitionRecord record) { bool iRet = false; try { string strSql = "Insert Into T_TrunkNoRecognitionRecord(F_TrunkNo, F_EnterTime, F_State, F_ImageIndex) "; strSql += "Values(@F_TrunkNo, @F_EnterTime, @F_State, @F_ImmageIndex); "; Dictionary <string, object> parms = new Dictionary <string, object>(); parms.Add("F_TrunkNo", record.F_TrunkNo); parms.Add("F_EnterTime", record.F_EnterTime); parms.Add("F_State", record.F_State); parms.Add("F_ImageIndex", record.F_ImageIndex); IDatabaseBridge idb = DatabaseFactory.Create(); if (idb.ExecuteCommand(strSql.ToString(), parms) == -1) { _errorText = idb.LastException.ToString(); return(false); } return(iRet); } catch (Exception ex) { _errorText = ex.Message; return(iRet); } }
public static bool UpdateRecord(T_TrunkNoRecognitionRecord record) { try { string strSql = "Update T_TrunkNoRecognitionRecord Set F_TrunkNo =@F_TrunkNo,F_EnterTime =@F_EnterTime Where F_ImageIndex = F_ImageIndex;"; Dictionary <string, object> parms = new Dictionary <string, object>(); parms.Add("F_TrunkNo", record.F_TrunkNo); parms.Add("F_EnterTime", record.F_EnterTime); parms.Add("F_State", record.F_State); parms.Add("F_ImageIndex", record.F_ImageIndex); IDatabaseBridge idb = DatabaseFactory.Create(); if (idb.ExecuteCommand(strSql.ToString(), parms) == -1) { _errorText = idb.LastException.ToString(); return(false); } return(true); } catch (Exception ex) { _errorText = ex.Message; return(false); } }
public static bool InsertLicense(string szID, string szKey) { if (String.IsNullOrEmpty(szID)) { return(false); } bool bRet = false; try { string szSQL = String.Format("Insert Into T_Aauthorization (F_ID, F_Value) Values ('{0}', '{1}')", szID, szKey); IDatabaseBridge idb = DatabaseFactory.Create(); bRet = (idb.ExecuteCommand(szSQL) != -1); if (!bRet) { _errorText = idb.LastException.ToString(); } } catch (Exception ex) { _errorText = ex.Message; } return(bRet); }
public static bool UpdateLicense(string szID, string strKey) { if (String.IsNullOrEmpty(szID)) { return(false); } bool bRet = false; try { string szSQL = String.Format("Update T_Aauthorization Set F_Value = '{0}' Where F_ID = '{1}'", strKey, szID); IDatabaseBridge idb = DatabaseFactory.Create(); bRet = (idb.ExecuteCommand(szSQL) != -1); if (!bRet) { _errorText = idb.LastException.ToString(); } } catch (Exception ex) { _errorText = ex.Message; } return(bRet); }
public UserControlRadarSoftCubeCreator() { InitializeComponent(); _dbBridge = new OdbcDatabaseBridge(); DataSetDescriptorBuilder.FilterProvider = new PrimitiveExternalFilterProvider(); }
/// <summary> /// Returns a <see cref="DataSet"/> built based on the specified <see cref="DataSetDescriptor"/> /// </summary> /// <param name="dataSetDescriptor">The <see cref="DataSetDescriptor"/> to use</param> /// <param name="databaseBridge">The <see cref="IDatabaseBridge"/> to use</param> /// <returns>A <see cref="DataSet"/> built based on the specified <see cref="DataSetDescriptor"/></returns> public static DataSet BuilDataSet(DataSetDescriptor dataSetDescriptor, IDatabaseBridge databaseBridge) { if (dataSetDescriptor == null) { throw new ArgumentNullException(nameof(dataSetDescriptor)); } if (databaseBridge == null) { throw new ArgumentNullException(nameof(databaseBridge)); } return(new DataSetBuilder(dataSetDescriptor, databaseBridge).Build()); }
/// <summary> /// Initializes a new instance of the <see cref="DataSetBuilder"/> class /// </summary> /// <param name="dataSetDescriptor">The data set descriptor</param> /// <param name="databaseBridge">The database bridge</param> private DataSetBuilder(DataSetDescriptor dataSetDescriptor, IDatabaseBridge databaseBridge) { if (dataSetDescriptor == null) { throw new ArgumentNullException(nameof(dataSetDescriptor)); } if (databaseBridge == null) { throw new ArgumentNullException(nameof(databaseBridge)); } _dataSetDescriptor = dataSetDescriptor; _databaseBridge = databaseBridge; }
/// <summary> /// Initializes a new instance of the <see cref="MainViewModel"/> class /// </summary> /// <param name="dbBridge">The database bridge</param> /// <param name="externalFilterProvider">The external filter provider</param> public MainViewModel(IDatabaseBridge dbBridge, IExternalFilterProvider externalFilterProvider) { if (dbBridge == null) { throw new ArgumentNullException(nameof(dbBridge)); } if (externalFilterProvider == null) { throw new ArgumentNullException(nameof(externalFilterProvider)); } _dbBridge = dbBridge; DataSetDescriptorBuilder.FilterProvider = externalFilterProvider; ViewLoadVm = new ButtonViewModel { Command = new AsyncRelayCommand( o => DoLoadView(), o => !IsBusy, o => IsBusy = true, o => IsBusy = false) }; SaveCubeVm = new ButtonViewModel { Command = new AsyncRelayCommand( o => DoSaveCube((TOLAPAnalysis)o), o => !IsBusy && _isCubeLoaded && _currentCubeConfig != null, o => IsBusy = true, o => IsBusy = false) }; SaveCubeAsVm = new ButtonViewModel { Command = new AsyncRelayCommand( o => DoSaveCubeAs((TOLAPAnalysis)o), o => !IsBusy && _isCubeLoaded && _currentDataSetConfig != null, o => IsBusy = true, o => IsBusy = false) }; DeleteCubeVm = new ButtonViewModel { Command = new AsyncRelayCommand( o => DoDeleteCube((TOLAPAnalysis)o), o => !IsBusy && _isCubeLoaded && _currentCubeConfig != null, o => IsBusy = true, o => IsBusy = false) }; }
public static bool HardwareIDExist(string szID) { bool bRet = false; try { string szSQL = String.Format("Select * From T_Aauthorization Where F_ID = '{0}'", szID); IDatabaseBridge idb = DatabaseFactory.Create(); DataTable dt = idb.GetDataTable(szSQL); bRet = (dt.Rows.Count > 0); } catch (Exception ex) { _errorText = ex.Message; } return(bRet); }
public static DataTable GetAllDataTable(string szFilter) { string strSql = "Select * From T_TrunkNoRecognitionRecord "; strSql += szFilter; IDatabaseBridge idb = DatabaseFactory.Create(); DataTable dt = idb.GetDataTable(strSql); if (dt == null) { return(null); } if (dt.Rows.Count == 0) { return(null); } return(dt); }
public FlashcardServices() { this.databaseBridge = new DatabaseBridge(); }