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;
     }
 }
 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;
     }
 }
        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;
            }
        }
        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;
            }
        }
Example #5
0
        protected void generatePieChart()
        {
            DataTable dttSecurityDimensionAffected = new DataTable();

            dttSecurityDimensionAffected.Columns.Add(new DataColumn("dimensionId", System.Type.GetType("System.Int32")));
            dttSecurityDimensionAffected.Columns.Add(new DataColumn("Dimension", System.Type.GetType("System.String")));
            dttSecurityDimensionAffected.Columns.Add(new DataColumn("Quantity", System.Type.GetType("System.Int32")));

            List <eventsdetection> lstEventsDetection = new List <eventsdetection>();
            eventsdetectionBus     oEventsDetection   = new eventsdetectionBus();

            eventsalarm    auxEventsAlarm = new eventsalarm();
            eventsalarmBus oEventsAlarm   = new eventsalarmBus();

            lstEventsDetection = oEventsDetection.eventsdetectionGetAll();

            if (lstEventsDetection.Count > 0)
            {
                int qtyConfidence   = 0;
                int qtyIntegrity    = 0;
                int qtyAvailability = 0;

                foreach (eventsdetection detectionRow in lstEventsDetection)
                {
                    auxEventsAlarm = oEventsAlarm.eventsalarmGetById(detectionRow.EventsAlarmId);

                    if (Convert.ToBoolean(auxEventsAlarm.AffectConfidence))
                    {
                        qtyConfidence++;
                    }
                    if (Convert.ToBoolean(auxEventsAlarm.AffectIntegrity))
                    {
                        qtyIntegrity++;
                    }
                    if (Convert.ToBoolean(auxEventsAlarm.AffectAvailability))
                    {
                        qtyAvailability++;
                    }
                }

                dttSecurityDimensionAffected.Rows.Add(1, "Confidencialidad", qtyConfidence);
                dttSecurityDimensionAffected.Rows.Add(2, "Integridad", qtyIntegrity);
                dttSecurityDimensionAffected.Rows.Add(3, "Disponibilidad", qtyAvailability);

                pieChart.Series[0].XValueMember  = "Dimension";
                pieChart.Series[0].YValueMembers = "Quantity";
                pieChart.DataSource = dttSecurityDimensionAffected;
                pieChart.DataBind();
            }
        }
 public int eventsalarmAdd(eventsalarm eventsalarm)
 {
     try
     {
         return (int)SqlHelper.ExecuteScalar(SqlImplHelper.getConnectionString(), "eventsalarmAdd",
                                                                                     eventsalarm.EventsTypeId,
                                                                                     eventsalarm.Active,
                                                                                     eventsalarm.CheckFrecuency,
                                                                                     eventsalarm.Severity);
     }
     catch(Exception ex)
     {
         throw ex;
     }
 }
 public int eventsalarmAdd(eventsalarm eventsalarm)
 {
     try
     {
         return((int)SqlHelper.ExecuteScalar(SqlImplHelper.getConnectionString(), "eventsalarmAdd",
                                             eventsalarm.EventsTypeId,
                                             eventsalarm.Active,
                                             eventsalarm.CheckFrecuency,
                                             eventsalarm.Severity));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public int eventsalarmAdd(eventsalarm eventsalarm)
 {
     try
     {
         return((int)SqlHelper.ExecuteScalar(SqlImplHelper.getConnectionString(), "eventsalarmAdd",
                                             eventsalarm.IdsId,
                                             eventsalarm.IdsSignatureCategoryId,
                                             eventsalarm.Active,
                                             eventsalarm.CheckFrecuency,
                                             eventsalarm.Severity,
                                             eventsalarm.AffectConfidence,
                                             eventsalarm.AffectIntegrity,
                                             eventsalarm.AffectAvailability,
                                             eventsalarm.EventsAlarmTittle));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public bool eventsalarmUpdate(int idUsuario, string ip, string host, eventsalarm eventsalarm)
 {
     try
     {
         int update = SqlHelper.ExecuteNonQuery(SqlImplHelper.getConnectionString(), "eventsalarmUpdate",
                                                eventsalarm.EventsAlarmId,
                                                eventsalarm.EventsTypeId,
                                                eventsalarm.Active,
                                                eventsalarm.CheckFrecuency,
                                                eventsalarm.Severity);
         if (update > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #10
0
        public int eventsalarmAdd(eventsalarm eventsalarm)
        {
            eventsalarmImpl oeventsalarmImpl = new eventsalarmImpl();

            return(oeventsalarmImpl.eventsalarmAdd(eventsalarm));
        }
Example #11
0
        protected void getEventsDetectionData()
        {
            DataTable dttEventsDetection = new DataTable();

            dttEventsDetection.Columns.Add(new DataColumn("eventsDetectionId", System.Type.GetType("System.Int32")));
            dttEventsDetection.Columns.Add(new DataColumn("datetime", System.Type.GetType("System.DateTime")));
            dttEventsDetection.Columns.Add(new DataColumn("eventStauts", System.Type.GetType("System.Int32")));
            dttEventsDetection.Columns.Add(new DataColumn("eventStatusDescription", System.Type.GetType("System.String")));
            dttEventsDetection.Columns.Add(new DataColumn("IDSId", System.Type.GetType("System.Int32")));
            dttEventsDetection.Columns.Add(new DataColumn("IDPS", System.Type.GetType("System.String")));
            dttEventsDetection.Columns.Add(new DataColumn("idsName", System.Type.GetType("System.String")));
            dttEventsDetection.Columns.Add(new DataColumn("eventsAlarmId", System.Type.GetType("System.Int32")));
            dttEventsDetection.Columns.Add(new DataColumn("severityId", System.Type.GetType("System.Int32")));
            dttEventsDetection.Columns.Add(new DataColumn("severityDescription", System.Type.GetType("System.String")));
            dttEventsDetection.Columns.Add(new DataColumn("SLATimeToResponse", System.Type.GetType("System.Int32")));
            dttEventsDetection.Columns.Add(new DataColumn("TaskId", System.Type.GetType("System.Int32")));
            dttEventsDetection.Columns.Add(new DataColumn("IDPSEventId", System.Type.GetType("System.Int32")));

            List <eventsdetection> lstEvetnsDetection = new List <eventsdetection>();
            eventsdetectionBus     oEventsDetection   = new eventsdetectionBus();

            idsBus         oIDPS        = new idsBus();
            eventsalarmBus oEventsAlarm = new eventsalarmBus();
            severityBus    oSeverity    = new severityBus();
            tasksBus       oTask        = new tasksBus();
            taskstatusBus  oTaskStatus  = new taskstatusBus();

            lstEvetnsDetection = oEventsDetection.eventsdetectionGetAll();

            if (lstEvetnsDetection.Count > 0)
            {
                foreach (eventsdetection row in lstEvetnsDetection)
                {
                    if (row.EventStatus == 2 || row.EventStatus == 5) //Closed, Rejected
                    {
                        continue;
                    }

                    ids         auxIDPS       = new ids();
                    eventsalarm auxEventAlarm = new eventsalarm();
                    severity    auxSeverity   = new severity();
                    tasks       auxTask       = new tasks();
                    taskstatus  auxTaskStatus = new taskstatus();

                    auxIDPS       = oIDPS.idsGetById(row.IdsId);
                    auxEventAlarm = oEventsAlarm.eventsalarmGetById(row.EventsAlarmId);
                    auxSeverity   = oSeverity.severityGetById(auxEventAlarm.Severity);
                    auxTask       = oTask.tasksGetByEventsDetectionId(row.EventsDetectionId);
                    auxTaskStatus = oTaskStatus.taskstatusGetById(row.EventStatus);

                    dttEventsDetection.Rows.Add(row.EventsDetectionId,
                                                row.DateTime,
                                                row.EventStatus,
                                                auxTaskStatus.TaskStatusDescription,
                                                row.IdsId,
                                                auxIDPS.IdsIP,
                                                auxIDPS.idsName,
                                                row.EventsAlarmId,
                                                auxSeverity.SeverityId,
                                                auxSeverity.SeverityDescription,
                                                auxSeverity.SLATimeToResponse,
                                                auxTask.TaskId,
                                                row.IDPSEventId);
                }

                gvEventsDetection.DataSource = dttEventsDetection;
                gvEventsDetection.DataBind();
            }
        }
 public bool eventsalarmUpdate(eventsalarm eventsalarm)
 {
     eventsalarmImpl oeventsalarmImpl = new eventsalarmImpl();
     return oeventsalarmImpl.eventsalarmUpdate( eventsalarm);
 }
 public int eventsalarmAdd(eventsalarm eventsalarm)
 {
     eventsalarmImpl oeventsalarmImpl = new eventsalarmImpl();
     return oeventsalarmImpl.eventsalarmAdd( eventsalarm);
 }
 public bool eventsalarmUpdate(int idUsuario, string ip, string host, eventsalarm eventsalarm)
 {
     try
     {
         int update = SqlHelper.ExecuteNonQuery(SqlImplHelper.getConnectionString(), "eventsalarmUpdate",
                                                                                     eventsalarm.EventsAlarmId,
                                                                                     eventsalarm.EventsTypeId,
                                                                                     eventsalarm.Active,
                                                                                     eventsalarm.CheckFrecuency,
                                                                                     eventsalarm.Severity);
         if (update > 0)
         {
             return true;
         }
         else
         {
             return false;
         }
     }
     catch(Exception ex)
     {
         throw ex;
     }
 }
        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.EventsTypeId = Int32.Parse(dr["EventsTypeId"].ToString());
                    NewEnt.Active = sbyte.Parse(dr["Active"].ToString());
                    NewEnt.CheckFrecuency = Int32.Parse(dr["CheckFrecuency"].ToString());
                    NewEnt.Severity = Int32.Parse(dr["Severity"].ToString());
                }
                return NewEnt;
            }
            catch(Exception ex)
            {
                throw ex;
            }
        }
Example #16
0
        protected void gvAlarms_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow row = gvAlarms.SelectedRow;

            eventsalarm    auxEventsAlarm = new eventsalarm();
            eventsalarmBus oEventsAlarm   = new eventsalarmBus();

            intrusionevents        auxIntrusionEvent          = new intrusionevents();
            List <intrusionevents> lstIntrusionEventsAssigned = new List <intrusionevents>();
            intrusioneventsBus     oIntrusionEvents           = new intrusioneventsBus();

            List <eventsalarm_intrusionevents_mapping> lstEventsMapping = new List <eventsalarm_intrusionevents_mapping>();
            eventsalarm_intrusionevents_mappingBus     oEventsMapping   = new eventsalarm_intrusionevents_mappingBus();

            try
            {
                ddlSeverity.SelectedValue = ((Label)row.FindControl("severity")).Text;
            }
            catch
            {
            }

            if ((Label)row.FindControl("eventsAlarmId") != null)
            {
                txtEventAlarmId.Text = ((Label)row.FindControl("eventsAlarmId")).Text;
            }
            else
            {
                txtEventAlarmId.Text = "";
            }
            if ((Label)row.FindControl("eventsAlarmTittle") != null)
            {
                txtEventsAlarmTittle.Text = ((Label)row.FindControl("eventsAlarmTittle")).Text;
            }
            else
            {
                txtEventsAlarmTittle.Text = "";
            }
            if ((Label)row.FindControl("checkFrecuency") != null)
            {
                txtCheckFrequency.Text = ((Label)row.FindControl("checkFrecuency")).Text;
            }
            else
            {
                txtCheckFrequency.Text = "";
            }
            if ((CheckBox)row.FindControl("active") != null)
            {
                chkActive.Checked = ((CheckBox)row.FindControl("active")).Checked;
            }
            else
            {
                chkActive.Checked = false;
            }

            auxEventsAlarm   = oEventsAlarm.eventsalarmGetById(Convert.ToInt32(txtEventAlarmId.Text));
            lstEventsMapping = oEventsMapping.eventsalarm_intrusionevents_mappingGetByEventsAlarmId(Convert.ToInt32(txtEventAlarmId.Text));

            if (lstEventsMapping.Count > 0)
            {
                foreach (eventsalarm_intrusionevents_mapping rowMapping in lstEventsMapping)
                {
                    auxIntrusionEvent = oIntrusionEvents.intrusioneventsGetById(rowMapping.IntrusionEventId);
                    lstIntrusionEventsAssigned.Add(auxIntrusionEvent);
                }

                gvIntrusionEventsAssigned.DataSource = lstIntrusionEventsAssigned;
                gvIntrusionEventsAssigned.DataBind();
            }

            ddlIDPS.SelectedValue    = auxEventsAlarm.IdsId.ToString();
            chkBIA.Items[0].Selected = Convert.ToBoolean(auxEventsAlarm.AffectConfidence);
            chkBIA.Items[1].Selected = Convert.ToBoolean(auxEventsAlarm.AffectIntegrity);
            chkBIA.Items[2].Selected = Convert.ToBoolean(auxEventsAlarm.AffectAvailability);
            getSignatureData(auxEventsAlarm.IdsId);
            ddlIDPSSignatures.SelectedValue = auxEventsAlarm.IdsSignatureCategoryId.ToString();

            activateFields(true, false);
            btnSave.Enabled = true;
        }
Example #17
0
        private void getTasksData()
        {
            DataTable dttTasks = new DataTable();

            dttTasks.Columns.Add(new DataColumn("taskId", System.Type.GetType("System.Int32")));
            dttTasks.Columns.Add(new DataColumn("datetime", System.Type.GetType("System.DateTime")));
            dttTasks.Columns.Add(new DataColumn("taskTittle", System.Type.GetType("System.String")));
            dttTasks.Columns.Add(new DataColumn("eventsDetectionId", System.Type.GetType("System.Int32")));
            dttTasks.Columns.Add(new DataColumn("taskStatusId", System.Type.GetType("System.Int32")));
            dttTasks.Columns.Add(new DataColumn("statusDescription", System.Type.GetType("System.String")));
            dttTasks.Columns.Add(new DataColumn("userId", System.Type.GetType("System.Int32")));
            dttTasks.Columns.Add(new DataColumn("userName", System.Type.GetType("System.String")));
            dttTasks.Columns.Add(new DataColumn("serverityId", System.Type.GetType("System.Int32")));
            dttTasks.Columns.Add(new DataColumn("sererityDescription", System.Type.GetType("System.String")));
            dttTasks.Columns.Add(new DataColumn("SLAStatus", System.Type.GetType("System.String")));

            List <tasks>       lstTasks         = new List <tasks>();
            tasksBus           oTasks           = new tasksBus();
            eventsdetectionBus oEventsDetection = new eventsdetectionBus();
            idsBus             oIDPS            = new idsBus();
            eventsalarmBus     oEventsAlarm     = new eventsalarmBus();
            severityBus        oSeverity        = new severityBus();
            taskstatusBus      oTaskStatus      = new taskstatusBus();
            usersBus           oUsers           = new usersBus();

            lstTasks = oTasks.tasksGetAll();

            if (lstTasks.Count > 0)
            {
                foreach (tasks row in lstTasks)
                {
                    if (row.TaskStatudId == 2 || row.TaskStatudId == 5) //Closed, Rejected
                    {
                        continue;
                    }

                    taskstatus      auxStatus         = new taskstatus();
                    users           auxUser           = new users();
                    eventsdetection auxEventDetection = new eventsdetection();
                    eventsalarm     auxEventAlarm     = new eventsalarm();
                    severity        auxSeverity       = new severity();
                    string          SLASatus          = "";

                    auxStatus         = oTaskStatus.taskstatusGetById(row.TaskStatudId);
                    auxUser           = oUsers.usersGetById(row.UserId);
                    auxEventDetection = oEventsDetection.eventsdetectionGetById(row.EventsDetectionId);
                    auxEventAlarm     = oEventsAlarm.eventsalarmGetById(auxEventDetection.EventsAlarmId);
                    auxSeverity       = oSeverity.severityGetById(auxEventAlarm.Severity);

                    DateTime deadTime = row.DateTime;
                    deadTime.AddMinutes(auxSeverity.SLATimeToResponse);
                    if (DateTime.Now > deadTime)
                    {
                        SLASatus = "Vencido";
                    }
                    if (DateTime.Now < deadTime)
                    {
                        SLASatus = "En término";
                    }

                    dttTasks.Rows.Add(row.TaskId,
                                      row.DateTime,
                                      row.TaskTittle,
                                      row.EventsDetectionId,
                                      row.TaskStatudId,
                                      auxStatus.TaskStatusDescription,
                                      row.UserId,
                                      auxUser.UserName,
                                      auxEventAlarm.Severity,
                                      auxSeverity.SeverityDescription,
                                      SLASatus);
                }

                gvTasks.DataSource = dttTasks;
                gvTasks.DataBind();
            }
        }
Example #18
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            eventsalarm    auxNewEventAlarm = new eventsalarm();
            eventsalarmBus oEventsAlarm     = new eventsalarmBus();

            eventsalarm_intrusionevents_mapping    auxIntrusionEventMapping = new eventsalarm_intrusionevents_mapping();
            eventsalarm_intrusionevents_mappingBus oIntrusionEventsMapping  = new eventsalarm_intrusionevents_mappingBus();

            bool needRequiredFields = false;
            int  saveType           = 0;

            if (btnNew.Enabled)
            {
                saveType = 2;
            }
            if (!btnNew.Enabled)
            {
                saveType = 1;
            }

            if (String.IsNullOrEmpty(txtCheckFrequency.Text))
            {
                needRequiredFields = true;
            }
            if (String.IsNullOrEmpty(txtEventsAlarmTittle.Text))
            {
                needRequiredFields = true;
            }

            if (!needRequiredFields)
            {
                auxNewEventAlarm.Severity           = Convert.ToInt32(ddlSeverity.SelectedValue);
                auxNewEventAlarm.EventsAlarmTittle  = txtEventsAlarmTittle.Text;
                auxNewEventAlarm.CheckFrecuency     = Convert.ToInt32(txtCheckFrequency.Text);
                auxNewEventAlarm.Active             = Convert.ToSByte(chkActive.Checked);
                auxNewEventAlarm.AffectConfidence   = Convert.ToSByte(chkBIA.Items[0].Selected);
                auxNewEventAlarm.AffectIntegrity    = Convert.ToSByte(chkBIA.Items[1].Selected);
                auxNewEventAlarm.AffectAvailability = Convert.ToSByte(chkBIA.Items[2].Selected);
                auxNewEventAlarm.IdsId = Convert.ToInt32(ddlIDPS.SelectedValue);
                auxNewEventAlarm.IdsSignatureCategoryId = Convert.ToInt32(ddlIDPSSignatures.SelectedValue);

                switch (saveType)
                {
                case 1:     //save
                    if (oEventsAlarm.eventsalarmAdd(auxNewEventAlarm) > 0)
                    {
                        if (gvIntrusionEventsAssigned.Rows.Count > 0)
                        {
                            foreach (GridViewRow rowIntrusion in gvIntrusionEventsAssigned.Rows)
                            {
                                auxIntrusionEventMapping.EventsAlarmId    = Convert.ToInt32(txtEventAlarmId.Text);
                                auxIntrusionEventMapping.IntrusionEventId = Convert.ToInt32(((Label)rowIntrusion.FindControl("intrusionEventsId")).Text);

                                if (oIntrusionEventsMapping.eventsalarm_intrusionevents_mappingAdd(auxIntrusionEventMapping) <= 0)
                                {
                                    lblMessage.Text = "Error al guardar Referencias del Evento [Evento de Intrusion] " + ((Label)rowIntrusion.FindControl("intrusionEventsId")).Text;
                                }
                            }
                        }

                        lblMessage.Text = "Datos guardados correctamente!";
                        clearFields();
                        activateFields(false, true);
                        btnNew.Enabled = true;
                        getEventsAlarmData();
                    }
                    else
                    {
                        lblMessage.Text = "Error al guardar los datos!";
                    }
                    break;

                case 2:     //update
                    auxNewEventAlarm.EventsAlarmId = Convert.ToInt32(txtEventAlarmId.Text);
                    if (oEventsAlarm.eventsalarmUpdate(auxNewEventAlarm))
                    {
                        if (gvIntrusionEventsAssigned.Rows.Count > 0)
                        {
                            foreach (GridViewRow rowIntrusion in gvIntrusionEventsAssigned.Rows)
                            {
                                auxIntrusionEventMapping.EventsAlarmId    = Convert.ToInt32(txtEventAlarmId.Text);
                                auxIntrusionEventMapping.IntrusionEventId = Convert.ToInt32(((Label)rowIntrusion.FindControl("intrusionEventsId")).Text);

                                if (oIntrusionEventsMapping.eventsalarm_intrusionevents_mappingAdd(auxIntrusionEventMapping) <= 0)
                                {
                                    lblMessage.Text = "Error al guardar Referencias del Evento [Evento de Intrusion] " + ((Label)rowIntrusion.FindControl("intrusionEventsId")).Text;
                                }
                            }
                        }

                        lblMessage.Text = "Datos actualizados correctamente!";
                        clearFields();
                        activateFields(false, true);
                        btnSave.Enabled = false;
                        getEventsAlarmData();
                    }
                    else
                    {
                        lblMessage.Text = "Error al guardar los datos!";
                    }
                    break;
                }
            }
            else
            {
                lblMessage.Text = "Error, existen campos sin completar!";
            }
        }
Example #19
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(txtSearch.Text))
            {
                DataTable dttTasks = new DataTable();
                dttTasks.Columns.Add(new DataColumn("taskId", System.Type.GetType("System.Int32")));
                dttTasks.Columns.Add(new DataColumn("datetime", System.Type.GetType("System.DateTime")));
                dttTasks.Columns.Add(new DataColumn("taskTittle", System.Type.GetType("System.String")));
                dttTasks.Columns.Add(new DataColumn("eventsDetectionId", System.Type.GetType("System.Int32")));
                dttTasks.Columns.Add(new DataColumn("taskStatusId", System.Type.GetType("System.Int32")));
                dttTasks.Columns.Add(new DataColumn("statusDescription", System.Type.GetType("System.String")));
                dttTasks.Columns.Add(new DataColumn("userId", System.Type.GetType("System.Int32")));
                dttTasks.Columns.Add(new DataColumn("userName", System.Type.GetType("System.String")));
                dttTasks.Columns.Add(new DataColumn("serverityId", System.Type.GetType("System.Int32")));
                dttTasks.Columns.Add(new DataColumn("sererityDescription", System.Type.GetType("System.String")));
                dttTasks.Columns.Add(new DataColumn("SLAStatus", System.Type.GetType("System.String")));

                tasks              auxtTasks        = new tasks();
                tasksBus           oTasks           = new tasksBus();
                eventsdetectionBus oEventsDetection = new eventsdetectionBus();
                idsBus             oIDPS            = new idsBus();
                eventsalarmBus     oEventsAlarm     = new eventsalarmBus();
                severityBus        oSeverity        = new severityBus();
                taskstatusBus      oTaskStatus      = new taskstatusBus();
                usersBus           oUsers           = new usersBus();

                auxtTasks = oTasks.tasksGetById(Convert.ToInt32(txtSearch.Text));

                if (auxtTasks != null)
                {
                    taskstatus      auxStatus         = new taskstatus();
                    users           auxUser           = new users();
                    eventsdetection auxEventDetection = new eventsdetection();
                    eventsalarm     auxEventAlarm     = new eventsalarm();
                    severity        auxSeverity       = new severity();

                    auxStatus         = oTaskStatus.taskstatusGetById(auxtTasks.TaskStatudId);
                    auxUser           = oUsers.usersGetById(auxtTasks.UserId);
                    auxEventDetection = oEventsDetection.eventsdetectionGetById(auxtTasks.EventsDetectionId);
                    auxEventAlarm     = oEventsAlarm.eventsalarmGetById(auxEventDetection.EventsAlarmId);
                    auxSeverity       = oSeverity.severityGetById(auxEventAlarm.Severity);

                    //resolver SLAStatus

                    dttTasks.Rows.Add(auxtTasks.TaskId,
                                      auxtTasks.DateTime,
                                      auxtTasks.TaskTittle,
                                      auxtTasks.EventsDetectionId,
                                      auxtTasks.TaskStatudId,
                                      auxStatus.TaskStatusDescription,
                                      auxtTasks.UserId,
                                      auxUser.UserName,
                                      auxEventAlarm.Severity,
                                      auxSeverity.SeverityDescription,
                                      "");

                    gvTasks.DataSource = dttTasks;
                    gvTasks.DataBind();
                }
                else
                {
                    lblMessage.Text = "Busqueda sin resultados...";
                }
            }
        }
