public void Insert(Contacts contacts) { OleDbHelper.ExecuteNonQuery("Main", @"INSERT INTO [联系人资料] (主机编号,联系人序号,姓名,职务,电话) VALUES (@Account,@ContactsID,@ContactsName,@ContactsJob,@ContactsPhoneNumber)", new OleDbParameter("@Account", OleDbHelper.ToDbValue(contacts.Account)), new OleDbParameter("@ContactsID", OleDbHelper.ToDbValue(contacts.ContactsID)), new OleDbParameter("@ContactsName", OleDbHelper.ToDbValue(contacts.ContactsName)), new OleDbParameter("@ContactsJob", OleDbHelper.ToDbValue(contacts.ContactsJob)), new OleDbParameter("@ContactsPhoneNumber", OleDbHelper.ToDbValue(contacts.ContactsPhoneNumber))); }
public void Insert(string tableName, CID cid) { OleDbHelper.ExecuteNonQuery("Main", @"INSERT INTO " + tableName + @" (CID码,是否是新事件,事件类型,辅助信息,处理策略,是否发送短信) VALUES (@CIDCode,@IsNewEvent,@EventTpye,@EventInformation,@StrategiesName,@IsSendMessage)", new OleDbParameter("@CIDCode", OleDbHelper.ToDbValue(cid.CIDCode)), new OleDbParameter("@IsNewEvent", OleDbHelper.ToDbValue(cid.IsNewEvent)), new OleDbParameter("@EventTpye", OleDbHelper.ToDbValue(cid.EventTpye)), new OleDbParameter("@EventInformation", OleDbHelper.ToDbValue(cid.EventInformation)), new OleDbParameter("@StrategiesName", OleDbHelper.ToDbValue(cid.StrategiesName)), new OleDbParameter("@IsSendMessage", OleDbHelper.ToDbValue(cid.IsSendMessage))); }
public void Insert(Strategies strategies) { OleDbHelper.ExecuteNonQuery("Main", @"INSERT INTO 处理策略 (策略编号,策略名称,事件字体颜色,事件背景颜色,提示类型,自动打印,报警声文件) VALUES (@StrategiesID,@StrategiesName,@EventFontColor,@EventBackgroundColor,@NoticeType,@IsPrint,@SoundFile)", new OleDbParameter("@StrategiesID", OleDbHelper.ToDbValue(strategies.StrategiesID)), new OleDbParameter("@StrategiesName", OleDbHelper.ToDbValue(strategies.StrategiesName)), new OleDbParameter("@EventFontColor", OleDbHelper.ToDbValue(strategies.EventFontColor)), new OleDbParameter("@EventBackgroundColor", OleDbHelper.ToDbValue(strategies.EventBackgroundColor)), new OleDbParameter("@NoticeType", OleDbHelper.ToDbValue(strategies.NoticeType)), new OleDbParameter("@IsPrint", OleDbHelper.ToDbValue(strategies.IsPrint)), new OleDbParameter("@SoundFile", OleDbHelper.ToDbValue(strategies.SoundFile))); }
public void Update(Contacts contacts) { OleDbHelper.ExecuteNonQuery("Main", @"UPDATE [联系人资料] SET [主机编号]=@Account ,[联系人序号]=@ContactsID ,[姓名]=@ContactsName ,[职务]=@ContactsJob ,[电话]=@PartitionNum WHERE [序号]=@ID", new OleDbParameter("@Account", OleDbHelper.ToDbValue(contacts.Account)), new OleDbParameter("@ContactsID", OleDbHelper.ToDbValue(contacts.ContactsID)), new OleDbParameter("@ContactsName", OleDbHelper.ToDbValue(contacts.ContactsName)), new OleDbParameter("@ContactsJob", OleDbHelper.ToDbValue(contacts.ContactsJob)), new OleDbParameter("@ContactsPhoneNumber", OleDbHelper.ToDbValue(contacts.ContactsPhoneNumber)), new OleDbParameter("@ID", OleDbHelper.ToDbValue(contacts.ID))); }
public void Update(string tableName, CID cid) { OleDbHelper.ExecuteNonQuery("Main", @"UPDATE " + tableName + @" SET [CID码]=@CIDCode ,[是否是新事件]=@IsNewEvent ,[事件类型]=@EventTpye ,[辅助信息]=@EventInformation ,[处理策略]=@StrategiesName ,[是否发送短信]=@IsSendMessage WHERE [序号]=@ID", new OleDbParameter("@CIDCode", OleDbHelper.ToDbValue(cid.CIDCode)), new OleDbParameter("@IsNewEvent", OleDbHelper.ToDbValue(cid.IsNewEvent)), new OleDbParameter("@EventTpye", OleDbHelper.ToDbValue(cid.EventTpye)), new OleDbParameter("@EventInformation", OleDbHelper.ToDbValue(cid.EventInformation)), new OleDbParameter("@StrategiesName", OleDbHelper.ToDbValue(cid.StrategiesName)), new OleDbParameter("@IsSendMessage", OleDbHelper.ToDbValue(cid.IsSendMessage)), new OleDbParameter("@ID", OleDbHelper.ToDbValue(cid.ID))); }
public void Insert(Zone zone) { OleDbHelper.ExecuteNonQuery("Main", @"INSERT INTO 防区资料 ([主机编号],[防区编号],[分区编号],[防区类型],[探测器型号],[安装位置],[防区状态],[横坐标],[纵坐标],[防区状态更新时间],[最近一次上报时间],[是否报警]) VALUES (@Account,@ZoneNum,@PartitionNum,@ZoneType,@DetectorType,@InstallSide,@ZoneStatus,@Abscissa,@Ordinate,@StatusRefreshTime,@EedEventTime,@IsAlarm)", new OleDbParameter("@Account", OleDbHelper.ToDbValue(zone.Account)), new OleDbParameter("@ZoneNum", OleDbHelper.ToDbValue(zone.ZoneNum)), new OleDbParameter("@PartitionNum", OleDbHelper.ToDbValue(zone.PartitionNum)), new OleDbParameter("@ZoneType", OleDbHelper.ToDbValue(zone.ZoneType)), new OleDbParameter("@DetectorType", OleDbHelper.ToDbValue(zone.DetectorType)), new OleDbParameter("@InstallSide", OleDbHelper.ToDbValue(zone.InstallSide)), new OleDbParameter("@ZoneStatus", OleDbHelper.ToDbValue(zone.ZoneStatus)), new OleDbParameter("@Abscissa", OleDbHelper.ToDbValue(zone.Abscissa)), new OleDbParameter("@Ordinate", OleDbHelper.ToDbValue(zone.Ordinate)), new OleDbParameter("@StatusRefreshTime", OleDbHelper.ToDbValue(zone.StatusRefreshTime)), new OleDbParameter("@EedEventTime", OleDbHelper.ToDbValue(zone.EedEventTime)), new OleDbParameter("@IsAlarm", OleDbHelper.ToDbValue(zone.IsAlarm))); }
public void Insert(User user) { OleDbHelper.ExecuteNonQuery("Main", @"INSERT INTO [用户资料] (主机编号,用户名称,用户地址,用户类型,通讯格式,主机类型,安装人员,安装日期,安装单位,收费标准,合同期限,备注说明) VALUES (@Account,@UserName, @Address,@UserType,@Protocol,@PanelName,@Installer,@InstallDate,@InstallCompany,@Charge,@Deadline,@Mark)", new OleDbParameter("@Account", OleDbHelper.ToDbValue(user.Account)), new OleDbParameter("@UserName", OleDbHelper.ToDbValue(user.UserName)), new OleDbParameter("@Address", OleDbHelper.ToDbValue(user.Address)), new OleDbParameter("@UserType", OleDbHelper.ToDbValue(user.UserType)), new OleDbParameter("@Protocol", OleDbHelper.ToDbValue(user.Protocol)), new OleDbParameter("@PanelName", OleDbHelper.ToDbValue(user.PanelName)), new OleDbParameter("@Installer", OleDbHelper.ToDbValue(user.Installer)), new OleDbParameter("@InstallDate", OleDbHelper.ToDbValue(user.InstallDate)), new OleDbParameter("@InstallCompany", OleDbHelper.ToDbValue(user.InstallCompany)), new OleDbParameter("@Charge", OleDbHelper.ToDbValue(user.Charge)), new OleDbParameter("@Deadline", OleDbHelper.ToDbValue(user.Deadline)), new OleDbParameter("@Mark", OleDbHelper.ToDbValue(user.Mark))); }
public void Update(Strategies strategies) { OleDbHelper.ExecuteNonQuery("Main", @"UPDATE 处理策略 SET [策略编号]=@StrategiesID ,[策略名称]=@StrategiesName ,[事件字体颜色]=@EventFontColor ,[事件背景颜色]=@EventBackgroundColor ,[提示类型]=@NoticeType ,[自动打印]=@IsPrint ,[报警声文件]=@SoundFile WHERE [序号]=@ID", new OleDbParameter("@StrategiesID", OleDbHelper.ToDbValue(strategies.StrategiesID)), new OleDbParameter("@StrategiesName", OleDbHelper.ToDbValue(strategies.StrategiesName)), new OleDbParameter("@EventFontColor", OleDbHelper.ToDbValue(strategies.EventFontColor)), new OleDbParameter("@EventBackgroundColor", OleDbHelper.ToDbValue(strategies.EventBackgroundColor)), new OleDbParameter("@NoticeType", OleDbHelper.ToDbValue(strategies.NoticeType)), new OleDbParameter("@IsPrint", OleDbHelper.ToDbValue(strategies.IsPrint)), new OleDbParameter("@SoundFile", OleDbHelper.ToDbValue(strategies.SoundFile)), new OleDbParameter("@ID", OleDbHelper.ToDbValue(strategies.ID))); }
public void Insert(Receiver receiver) { OleDbHelper.ExecuteNonQuery("Main", @"INSERT INTO [串口设置] ([串口序号],[接警机名],[接警机类型],[版本号],[波特率],[数据位],[停止位],[流控制],[校验],[结束代码],[握手代码],[连接检查间隔],[是否检查连接],[备注]) VALUES (@SerialPortNum,@ReceiverName,@ReceiverType,@Version,@BaudRate,@DataBits,@StopBits,@FlowControl,@Parity,@EndCode,@ACK,@CheckTimer,@IsCheck,@Mark)", new OleDbParameter("@SerialPortNum", OleDbHelper.ToDbValue(receiver.SerialPortNum)), new OleDbParameter("@ReceiverName", OleDbHelper.ToDbValue(receiver.ReceiverName)), new OleDbParameter("@ReceiverType", OleDbHelper.ToDbValue(receiver.ReceiverType)), new OleDbParameter("@Version", OleDbHelper.ToDbValue(receiver.Version)), new OleDbParameter("@BaudRate", OleDbHelper.ToDbValue(receiver.BaudRate)), new OleDbParameter("@DataBits", OleDbHelper.ToDbValue(receiver.DataBits)), new OleDbParameter("@StopBits", OleDbHelper.ToDbValue(receiver.StopBits)), new OleDbParameter("@FlowControl", OleDbHelper.ToDbValue(receiver.FlowControl)), new OleDbParameter("@Parity", OleDbHelper.ToDbValue(receiver.Parity)), new OleDbParameter("@EndCode", OleDbHelper.ToDbValue(receiver.EndCode)), new OleDbParameter("@ACK", OleDbHelper.ToDbValue(receiver.ACK)), new OleDbParameter("@CheckTimer", OleDbHelper.ToDbValue(receiver.CheckTimer)), new OleDbParameter("@IsCheck", OleDbHelper.ToDbValue(receiver.IsCheck)), new OleDbParameter("@Mark", OleDbHelper.ToDbValue(receiver.Mark))); }
public void DeleteByID(string tableName, int ID) { OleDbHelper.ExecuteNonQuery("Main", "delete from " + tableName + " where [序号]=@ID", new OleDbParameter("@ID", ID)); }
public void DeleteByID(int ID) { OleDbHelper.ExecuteNonQuery("Main", "delete from 防区资料 where 序号=@ID", new OleDbParameter("@ID", ID)); }
public void DeleteByID(int id) { OleDbHelper.ExecuteNonQuery("Main", "delete from [用户资料] where [序号]=@ID", new OleDbParameter("@ID", id)); }