private Event ToEvent(DataRow row) { Event _event = new Event(); _event.ID = (string)row["序号"]; _event.AlarmTime = (DateTime)OleDbHelper.FromDbValue(row["报警时间"]); _event.UserName = (string)row["用户名称"]; _event.Address = (string)OleDbHelper.FromDbValue(row["用户地址"]); _event.Account = (string)OleDbHelper.FromDbValue(row["主机编号"]); _event.UserType = (string)OleDbHelper.FromDbValue(row["用户类型"]); _event.PanelType = (string)OleDbHelper.FromDbValue(row["主机类型"]); _event.PartitionNumber = (string)OleDbHelper.FromDbValue(row["分区编号"]); _event.ZoneNumber = (string)OleDbHelper.FromDbValue(row["防区编号"]); _event.ZoneType = (string)OleDbHelper.FromDbValue(row["防区类型"]); _event.DetectorType = (string)OleDbHelper.FromDbValue(row["探测器型号"]); _event.InstallSide = (string)OleDbHelper.FromDbValue(row["安装位置"]); _event.EventTpye = (string)OleDbHelper.FromDbValue(row["事件类型"]); _event.EventInfomation = (string)OleDbHelper.FromDbValue(row["辅助信息"]); _event.Classify = (string)OleDbHelper.FromDbValue(row["归类处理"]); _event.DataCode = (string)OleDbHelper.FromDbValue(row["通讯代码"]); _event.MarkEvent = (string)OleDbHelper.FromDbValue(row["处理内容"]); _event.Operator = (string)OleDbHelper.FromDbValue(row["值班员姓名"]); _event.EventFontColor = (string)OleDbHelper.FromDbValue(row["事件字体颜色"]); _event.EventBackgroundColor = (string)OleDbHelper.FromDbValue(row["事件背景颜色"]); _event.TellNum = (string)OleDbHelper.FromDbValue(row["来电号码"]); _event.Side = (string)OleDbHelper.FromDbValue(row["站点编号"]); _event.TowLeverSide = (string)OleDbHelper.FromDbValue(row["二级站点"]); return(_event); }
private SystemManager ToSystemManager(DataRow row) { SystemManager sm = new SystemManager(); sm.UserName = (string)OleDbHelper.FromDbValue(row["值班员代码"]); sm.Password = (string)OleDbHelper.FromDbValue(row["值班员口令"]); sm.RealName = (string)OleDbHelper.FromDbValue(row["值班员姓名"]); return(sm); }
private Group[] ToGroup(DataRow[] rows) { Group[] groups = new Group[rows.Length]; for (int i = 0; i < rows.Length; i++) { groups[i].ID = (int)OleDbHelper.FromDbValue(rows[i]["ID"]); groups[i].MainGroup = (string)OleDbHelper.FromDbValue(rows[i]["组"]); groups[i].SubGroup = (string)OleDbHelper.FromDbValue(rows[i]["子组"]); } return(groups); }
private User ToUserInfomation(DataRow row) { User user = new User(); user.Account = (string)OleDbHelper.FromDbValue(row["主机编号"]); user.UserName = (string)row["用户名称"]; user.Address = (string)OleDbHelper.FromDbValue(row["用户地址"]); user.PanelName = (string)OleDbHelper.FromDbValue(row["主机类型"]); user.UserType = (string)OleDbHelper.FromDbValue(row["用户类型"]); return(user); }
private Contacts ToContacts(DataRow row) { Contacts contacts = new Contacts(); contacts.ID = (int)row["序号"]; contacts.Account = (string)OleDbHelper.FromDbValue(row["主机编号"]); contacts.ContactsID = (string)OleDbHelper.FromDbValue(row["联系人序号"]); contacts.ContactsName = (string)OleDbHelper.FromDbValue(row["姓名"]); contacts.ContactsJob = (string)OleDbHelper.FromDbValue(row["职务"]); contacts.ContactsPhoneNumber = (string)OleDbHelper.FromDbValue(row["电话"]); return(contacts); }
private CID ToCID(DataRow row) { CID cid = new CID(); cid.ID = (int)row["序号"]; cid.CIDCode = (string)row["CID码"]; cid.IsNewEvent = (bool)OleDbHelper.FromDbValue(row["是否是新事件"]); cid.EventInformation = (string)OleDbHelper.FromDbValue(row["辅助信息"]); cid.EventTpye = (string)OleDbHelper.FromDbValue(row["事件类型"]); cid.StrategiesName = (string)OleDbHelper.FromDbValue(row["处理策略"]); cid.IsSendMessage = (bool)OleDbHelper.FromDbValue(row["是否发送短信"]); return(cid); }
/// <summary> /// 获取所有用户资料的主机编号 /// </summary> /// <returns></returns> public String[] GetaccountArray() { DataTable table = OleDbHelper.ExecuteDataTable("Main", "select " + " 主机编号 " + " from [用户资料]"); String[] accountArray = new String[table.Rows.Count]; for (int i = 0; i < table.Rows.Count; i++) { DataRow row = table.Rows[i]; accountArray[i] = (string)OleDbHelper.FromDbValue(row["主机编号"]); } return(accountArray); }
private Strategies ToStrategies(DataRow row) { Strategies strategies = new Strategies(); strategies.ID = (int)row["序号"]; strategies.StrategiesID = (string)OleDbHelper.FromDbValue(row["策略编号"]); strategies.StrategiesName = (string)OleDbHelper.FromDbValue(row["策略名称"]); strategies.EventFontColor = (string)OleDbHelper.FromDbValue(row["事件字体颜色"]); strategies.EventBackgroundColor = (string)OleDbHelper.FromDbValue(row["事件背景颜色"]); strategies.NoticeType = (string)OleDbHelper.FromDbValue(row["提示类型"]); strategies.IsPrint = (bool)OleDbHelper.FromDbValue(row["自动打印"]); strategies.SoundFile = (string)OleDbHelper.FromDbValue(row["报警声文件"]); return(strategies); }
private User ToUserInfomationByAccount(DataRow row) { User user = new User(); user.Account = (string)OleDbHelper.FromDbValue(row["主机编号"]); user.UserName = (string)row["用户名称"]; user.Address = (string)OleDbHelper.FromDbValue(row["用户地址"]); user.PanelName = (string)OleDbHelper.FromDbValue(row["主机类型"]); user.UserType = (string)OleDbHelper.FromDbValue(row["用户类型"]); user.Protocol = (string)OleDbHelper.FromDbValue(row["通讯格式"]); user.InstallDate = (DateTime)OleDbHelper.FromDbValue(row["安装日期"]); user.InstallCompany = (string)OleDbHelper.FromDbValue(row["安装单位"]); user.Installer = (string)OleDbHelper.FromDbValue(row["安装人员"]); user.Deadline = (DateTime)OleDbHelper.FromDbValue(row["合同期限"]); user.Charge = (string)OleDbHelper.FromDbValue(row["收费标准"]); return(user); }
private Zone ToZone(DataRow row) { Zone zone = new Zone(); zone.ID = (int)row["序号"]; zone.Account = (string)OleDbHelper.FromDbValue(row["主机编号"]); zone.ZoneNum = (int)OleDbHelper.FromDbValue(row["防区编号"]); zone.PartitionNum = (string)OleDbHelper.FromDbValue(row["分区编号"]); zone.ZoneType = (string)OleDbHelper.FromDbValue(row["防区类型"]); zone.DetectorType = (string)OleDbHelper.FromDbValue(row["探测器型号"]); zone.InstallSide = (string)OleDbHelper.FromDbValue(row["安装位置"]); zone.ZoneStatus = (string)OleDbHelper.FromDbValue(row["防区状态"]); zone.Abscissa = (int)OleDbHelper.FromDbValue(row["横坐标"]); zone.Ordinate = (int)OleDbHelper.FromDbValue(row["纵坐标"]); zone.StatusRefreshTime = (DateTime)OleDbHelper.FromDbValue(row["防区状态更新时间"]); zone.EedEventTime = (DateTime)OleDbHelper.FromDbValue(row["最近一次上报时间"]); zone.IsAlarm = (bool)OleDbHelper.FromDbValue(row["是否报警"]); return(zone); }
private Receiver ToReceiver(DataRow row) { Receiver receiver = new Receiver(); receiver.ID = (int)OleDbHelper.FromDbValue(row["序号"]); receiver.ReceiverName = (string)OleDbHelper.FromDbValue(row["接警机名"]); receiver.SerialPortNum = (string)OleDbHelper.FromDbValue(row["串口序号"]); receiver.ReceiverType = (string)OleDbHelper.FromDbValue(row["接警机类型"]); receiver.Version = (string)OleDbHelper.FromDbValue(row["版本号"]); receiver.BaudRate = (int)OleDbHelper.FromDbValue(row["波特率"]); receiver.DataBits = (int)OleDbHelper.FromDbValue(row["数据位"]); receiver.StopBits = (int)OleDbHelper.FromDbValue(row["停止位"]); receiver.FlowControl = (string)OleDbHelper.FromDbValue(row["流控制"]); receiver.Parity = (string)OleDbHelper.FromDbValue(row["校验"]); receiver.EndCode = (int)OleDbHelper.FromDbValue(row["结束代码"]); receiver.ACK = (int)OleDbHelper.FromDbValue(row["握手代码"]); receiver.CheckTimer = (int)OleDbHelper.FromDbValue(row["连接检查间隔"]); receiver.IsCheck = (bool)OleDbHelper.FromDbValue(row["是否检查连接"]); receiver.Mark = (string)OleDbHelper.FromDbValue(row["备注"]); return(receiver); }
private User ToUser(DataRow row) { User user = new User(); user.ID = (int)row["序号"]; user.Account = (string)OleDbHelper.FromDbValue(row["主机编号"]); user.UserName = (string)OleDbHelper.FromDbValue(row["用户名称"]); user.Address = (string)OleDbHelper.FromDbValue(row["用户地址"]); user.InstallCompany = (string)OleDbHelper.FromDbValue(row["安装单位"]); user.InstallDate = (DateTime)OleDbHelper.FromDbValue(row["安装日期"]); user.Installer = (string)OleDbHelper.FromDbValue(row["安装人员"]); user.LastTime = (DateTime)OleDbHelper.FromDbValue(row["最后一条事件时间"]); user.PanelName = (string)OleDbHelper.FromDbValue(row["主机类型"]); user.PanelStatus = (string)OleDbHelper.FromDbValue(row["主机状态"]); user.Protocol = (string)OleDbHelper.FromDbValue(row["通讯格式"]); user.Mark = (string)OleDbHelper.FromDbValue(row["备注说明"]); user.Trouble = (string)OleDbHelper.FromDbValue(row["故障状态"]); user.UserType = (string)OleDbHelper.FromDbValue(row["用户类型"]); user.Deadline = (DateTime)OleDbHelper.FromDbValue(row["合同期限"]); user.Charge = (string)OleDbHelper.FromDbValue(row["收费标准"]); return(user); }