Example #20
0
        public bool eventsalarmUpdate(eventsalarm eventsalarm)
        {
            eventsalarmImpl oeventsalarmImpl = new eventsalarmImpl();

            return(oeventsalarmImpl.eventsalarmUpdate(eventsalarm));
        }
Example #21
0
        protected void getTaskData(int taskId)
        {
            DataTable dttTask = new DataTable();

            dttTask.Columns.Add(new DataColumn("taskId", System.Type.GetType("System.Int32")));
            dttTask.Columns.Add(new DataColumn("datetime", System.Type.GetType("System.DateTime")));
            dttTask.Columns.Add(new DataColumn("taskTittle", System.Type.GetType("System.String")));
            dttTask.Columns.Add(new DataColumn("eventsDetectionId", System.Type.GetType("System.Int32")));
            dttTask.Columns.Add(new DataColumn("taskStatusId", System.Type.GetType("System.Int32")));
            dttTask.Columns.Add(new DataColumn("statusDescription", System.Type.GetType("System.String")));
            dttTask.Columns.Add(new DataColumn("userId", System.Type.GetType("System.Int32")));
            dttTask.Columns.Add(new DataColumn("userName", System.Type.GetType("System.String")));
            dttTask.Columns.Add(new DataColumn("serverityId", System.Type.GetType("System.Int32")));
            dttTask.Columns.Add(new DataColumn("sererityDescription", System.Type.GetType("System.String")));
            dttTask.Columns.Add(new DataColumn("SLAStatus", System.Type.GetType("System.String")));

            tasks              auxtTasks        = new tasks();
            tasksBus           oTasks           = new tasksBus();
            eventsdetectionBus oEventsDetection = new eventsdetectionBus();
            idsBus             oIDPS            = new idsBus();
            eventsalarmBus     oEventsAlarm     = new eventsalarmBus();
            severityBus        oSeverity        = new severityBus();
            taskstatusBus      oTaskStatus      = new taskstatusBus();
            usersBus           oUsers           = new usersBus();

            auxtTasks = oTasks.tasksGetById(taskId);

            if (auxtTasks != null)
            {
                taskstatus      auxStatus         = new taskstatus();
                users           auxUser           = new users();
                eventsdetection auxEventDetection = new eventsdetection();
                eventsalarm     auxEventAlarm     = new eventsalarm();
                severity        auxSeverity       = new severity();
                string          SLASatus          = "";

                auxStatus         = oTaskStatus.taskstatusGetById(auxtTasks.TaskStatudId);
                auxUser           = oUsers.usersGetById(auxtTasks.UserId);
                auxEventDetection = oEventsDetection.eventsdetectionGetById(auxtTasks.EventsDetectionId);
                auxEventAlarm     = oEventsAlarm.eventsalarmGetById(auxEventDetection.EventsAlarmId);
                auxSeverity       = oSeverity.severityGetById(auxEventAlarm.Severity);

                DateTime deadTime = auxtTasks.DateTime;
                deadTime.AddMinutes(auxSeverity.SLATimeToResponse);
                if (DateTime.Now > deadTime)
                {
                    SLASatus = "Vencido";
                }
                if (DateTime.Now < deadTime)
                {
                    SLASatus = "En término";
                }

                dttTask.Rows.Add(auxtTasks.TaskId,
                                 auxtTasks.DateTime,
                                 auxtTasks.TaskTittle,
                                 auxtTasks.EventsDetectionId,
                                 auxtTasks.TaskStatudId,
                                 auxStatus.TaskStatusDescription,
                                 auxtTasks.UserId,
                                 auxUser.UserName,
                                 auxEventAlarm.Severity,
                                 auxSeverity.SeverityDescription,
                                 SLASatus);

                gvTask.DataSource = dttTask;
                gvTask.DataBind();
            }
        }
