using System; using System.Collections.Generic; using System.Text; using System.Data; using DBFactory; namespace wcfControlMonitorClient { /// /// Creator:Richard.liu /// /// 命令开关等全局变量的定义 /// public static class CStaticClass { public static WcfControlMonitorLib.SControlMonitor WcfControl = new WcfControlMonitorLib.SControlMonitor(); static int _outlightflagnum1; /// /// 发送灯1出库灯标志次数 add by lyj 20171106 /// public static int OutLightFlagNum1 { get { return CStaticClass._outlightflagnum1; } set { CStaticClass._outlightflagnum1 = value; } } static int _intlightflagnum1; /// /// 发送灯1入库灯标志次数 add by lyj 20171106 /// public static int IntLightFlagNum1 { get { return CStaticClass._intlightflagnum1; } set { CStaticClass._intlightflagnum1 = value; } } static int _outlightflagnum2; /// /// 发送灯2出库灯标志次数 add by lyj 20171106 /// public static int OutLightFlagNum2 { get { return CStaticClass._outlightflagnum2; } set { CStaticClass._outlightflagnum2 = value; } } static int _intlightflagnum2; /// /// 发送灯2入库灯标志次数 add by lyj 20171106 /// public static int IntLightFlagNum2 { get { return CStaticClass._intlightflagnum2; } set { CStaticClass._intlightflagnum2 = value; } } static int _outlightflagnum3; /// /// 发送灯3出库灯标志次数 add by lyj 20171106 /// public static int OutLightFlagNum3 { get { return CStaticClass._outlightflagnum3; } set { CStaticClass._outlightflagnum3 = value; } } static int _intlightflagnum3; /// /// 发送灯3入库灯标志次数 add by lyj 20171106 /// public static int IntLightFlagNum3 { get { return CStaticClass._intlightflagnum3; } set { CStaticClass._intlightflagnum3 = value; } } static int _outlightflagnum4; /// /// 发送灯4出库灯标志次数 add by lyj 20171106 /// public static int OutLightFlagNum4 { get { return CStaticClass._outlightflagnum4; } set { CStaticClass._outlightflagnum4 = value; } } static int _intlightflagnum4; /// /// 发送灯4入库灯标志次数 add by lyj 20171106 /// public static int IntLightFlagNum4 { get { return CStaticClass._intlightflagnum4; } set { CStaticClass._intlightflagnum4 = value; } } static int _outlightflagnum5; /// /// 发送灯5出库灯标志次数 add by lyj 20171106 /// public static int OutLightFlagNum5 { get { return CStaticClass._outlightflagnum5; } set { CStaticClass._outlightflagnum5 = value; } } static int _intlightflagnum5; /// /// 发送灯5入库灯标志次数 add by lyj 20171106 /// public static int IntLightFlagNum5 { get { return CStaticClass._intlightflagnum5; } set { CStaticClass._intlightflagnum5 = value; } } #region add by lyj20190719 static int _outlightflagnum7; /// /// 发送灯7出库灯标志次数 add by lyj 20171106 /// public static int OutLightFlagNum7 { get { return CStaticClass._outlightflagnum7; } set { CStaticClass._outlightflagnum7 = value; } } static int _intlightflagnum7; /// /// 发送灯7入库灯标志次数 add by lyj 20171106 /// public static int IntLightFlagNum7 { get { return CStaticClass._intlightflagnum7; } set { CStaticClass._intlightflagnum7 = value; } } static int _outlightflagnum8; /// /// 发送灯8出库灯标志次数 add by lyj 20171106 /// public static int OutLightFlagNum8 { get { return CStaticClass._outlightflagnum8; } set { CStaticClass._outlightflagnum8 = value; } } static int _intlightflagnum8; /// /// 发送灯8入库灯标志次数 add by lyj 20171106 /// public static int IntLightFlagNum8 { get { return CStaticClass._intlightflagnum8; } set { CStaticClass._intlightflagnum8 = value; } } static int _outlightflagnum9; /// /// 发送灯9出库灯标志次数 add by lyj 20171106 /// public static int OutLightFlagNum9 { get { return CStaticClass._outlightflagnum9; } set { CStaticClass._outlightflagnum9 = value; } } static int _intlightflagnum9; /// /// 发送灯9入库灯标志次数 add by lyj 20171106 /// public static int IntLightFlagNum9 { get { return CStaticClass._intlightflagnum9; } set { CStaticClass._intlightflagnum9 = value; } } #endregion static string _userID; /// /// 用户编号 /// public static string UserID { get { return CStaticClass._userID; } set { CStaticClass._userID = value; } } public static string ClientID { get; set; } public static bool IfRemind { get; set; } public static DBOperator dbo = CommonClassLib.AppSettings.dbo; //20130510 static string _manstatus = " F_Status<>-1 ";//默认,显示调度任务全部队列 static string _monstatus = " F_Status<>-1 ";//默认,显示设备指令全部队列 /// /// 显示调度任务全部队列" F_Status<>-1 ";等待队列" F_Status=0 ";运行队列" F_Status=1 "; /// public static string Manstatus { get { return CStaticClass._manstatus; } set { CStaticClass._manstatus = value; } } /// /// 显示设备指令全部队列" F_Status<>-1 ";等待队列" F_Status=0 ";运行队列" F_Status=1 "; /// public static string Monstatus { get { return CStaticClass._monstatus; } set { CStaticClass._monstatus = value; } } static string _SystemName = "【沈阳新松自动化立体仓库监控调度系统服务端】"; public static string SystemName { get { return CStaticClass._SystemName; } set { CStaticClass._SystemName = value; } } ///// ///// 命令开关是否打开 ///// //public static bool Order{get;set;} ///// ///// 是否获取调度任务 ///// //public static bool ObtainManageTask { get; set; } public static int GetDeviceKindIdx(int devIdx) { try { string strSql = "SELECT F_DeviceIndex, F_DeviceKindIndex FROM T_Base_Device WHERE F_DeviceIndex=" + devIdx; DataSet ds = dbo.ExceSQL(strSql); DataView dv = ds.Tables[0].DefaultView; if (dv.Count > 0) { return Convert.ToInt32(dv[0]["F_DeviceKindIndex"]); } else return -1; } catch (Exception ex) { throw ex; } } public static int GetLaneWay(int StackDeviceIndex) { //20101124 StringBuilder sql = new StringBuilder(); sql.Append("SELECT F_LaneDeviceIndex FROM T_Base_LaneInfo WHERE (F_StackIndex = ").Append(StackDeviceIndex).Append(")"); DataView dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; if (dv.Count > 0) { return Convert.ToInt32(dv[0][0]); } else { return -1; } } public static int GetStackIndexFromLaneInfo(int LaneIndex) { //20101124 StringBuilder sql = new StringBuilder(); sql.Append("SELECT F_StackIndex FROM T_Base_LaneInfo WHERE (F_LaneDeviceIndex = ").Append(LaneIndex).Append(")"); DataView dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; if (dv.Count > 0) { return Convert.ToInt32(dv[0][0]); } else { return -1; } } /// /// 获得当前连接数据库的名字 /// /// /// public static string GetDBName() { string strRetVal = string.Empty; try { //DBOperator dbo = new DBOperator(); string temp = dbo.GetValue("ConnString"); if (temp != string.Empty) { int i = temp.IndexOf("database"); temp = temp.Substring(i); i = temp.IndexOf(";"); temp = temp.Substring(0, i); strRetVal = temp.Substring((temp.IndexOf("=") + 1)).Trim(); } return strRetVal; } catch (Exception) { return strRetVal; } } } }