Пример #1
0
        public ids idsGetById(int IdsId)
        {
            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "idsGetById",
                                                        IdsId).Tables[0];
                ids NewEnt = new ids();

                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    NewEnt.IdsId          = Int32.Parse(dr["IdsId"].ToString());
                    NewEnt.idsName        = dr["IdsName"].ToString();
                    NewEnt.DatabaseTypeId = Int32.Parse(dr["DatabaseTypeId"].ToString());
                    NewEnt.IdsTypeId      = Int32.Parse(dr["IdsTypeId"].ToString());
                    NewEnt.Active         = sbyte.Parse(dr["Active"].ToString());
                    NewEnt.IdsIP          = dr["IdsIP"].ToString();
                    NewEnt.DatabaseUser   = dr["DatabaseUser"].ToString();
                    NewEnt.DatabasePass   = dr["DatabasePass"].ToString();
                    NewEnt.DatabaseName   = dr["DatabaseName"].ToString();
                    NewEnt.DatabaseHost   = dr["DatabaseHost"].ToString();
                    NewEnt.IdsVersion     = dr["IdsVersion"].ToString();
                }
                return(NewEnt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
 public bool smtpserversUpdate(smtpservers smtpservers)
 {
     try
     {
         int update = SqlHelper.ExecuteNonQuery(SqlImplHelper.getConnectionString(), "smtpserversUpdate",
                                                smtpservers.SmtpServerId,
                                                smtpservers.SmtpServerHostname,
                                                smtpservers.SmtpServerPort,
                                                smtpservers.SmtpServerAccount,
                                                smtpservers.SmtpServerPassword,
                                                smtpservers.StmpServerEnabled);
         if (update > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #3
0
        public smtpservers smtpserversGetById(int SmtpServerId)
        {
            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "smtpserversGetById",
                                                        SmtpServerId).Tables[0];
                smtpservers NewEnt = new smtpservers();

                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    NewEnt.SmtpServerId       = Int32.Parse(dr["SmtpServerId"].ToString());
                    NewEnt.SmtpServerHostname = dr["SmtpServerHostname"].ToString();
                    NewEnt.SmtpServerPort     = dr["SmtpServerPort"].ToString();
                    NewEnt.SmtpServerAccount  = dr["SmtpServerAccount"].ToString();
                    NewEnt.SmtpServerPassword = dr["SmtpServerPassword"].ToString();
                    NewEnt.StmpServerEnabled  = sbyte.Parse(dr["StmpServerEnabled"].ToString());
                }
                return(NewEnt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #4
0
        public eventsalarm eventsalarmGetById(int EventsAlarmId)
        {
            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "eventsalarmGetById",
                                                        EventsAlarmId).Tables[0];
                eventsalarm NewEnt = new eventsalarm();

                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    NewEnt.EventsAlarmId          = Int32.Parse(dr["EventsAlarmId"].ToString());
                    NewEnt.IdsId                  = Int32.Parse(dr["IdsId"].ToString());
                    NewEnt.IdsSignatureCategoryId = Int32.Parse(dr["IdsSignatureCategoryId"].ToString());
                    NewEnt.Active                 = sbyte.Parse(dr["Active"].ToString());
                    NewEnt.CheckFrecuency         = Int32.Parse(dr["CheckFrecuency"].ToString());
                    NewEnt.Severity               = Int32.Parse(dr["Severity"].ToString());
                    NewEnt.AffectConfidence       = sbyte.Parse(dr["AffectConfidence"].ToString());
                    NewEnt.AffectIntegrity        = sbyte.Parse(dr["AffectIntegrity"].ToString());
                    NewEnt.AffectAvailability     = sbyte.Parse(dr["AffectAvailability"].ToString());
                    NewEnt.EventsAlarmTittle      = dr["AffectAvailability"].ToString();
                }
                return(NewEnt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #5
0
        public List <smtpservers> smtpserversGetAll()
        {
            List <smtpservers> lstsmtpservers = new List <smtpservers>();

            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "smtpserversGetAll").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    int colSmtpServerId       = dt.Columns["SmtpServerId"].Ordinal;
                    int colSmtpServerHostname = dt.Columns["SmtpServerHostname"].Ordinal;
                    int colSmtpServerPort     = dt.Columns["SmtpServerPort"].Ordinal;
                    int colSmtpServerAccount  = dt.Columns["SmtpServerAccount"].Ordinal;
                    int colSmtpServerPassword = dt.Columns["SmtpServerPassword"].Ordinal;
                    int colStmpServerEnabled  = dt.Columns["StmpServerEnabled"].Ordinal;
                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        smtpservers NewEnt = new smtpservers();
                        NewEnt.SmtpServerId       = Int32.Parse(dt.Rows[i].ItemArray[colSmtpServerId].ToString());
                        NewEnt.SmtpServerHostname = dt.Rows[i].ItemArray[colSmtpServerHostname].ToString();
                        NewEnt.SmtpServerPort     = dt.Rows[i].ItemArray[colSmtpServerPort].ToString();
                        NewEnt.SmtpServerAccount  = dt.Rows[i].ItemArray[colSmtpServerAccount].ToString();
                        NewEnt.SmtpServerPassword = dt.Rows[i].ItemArray[colSmtpServerPassword].ToString();
                        NewEnt.StmpServerEnabled  = sbyte.Parse(dt.Rows[i].ItemArray[colStmpServerEnabled].ToString());
                        lstsmtpservers.Add(NewEnt);
                    }
                }
                return(lstsmtpservers);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #6
0
        public List <databasestype> databasestypeGetAll()
        {
            List <databasestype> lstdatabasestype = new List <databasestype>();

            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "databasestypeGetAll").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    int colDatabaseTypeId = dt.Columns["DatabaseTypeId"].Ordinal;
                    int colDatabaseName   = dt.Columns["DatabaseName"].Ordinal;
                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        databasestype NewEnt = new databasestype();
                        NewEnt.DatabaseTypeId = Int32.Parse(dt.Rows[i].ItemArray[colDatabaseTypeId].ToString());
                        NewEnt.DatabaseName   = dt.Rows[i].ItemArray[colDatabaseName].ToString();
                        lstdatabasestype.Add(NewEnt);
                    }
                }
                return(lstdatabasestype);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #7