Example #22
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(txtSearch.Text))
            {
                DataTable dttEventsDetection = new DataTable();
                dttEventsDetection.Columns.Add(new DataColumn("eventsDetectionId", System.Type.GetType("System.Int32")));
                dttEventsDetection.Columns.Add(new DataColumn("datetime", System.Type.GetType("System.DateTime")));
                dttEventsDetection.Columns.Add(new DataColumn("eventStauts", System.Type.GetType("System.Int32")));
                dttEventsDetection.Columns.Add(new DataColumn("eventStatusDescription", System.Type.GetType("System.String")));
                dttEventsDetection.Columns.Add(new DataColumn("IDSId", System.Type.GetType("System.Int32")));
                dttEventsDetection.Columns.Add(new DataColumn("IDPS", System.Type.GetType("System.String")));
                dttEventsDetection.Columns.Add(new DataColumn("idsName", System.Type.GetType("System.String")));
                dttEventsDetection.Columns.Add(new DataColumn("eventsAlarmId", System.Type.GetType("System.Int32")));
                dttEventsDetection.Columns.Add(new DataColumn("severityId", System.Type.GetType("System.Int32")));
                dttEventsDetection.Columns.Add(new DataColumn("severityDescription", System.Type.GetType("System.String")));
                dttEventsDetection.Columns.Add(new DataColumn("SLATimeToResponse", System.Type.GetType("System.Int32")));
                dttEventsDetection.Columns.Add(new DataColumn("TaskId", System.Type.GetType("System.Int32")));

                eventsdetection    auxEvetnsDetection = new eventsdetection();
                eventsdetectionBus oEventsDetection   = new eventsdetectionBus();

                idsBus         oIDPS        = new idsBus();
                eventsalarmBus oEventsAlarm = new eventsalarmBus();
                severityBus    oSeverity    = new severityBus();
                tasksBus       oTask        = new tasksBus();

                auxEvetnsDetection = oEventsDetection.eventsdetectionGetById(Convert.ToInt32(txtSearch.Text));

                if (auxEvetnsDetection != null)
                {
                    string      strStatus     = "";
                    ids         auxIDPS       = new ids();
                    eventsalarm auxEventAlarm = new eventsalarm();
                    severity    auxSeverity   = new severity();
                    tasks       auxTask       = new tasks();

                    switch (auxEvetnsDetection.EventStatus)
                    {
                    case 1: strStatus = "Pendiente"; break;

                    case 2: strStatus = "En tratamiento"; break;

                    case 3: strStatus = "Cerrado"; break;
                    }

                    auxIDPS       = oIDPS.idsGetById(auxEvetnsDetection.IdsId);
                    auxEventAlarm = oEventsAlarm.eventsalarmGetById(auxEvetnsDetection.EventsAlarmId);
                    auxSeverity   = oSeverity.severityGetById(auxEventAlarm.Severity);
                    auxTask       = oTask.tasksGetByEventsDetectionId(auxEvetnsDetection.EventsDetectionId);

                    dttEventsDetection.Rows.Add(auxEvetnsDetection.EventsDetectionId,
                                                auxEvetnsDetection.DateTime,
                                                auxEvetnsDetection.EventStatus,
                                                strStatus,
                                                auxEvetnsDetection.IdsId,
                                                auxIDPS.IdsIP,
                                                auxIDPS.idsName,
                                                auxEvetnsDetection.EventsAlarmId,
                                                auxSeverity.SeverityId,
                                                auxSeverity.SeverityDescription,
                                                auxSeverity.SLATimeToResponse,
                                                auxTask.TaskId);

                    gvEventsDetection.DataSource = dttEventsDetection;
                    gvEventsDetection.DataBind();
                }
                else
                {
                    lblMessage.Text = "Busqueda sin resultados...";
                }
            }
        }