Beispiel #1
0
        public void Insert(Event e)
        {
            OleDbParameter[] parameters = new OleDbParameter[22];
            parameters[0]  = new OleDbParameter("@ID", OleDbHelper.ToDbValue(e.ID));
            parameters[1]  = new OleDbParameter("@UserName", OleDbHelper.ToDbValue(e.UserName));
            parameters[2]  = new OleDbParameter("@Address", OleDbHelper.ToDbValue(e.Address));
            parameters[3]  = new OleDbParameter("@Account", OleDbHelper.ToDbValue(e.Account));
            parameters[4]  = new OleDbParameter("@UserType", OleDbHelper.ToDbValue(e.UserType));
            parameters[5]  = new OleDbParameter("@PanelType", OleDbHelper.ToDbValue(e.PanelType));
            parameters[6]  = new OleDbParameter("@PartitionNumber", OleDbHelper.ToDbValue(e.PartitionNumber));
            parameters[7]  = new OleDbParameter("@ZoneNumber", OleDbHelper.ToDbValue(e.ZoneNumber));
            parameters[8]  = new OleDbParameter("@ZoneType", OleDbHelper.ToDbValue(e.ZoneType));
            parameters[9]  = new OleDbParameter("@DetectorType", OleDbHelper.ToDbValue(e.DetectorType));
            parameters[10] = new OleDbParameter("@InstallSide", OleDbHelper.ToDbValue(e.InstallSide));
            parameters[11] = new OleDbParameter("@EventTpye", OleDbHelper.ToDbValue(e.EventTpye));
            parameters[12] = new OleDbParameter("@EventInfomation", OleDbHelper.ToDbValue(e.EventInfomation));
            parameters[13] = new OleDbParameter("@Classify", OleDbHelper.ToDbValue(e.Classify));
            parameters[14] = new OleDbParameter("@DataCode", OleDbHelper.ToDbValue(e.DataCode));
            parameters[15] = new OleDbParameter("@MarkEvent", OleDbHelper.ToDbValue(e.MarkEvent));
            parameters[16] = new OleDbParameter("@Operator", OleDbHelper.ToDbValue(e.Operator));
            parameters[17] = new OleDbParameter("@EventFontColor", OleDbHelper.ToDbValue(e.EventFontColor));
            parameters[18] = new OleDbParameter("@EventBackgroundColor", OleDbHelper.ToDbValue(e.EventBackgroundColor));
            parameters[19] = new OleDbParameter("@TellNum", OleDbHelper.ToDbValue(e.TellNum));
            parameters[20] = new OleDbParameter("@Side", OleDbHelper.ToDbValue(e.Side));
            parameters[21] = new OleDbParameter("@TowLeverSide", OleDbHelper.ToDbValue(e.TowLeverSide));

            OleDbHelper.ExecuteNonQuery1("Event", @"INSERT INTO [报警事件]
                       ([序号],[用户名称],[用户地址],[主机编号],[用户类型],[主机类型],[分区编号],[防区编号],[防区类型],[探测器型号],[安装位置],[事件类型]
                       ,[辅助信息],[归类处理],[通讯代码],[处理内容],[值班员姓名],[事件字体颜色],[事件背景颜色],[来电号码],[站点编号],[二级站点])
                 VALUES
                       (@ID,@UserName,@Address,@Account,@UserType,@PanelType,@PartitionNumber,@ZoneNumber,@ZoneType,@DetectorType,@InstallSide,@EventTpye,
                        @EventInfomation,@Classify,@DataCode,@MarkEvent,@Operator,@EventFontColor,@EventBackgroundColor,@TellNum,@Side,@TowLeverSide)",
                                         parameters);
        }
Beispiel #2
0
        public void Update(Event e)
        {
            OleDbParameter[] parameters = new OleDbParameter[22];
            parameters[0]  = new OleDbParameter("@UserName", OleDbHelper.ToDbValue(e.UserName));
            parameters[1]  = new OleDbParameter("@Address", OleDbHelper.ToDbValue(e.Address));
            parameters[2]  = new OleDbParameter("@Account", OleDbHelper.ToDbValue(e.Account));
            parameters[3]  = new OleDbParameter("@UserType", OleDbHelper.ToDbValue(e.UserType));
            parameters[4]  = new OleDbParameter("@PanelType", OleDbHelper.ToDbValue(e.PanelType));
            parameters[5]  = new OleDbParameter("@PartitionNumber", OleDbHelper.ToDbValue(e.PartitionNumber));
            parameters[6]  = new OleDbParameter("@ZoneNumber", OleDbHelper.ToDbValue(e.ZoneNumber));
            parameters[7]  = new OleDbParameter("@ZoneType", OleDbHelper.ToDbValue(e.ZoneType));
            parameters[8]  = new OleDbParameter("@DetectorType", OleDbHelper.ToDbValue(e.DetectorType));
            parameters[9]  = new OleDbParameter("@InstallSide", OleDbHelper.ToDbValue(e.InstallSide));
            parameters[10] = new OleDbParameter("@EventTpye", OleDbHelper.ToDbValue(e.EventTpye));
            parameters[11] = new OleDbParameter("@EventInfomation", OleDbHelper.ToDbValue(e.EventInfomation));
            parameters[12] = new OleDbParameter("@Classify", OleDbHelper.ToDbValue(e.Classify));
            parameters[13] = new OleDbParameter("@DataCode", OleDbHelper.ToDbValue(e.DataCode));
            parameters[14] = new OleDbParameter("@MarkEvent", OleDbHelper.ToDbValue(e.MarkEvent));
            parameters[15] = new OleDbParameter("@Operator", OleDbHelper.ToDbValue(e.Operator));
            parameters[16] = new OleDbParameter("@EventFontColor", OleDbHelper.ToDbValue(e.EventFontColor));
            parameters[17] = new OleDbParameter("@EventBackgroundColor", OleDbHelper.ToDbValue(e.EventBackgroundColor));
            parameters[18] = new OleDbParameter("@TellNum", OleDbHelper.ToDbValue(e.TellNum));
            parameters[19] = new OleDbParameter("@Side", OleDbHelper.ToDbValue(e.Side));
            parameters[20] = new OleDbParameter("@TowLeverSide", OleDbHelper.ToDbValue(e.TowLeverSide));
            parameters[21] = new OleDbParameter("@ID", OleDbHelper.ToDbValue(e.ID));

            OleDbHelper.ExecuteNonQuery1("Event", @"UPDATE [报警事件]
                SET   [用户名称]=@UserName,[用户地址]=@Address,[主机编号]=@Account,[用户类型]=@UserType,[主机类型]=@PanelType,[分区编号]=@PartitionNumber,
                      [防区编号]=@ZoneNumber,[防区类型]=@ZoneType,[探测器型号]=@DetectorType,[安装位置]=@InstallSide,[事件类型]=@EventTpye,
                      [辅助信息]=@EventInfomation,[归类处理]=@Classify,[通讯代码]=@DataCode,[处理内容]=@MarkEvent,[值班员姓名]=@Operator,[事件字体颜色]=@EventFontColor,
                      [事件背景颜色]=@EventBackgroundColor,[来电号码]=@TellNum,[站点编号]=@Side,[二级站点]=@TowLeverSide
                WHERE [序号]=@ID"
                                         , parameters);
        }