0
 public bool eventsalarmUpdate(eventsalarm eventsalarm)
 {
     try
     {
         int update = (int)SqlHelper.ExecuteScalar(SqlImplHelper.getConnectionString(), "eventsalarmUpdate",
                                                   eventsalarm.EventsAlarmId,
                                                   eventsalarm.IdsId,
                                                   eventsalarm.IdsSignatureCategoryId,
                                                   eventsalarm.Active,
                                                   eventsalarm.CheckFrecuency,
                                                   eventsalarm.Severity,
                                                   eventsalarm.AffectConfidence,
                                                   eventsalarm.AffectIntegrity,
                                                   eventsalarm.AffectAvailability,
                                                   eventsalarm.EventsAlarmTittle);
         if (update > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #8
0
        public List <ids> idsGetAll()
        {
            List <ids> lstids = new List <ids>();

            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "idsGetAll").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    int colIdsId          = dt.Columns["IdsId"].Ordinal;
                    int colDatabaseTypeId = dt.Columns["DatabaseTypeId"].Ordinal;
                    int colIdsTypeId      = dt.Columns["IdsTypeId"].Ordinal;
                    int colActive         = dt.Columns["Active"].Ordinal;
                    int colIdsIP          = dt.Columns["IdsIP"].Ordinal;
                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        ids NewEnt = new ids();
                        NewEnt.IdsId          = Int32.Parse(dt.Rows[i].ItemArray[colIdsId].ToString());
                        NewEnt.DatabaseTypeId = Int32.Parse(dt.Rows[i].ItemArray[colDatabaseTypeId].ToString());
                        NewEnt.IdsTypeId      = Int32.Parse(dt.Rows[i].ItemArray[colIdsTypeId].ToString());
                        NewEnt.Active         = sbyte.Parse(dt.Rows[i].ItemArray[colActive].ToString());
                        NewEnt.IdsIP          = dt.Rows[i].ItemArray[colIdsIP].ToString();
                        lstids.Add(NewEnt);
                    }
                }
                return(lstids);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #9
0
        public List <eventstype> eventstypeGetByDescription(string description)
        {
            List <eventstype> lsteventstype = new List <eventstype>();

            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "eventstypeGetByDescription",
                                                        description).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    int colEventsTypeId = dt.Columns["EventsTypeId"].Ordinal;
                    int colDescription  = dt.Columns["Description"].Ordinal;
                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        eventstype NewEnt = new eventstype();
                        NewEnt.EventsTypeId = Int32.Parse(dt.Rows[i].ItemArray[colEventsTypeId].ToString());
                        NewEnt.Description  = dt.Rows[i].ItemArray[colDescription].ToString();
                        lsteventstype.Add(NewEnt);
                    }
                }
                return(lsteventstype);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public List <userrolesmapping> userrolesmappingGetByUserGroupId(int UserGroupId)
        {
            List <userrolesmapping> lstuserrolesmapping = new List <userrolesmapping>();

            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "userrolesmappingGetByUserGroupId",
                                                        UserGroupId).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    int colUserRoleId  = dt.Columns["UserRoleId"].Ordinal;
                    int colUserGroupId = dt.Columns["UserGroupId"].Ordinal;
                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        userrolesmapping NewEnt = new userrolesmapping();
                        NewEnt.UserRoleId  = Int32.Parse(dt.Rows[i].ItemArray[colUserRoleId].ToString());
                        NewEnt.UserGroupId = Int32.Parse(dt.Rows[i].ItemArray[colUserGroupId].ToString());
                        lstuserrolesmapping.Add(NewEnt);
                    }
                }
                return(lstuserrolesmapping);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #11
0
        public List <eventsalarm_intrusionevents_mapping> eventsalarm_intrusionevents_mappingGetByEventsAlarmId(int EventsAlarmId)
        {
            List <eventsalarm_intrusionevents_mapping> lsteventsalarm_intrusionevents_mapping = new List <eventsalarm_intrusionevents_mapping>();

            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "eventsalarm_intrusionevents_mappingGetByEventsAlarmId",
                                                        EventsAlarmId).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    int colEventsAlarmId    = dt.Columns["EventsAlarmId"].Ordinal;
                    int colIntrusionEventId = dt.Columns["IntrusionEventId"].Ordinal;
                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        eventsalarm_intrusionevents_mapping NewEnt = new eventsalarm_intrusionevents_mapping();
                        NewEnt.EventsAlarmId    = Int32.Parse(dt.Rows[i].ItemArray[colEventsAlarmId].ToString());
                        NewEnt.IntrusionEventId = Int32.Parse(dt.Rows[i].ItemArray[colIntrusionEventId].ToString());
                        lsteventsalarm_intrusionevents_mapping.Add(NewEnt);
                    }
                }
                return(lsteventsalarm_intrusionevents_mapping);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #12
0
        public List <taskstatus> taskstatusGetAll()
        {
            List <taskstatus> lsttaskstatus = new List <taskstatus>();

            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "taskstatusGetAll").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    int colTaskStatusId          = dt.Columns["TaskStatusId"].Ordinal;
                    int colTaskStatusDescription = dt.Columns["TaskStatusDescription"].Ordinal;
                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        taskstatus NewEnt = new taskstatus();
                        NewEnt.TaskStatusId          = Int32.Parse(dt.Rows[i].ItemArray[colTaskStatusId].ToString());
                        NewEnt.TaskStatusDescription = dt.Rows[i].ItemArray[colTaskStatusDescription].ToString();
                        lsttaskstatus.Add(NewEnt);
                    }
                }
                return(lsttaskstatus);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public intrusionevents intrusioneventsGetById(int IntrusionEventsId)
        {
            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "intrusioneventsGetById",
                                                        IntrusionEventsId).Tables[0];
                intrusionevents NewEnt = new intrusionevents();

                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    NewEnt.IntrusionEventsId    = Int32.Parse(dr["IntrusionEventsId"].ToString());
                    NewEnt.IntrusionEventDetail = dr["IntrusionEventDetail"].ToString();
                    NewEnt.CVEId = dr["CVEId"].ToString();
                    NewEnt.CWEId = dr["CWEId"].ToString();
                    NewEnt.CWEId = dr["CAPECId"].ToString();
                    NewEnt.CWEId = dr["OWASPId"].ToString();
                }
                return(NewEnt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public bool intrusioneventsUpdate(intrusionevents intrusionevents)
 {
     try
     {
         int update = SqlHelper.ExecuteNonQuery(SqlImplHelper.getConnectionString(), "intrusioneventsUpdate",
                                                intrusionevents.IntrusionEventsId,
                                                intrusionevents.IntrusionEventDetail,
                                                intrusionevents.CVEId,
                                                intrusionevents.CWEId,
                                                intrusionevents.CAPECId,
                                                intrusionevents.OWASPId);
         if (update > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #15
0
 public bool taskdetailsUpdate(taskdetails taskdetails)
 {
     try
     {
         int update = SqlHelper.ExecuteNonQuery(SqlImplHelper.getConnectionString(), "taskdetailsUpdate",
                                                taskdetails.TaskDetailsId,
                                                taskdetails.TaskId,
                                                taskdetails.Details,
                                                taskdetails.DateTime,
                                                taskdetails.EffortHours,
                                                taskdetails.UserId);
         if (update > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #16
0
        public List <severity> severityGetAll()
        {
            List <severity> lstseverity = new List <severity>();

            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "severityGetAll").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    int colSeverityId          = dt.Columns["SeverityId"].Ordinal;
                    int colSeverityDescription = dt.Columns["SeverityDescription"].Ordinal;
                    int colSLATimeToResponse   = dt.Columns["SLATimeToResponse"].Ordinal;
                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        severity NewEnt = new severity();
                        NewEnt.SeverityId          = Int32.Parse(dt.Rows[i].ItemArray[colSeverityId].ToString());
                        NewEnt.SeverityDescription = dt.Rows[i].ItemArray[colSeverityDescription].ToString();
                        NewEnt.SLATimeToResponse   = Int32.Parse(dt.Rows[i].ItemArray[colSLATimeToResponse].ToString());
                        lstseverity.Add(NewEnt);
                    }
                }
                return(lstseverity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #17
0
        public taskdetails taskdetailsGetById(int TaskDetailsId)
        {
            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "taskdetailsGetById",
                                                        TaskDetailsId).Tables[0];
                taskdetails NewEnt = new taskdetails();

                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    NewEnt.TaskDetailsId = Int32.Parse(dr["TaskDetailsId"].ToString());
                    NewEnt.TaskId        = Int32.Parse(dr["TaskId"].ToString());
                    NewEnt.Details       = dr["Details"].ToString();
                    NewEnt.DateTime      = DateTime.Parse(dr["DateTime"].ToString());
                    NewEnt.EffortHours   = Decimal.Parse(dr["EffortHours"].ToString());
                    NewEnt.UserId        = Int32.Parse(dr["UserId"].ToString());
                }
                return(NewEnt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #18
0
        public List <taskdetails> taskdetailsGetAll()
        {
            List <taskdetails> lsttaskdetails = new List <taskdetails>();

            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "taskdetailsGetAll").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    int colTaskDetailsId = dt.Columns["TaskDetailsId"].Ordinal;
                    int colTaskId        = dt.Columns["TaskId"].Ordinal;
                    int colDetails       = dt.Columns["Details"].Ordinal;
                    int colDateTime      = dt.Columns["DateTime"].Ordinal;
                    int colEffortHours   = dt.Columns["EffortHours"].Ordinal;
                    int colUserId        = dt.Columns["UserId"].Ordinal;
                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        taskdetails NewEnt = new taskdetails();
                        NewEnt.TaskDetailsId = Int32.Parse(dt.Rows[i].ItemArray[colTaskDetailsId].ToString());
                        NewEnt.TaskId        = Int32.Parse(dt.Rows[i].ItemArray[colTaskId].ToString());
                        NewEnt.Details       = dt.Rows[i].ItemArray[colDetails].ToString();
                        NewEnt.DateTime      = DateTime.Parse(dt.Rows[i].ItemArray[colDateTime].ToString());
                        NewEnt.EffortHours   = Decimal.Parse(dt.Rows[i].ItemArray[colEffortHours].ToString());
                        NewEnt.UserId        = Int32.Parse(dt.Rows[i].ItemArray[colUserId].ToString());
                        lsttaskdetails.Add(NewEnt);
                    }
                }
                return(lsttaskdetails);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #19
0
        public users usersGetById(int UserId, int UserGroupId)
        {
            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "usersGetById",
                                                        UserId, UserGroupId).Tables[0];
                users NewEnt = new users();

                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    NewEnt.UserId        = Int32.Parse(dr["UserId"].ToString());
                    NewEnt.UserGroupId   = Int32.Parse(dr["UserGroupId"].ToString());
                    NewEnt.UserName      = dr["UserName"].ToString();
                    NewEnt.UserFirstName = dr["UserFirstName"].ToString();
                    NewEnt.UserLastName  = dr["UserLastName"].ToString();
                    NewEnt.UserMail      = dr["UserMail"].ToString();
                    NewEnt.UserSMSNumber = dr["UserSMSNumber"].ToString();
                    NewEnt.UserPassword  = dr["UserPassword"].ToString();
                    NewEnt.UserActive    = sbyte.Parse(dr["UserActive"].ToString());
                }
                return(NewEnt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #20
0
 public bool usersUpdate(users users)
 {
     try
     {
         int update = SqlHelper.ExecuteNonQuery(SqlImplHelper.getConnectionString(), "usersUpdate",
                                                users.UserId,
                                                users.UserGroupId,
                                                users.UserName,
                                                users.UserFirstName,
                                                users.UserLastName,
                                                users.UserMail,
                                                users.UserSMSNumber,
                                                users.UserPassword,
                                                users.UserActive);
         if (update > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #21
0
 public bool idsUpdate(ids ids)
 {
     try
     {
         int update = (int)SqlHelper.ExecuteScalar(SqlImplHelper.getConnectionString(), "idsUpdate",
                                                   ids.IdsId,
                                                   ids.idsName,
                                                   ids.DatabaseTypeId,
                                                   ids.IdsTypeId,
                                                   ids.Active,
                                                   ids.IdsIP,
                                                   ids.DatabaseUser,
                                                   ids.DatabasePass,
                                                   ids.DatabaseName,
                                                   ids.DatabaseHost,
                                                   ids.IdsVersion);
         if (update > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #22
0
        public eventsdetection eventsdetectionGetById(int eventsdetectionId)
        {
            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "eventsdetectionGetById",
                                                        eventsdetectionId).Tables[0];
                eventsdetection NewEnt = new eventsdetection();

                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    NewEnt.EventsDetectionId = Int32.Parse(dr["EventsDetectionId"].ToString());
                    NewEnt.IdsId             = Int32.Parse(dr["IdsId"].ToString());
                    NewEnt.DateTime          = DateTime.Parse(dr["DateTime"].ToString());
                    NewEnt.EventStatus       = Int32.Parse(dr["EventStatus"].ToString());
                    NewEnt.EventsAlarmId     = Int32.Parse(dr["EventsAlarmId"].ToString());
                    NewEnt.IDPSEventId       = Int32.Parse(dr["IDPSEventId"].ToString());
                }
                return(NewEnt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #23
0
        public List <eventsalarm> eventsalarmGetAll()
        {
            List <eventsalarm> lsteventsalarm = new List <eventsalarm>();

            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "eventsalarmGetAll").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    int colEventsAlarmId  = dt.Columns["EventsAlarmId"].Ordinal;
                    int colEventsTypeId   = dt.Columns["EventsTypeId"].Ordinal;
                    int colActive         = dt.Columns["Active"].Ordinal;
                    int colCheckFrecuency = dt.Columns["CheckFrecuency"].Ordinal;
                    int colSeverity       = dt.Columns["Severity"].Ordinal;
                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        eventsalarm NewEnt = new eventsalarm();
                        NewEnt.EventsAlarmId  = Int32.Parse(dt.Rows[i].ItemArray[colEventsAlarmId].ToString());
                        NewEnt.EventsTypeId   = Int32.Parse(dt.Rows[i].ItemArray[colEventsTypeId].ToString());
                        NewEnt.Active         = sbyte.Parse(dt.Rows[i].ItemArray[colActive].ToString());
                        NewEnt.CheckFrecuency = Int32.Parse(dt.Rows[i].ItemArray[colCheckFrecuency].ToString());
                        NewEnt.Severity       = Int32.Parse(dt.Rows[i].ItemArray[colSeverity].ToString());
                        lsteventsalarm.Add(NewEnt);
                    }
                }
                return(lsteventsalarm);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #24
0
        public List <eventsdetection> eventsdetectionGetAll()
        {
            List <eventsdetection> lsteventsdetection = new List <eventsdetection>();

            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "eventsdetectionGetAll").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    int colEventsDetectionId = dt.Columns["EventsDetectionId"].Ordinal;
                    int colIdsId             = dt.Columns["IdsId"].Ordinal;
                    int colDateTime          = dt.Columns["DateTime"].Ordinal;
                    int colEventStatus       = dt.Columns["EventStatus"].Ordinal;
                    int colEventsAlarmId     = dt.Columns["EventsAlarmId"].Ordinal;
                    int colEventsIDPSEventId = dt.Columns["IDPSEventId"].Ordinal;

                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        eventsdetection NewEnt = new eventsdetection();
                        NewEnt.EventsDetectionId = Int32.Parse(dt.Rows[i].ItemArray[colEventsDetectionId].ToString());
                        NewEnt.IdsId             = Int32.Parse(dt.Rows[i].ItemArray[colIdsId].ToString());
                        NewEnt.DateTime          = DateTime.Parse(dt.Rows[i].ItemArray[colDateTime].ToString());
                        NewEnt.EventStatus       = Int32.Parse(dt.Rows[i].ItemArray[colEventStatus].ToString());
                        NewEnt.EventsAlarmId     = Int32.Parse(dt.Rows[i].ItemArray[colEventsAlarmId].ToString());
                        NewEnt.IDPSEventId       = Int32.Parse(dt.Rows[i].ItemArray[colEventsIDPSEventId].ToString());
                        lsteventsdetection.Add(NewEnt);
                    }
                }
                return(lsteventsdetection);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #25
0
 public bool eventsdetectionUpdate(eventsdetection eventsdetection)
 {
     try
     {
         int update = SqlHelper.ExecuteNonQuery(SqlImplHelper.getConnectionString(), "eventsdetectionUpdate",
                                                eventsdetection.EventsDetectionId,
                                                eventsdetection.IdsId,
                                                eventsdetection.DateTime,
                                                eventsdetection.EventStatus,
                                                eventsdetection.EventsAlarmId,
                                                eventsdetection.IDPSEventId);
         if (update > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #26
0
 public bool tasksUpdate(tasks tasks)
 {
     try
     {
         int update = (int)SqlHelper.ExecuteScalar(SqlImplHelper.getConnectionString(), "tasksUpdate",
                                                   tasks.TaskId,
                                                   tasks.EventsDetectionId,
                                                   tasks.TaskStatudId,
                                                   tasks.UserId,
                                                   tasks.TaskTittle,
                                                   tasks.DateTime);
         if (update > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #27
0
        public List <tasks> tasksGetAll()
        {
            List <tasks> lsttasks = new List <tasks>();

            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "tasksGetAll").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    int colTaskId            = dt.Columns["TaskId"].Ordinal;
                    int colEventsDetectionId = dt.Columns["EventsDetectionId"].Ordinal;
                    int colTaskStatudId      = dt.Columns["TaskStatudId"].Ordinal;
                    int colUserId            = dt.Columns["UserId"].Ordinal;
                    int colTaskTittle        = dt.Columns["TaskTittle"].Ordinal;
                    int colDateTime          = dt.Columns["DateTime"].Ordinal;
                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        tasks NewEnt = new tasks();
                        NewEnt.TaskId            = Int32.Parse(dt.Rows[i].ItemArray[colTaskId].ToString());
                        NewEnt.EventsDetectionId = Int32.Parse(dt.Rows[i].ItemArray[colEventsDetectionId].ToString());
                        NewEnt.TaskStatudId      = Int32.Parse(dt.Rows[i].ItemArray[colTaskStatudId].ToString());
                        NewEnt.UserId            = Int32.Parse(dt.Rows[i].ItemArray[colUserId].ToString());
                        NewEnt.TaskTittle        = dt.Rows[i].ItemArray[colTaskTittle].ToString();
                        NewEnt.DateTime          = DateTime.Parse(dt.Rows[i].ItemArray[colDateTime].ToString());
                        lsttasks.Add(NewEnt);
                    }
                }
                return(lsttasks);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #28
0
        public tasks tasksGetByEventsDetectionId(int EventsDetectionId)
        {
            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "tasksGetByIntrusionDetectionId",
                                                        EventsDetectionId).Tables[0];
                tasks NewEnt = new tasks();

                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    NewEnt.TaskId            = Int32.Parse(dr["TaskId"].ToString());
                    NewEnt.EventsDetectionId = Int32.Parse(dr["EventsDetectionId"].ToString());
                    NewEnt.TaskStatudId      = Int32.Parse(dr["TaskStatudId"].ToString());
                    NewEnt.UserId            = Int32.Parse(dr["UserId"].ToString());
                    NewEnt.TaskTittle        = dr["TaskTittle"].ToString();
                    NewEnt.DateTime          = DateTime.Parse(dr["DateTime"].ToString());
                }
                return(NewEnt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #29
0
        public List <usergroup> usergroupGetAll()
        {
            List <usergroup> lstusergroup = new List <usergroup>();

            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "usergroupGetAll").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    int colUserGroupId          = dt.Columns["UserGroupId"].Ordinal;
                    int colUserGroupDescription = dt.Columns["UserGroupDescription"].Ordinal;
                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        usergroup NewEnt = new usergroup();
                        NewEnt.UserGroupId          = Int32.Parse(dt.Rows[i].ItemArray[colUserGroupId].ToString());
                        NewEnt.UserGroupDescription = dt.Rows[i].ItemArray[colUserGroupDescription].ToString();
                        lstusergroup.Add(NewEnt);
                    }
                }
                return(lstusergroup);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #30
0
 public int usergroupAdd(usergroup usergroup)
 {
     try
     {
         return((int)SqlHelper.ExecuteScalar(SqlImplHelper.getConnectionString(), "usergroupAdd",
                                             usergroup.UserGroupDescription));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }