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; } }
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; } }
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; } }
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; } }
public void soldierInfo_Home_Button3() { nam = name.text; soldnu = soldnum.text; birt = birth.text; soldnu = soldnum.text; affiliatio = affiliation.text; phon = phone.text; user user = new user(); RestClient.Put("https://fir-unity-6f472.firebaseio.com/soldiers/" + soldnu + ".json", user); RestClient.Get <ids>("https://fir-unity-6f472.firebaseio.com/ids.json").Then(response => { ids n2 = new ids(); n2 = response; slist = n2.s; ids n = new ids(); n.s = n2.s + "," + soldnu; RestClient.Put("https://fir-unity-6f472.firebaseio.com/ids.json", n); addButtons(n.s.Split(',')); }); SoldierInfoScreen_Home.SetActive(false); SoldierInfoScreen_ScreenC.SetActive(true); }
void Start() { scr = transform.GetComponent <Screen1>(); RestClient.Get <ids>("https://fir-unity-6f472.firebaseio.com/ids.json").Then(response => { ids n2 = new ids(); n2 = response; createButtons(n2.s.Split(',')); }); RectTransform rt = (RectTransform)content.transform; rt.anchoredPosition = new Vector2(0, 0); }
public int idsAdd(ids ids) { try { return((int)SqlHelper.ExecuteScalar(SqlImplHelper.getConnectionString(), "idsAdd", ids.DatabaseTypeId, ids.IdsTypeId, ids.Active, ids.IdsIP)); } catch (Exception ex) { throw ex; } }
public int idsAdd( ids ids) { try { return (int)SqlHelper.ExecuteScalar(SqlImplHelper.getConnectionString(), "idsAdd", ids.DatabaseTypeId, ids.IdsTypeId, ids.Active, ids.IdsIP); } catch(Exception ex) { throw ex; } }
public DataSet getIDPSSignaturesCategory(int idpsId) { ids auxIDPS = new ids(); idsBus oIDPSBus = new idsBus(); DataSet dtsResult = new DataSet(); string sqlQuery; auxIDPS = oIDPSBus.idsGetById(idpsId); if (auxIDPS != null) { switch (auxIDPS.IdsId) { case 1: //ossec sqlQuery = "SELECT cat_id as SignatureCategoryId, " + " cat_name as SignatureCategoryName " + " FROM Category " + " ORDER by cat_id; "; dtsResult = ExecQueryMySQL(auxIDPS.DatabaseHost, auxIDPS.DatabaseName, auxIDPS.DatabaseUser, auxIDPS.DatabasePass, sqlQuery); break; case 2: //snort case 3: //suricata sqlQuery = "SELECT sig_class_id as SignatureCategoryId, " + " sig_class_name as SignatureCategoryName " + " FROM sig_class " + " ORDER by sig_class_id; "; dtsResult = ExecQueryMySQL(auxIDPS.DatabaseHost, auxIDPS.DatabaseName, auxIDPS.DatabaseUser, auxIDPS.DatabasePass, sqlQuery); break; case 4: //bro //TODO break; } } return(dtsResult); }
//Save input ids (used in logging) under a unique Id... public void saveIds(int uniqueId, string sessionId, string userIpAddress, string domainName) { ids myIds = new ids(); myIds.sessionId = sessionId; myIds.userIpAddress = userIpAddress; myIds.domainName = domainName; lock (lockObject) { if (!m_dictUniqueIdsToIds.ContainsKey(uniqueId)) { m_dictUniqueIdsToIds.Add(uniqueId, myIds); } } }
public void getIds(HttpContext httpcontextCurrent, ref string sessionId, ref string userIpAddress, ref string domainName) { if (null == httpcontextCurrent) { //If no http context (running in an async task) check the dictionary for the 'Call Context' unique id... if (null != CallContext.LogicalGetData("uniqueId")) { //'Call Context' unique id found - retrieve associated values... int uniqueId = (int)CallContext.LogicalGetData("uniqueId"); lock (lockObject) { if (m_dictUniqueIdsToIds.ContainsKey(uniqueId)) { ids myIds = m_dictUniqueIdsToIds[uniqueId]; sessionId = myIds.sessionId; userIpAddress = myIds.userIpAddress; domainName = myIds.domainName; } } } return; //Retun early... } //Retrieve Session Id var httpContext = new HttpContextWrapper(httpcontextCurrent); sessionId = httpContext.Session.SessionID; //Retrieve user's IP address and domain name... userIpAddress = ContextUtil.GetIPAddress(System.Web.HttpContext.Current); try { IPHostEntry host = Dns.GetHostEntry(userIpAddress); domainName = host.HostName; } catch (Exception exceptionDNS) { domainName = exceptionDNS.Message; } //Processing complete - return return; }
public int idsAdd(ids ids) { try { return((int)SqlHelper.ExecuteScalar(SqlImplHelper.getConnectionString(), "idsAdd", ids.idsName, ids.DatabaseTypeId, ids.IdsTypeId, ids.Active, ids.IdsIP, ids.DatabaseUser, ids.DatabasePass, ids.DatabaseName, ids.DatabaseHost, ids.IdsVersion)); } catch (Exception ex) { throw ex; } }
/// <summary> /// Initialize a new DataStructure. Mostly just need the path info /// here. Reads in the data files into the data structures. /// </summary> /// <param name="path">Example: "hw12data\digitsDataset"</param> /// <param name="ans">Example: "emailOutput1.csv"</param> /// <param name="dataFile">Example: trainFeatures.csv</param> /// <param name="labelFile">Example: trainLabels.csv</param> public DataStructure(String path, String dataFile, String labelFile, String ans, int problem_part) { part = problem_part; train_d = new ids(null); val_d = new ids(null); PATH = path; Func <String[], Double[]> c2 = (x) => { return((from y in x select Convert.ToDouble(y)).ToArray()); }; String dataF = dataFile; String lblF = labelFile; String ansF = ans; writer = new StreamWriter(ans); using (StreamReader va_l = new StreamReader(PATH + "\\" + lblF)) using (StreamReader va_f = new StreamReader(PATH + "\\" + dataF)) using (StreamReader tr_l = new StreamReader(PATH + "\\trainLabels.csv")) using (StreamReader tr_f = new StreamReader(PATH + "\\trainFeatures.csv")) { String line; while ((line = tr_f.ReadLine()) != null) { Double[] feature = c2(line.Split(',')); String label = tr_l.ReadLine(); train_d.feats.Add(feature); train_d.labels.Add(label); train_d.comb.Add(new KeyValuePair <double[], string>(feature, label)); } while ((line = va_f.ReadLine()) != null) { Double[] feature = c2(line.Split(',')); String label = va_l.ReadLine(); val_d.feats.Add(feature); val_d.labels.Add(label); val_d.comb.Add(new KeyValuePair <double[], string>(feature, label)); } } }
public bool idsUpdate(ids ids) { try { int update = SqlHelper.ExecuteNonQuery(SqlImplHelper.getConnectionString(), "idsUpdate", ids.IdsId, ids.DatabaseTypeId, ids.IdsTypeId, ids.Active, ids.IdsIP); if (update > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } }
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.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(); } return NewEnt; } catch(Exception ex) { throw ex; } }
protected void btnSave_Click(object sender, EventArgs e) { ids auxNewIDPS = new ids(); idsBus oIDS = new idsBus(); bool needRequiredFields = false; int saveType = 0; if (btnNew.Enabled) { saveType = 2; } if (!btnNew.Enabled) { saveType = 1; } if (String.IsNullOrEmpty(txtIDPSName.Text)) { needRequiredFields = true; } if (String.IsNullOrEmpty(txtIP.Text)) { needRequiredFields = true; } if (!needRequiredFields) { auxNewIDPS.idsName = txtIDPSName.Text; auxNewIDPS.IdsTypeId = Convert.ToInt32(ddlIDPSType.SelectedValue); auxNewIDPS.DatabaseTypeId = Convert.ToInt32(ddlDatabaseType.SelectedValue); auxNewIDPS.IdsIP = txtIP.Text; auxNewIDPS.DatabaseUser = txtUserDataBase.Text; auxNewIDPS.DatabasePass = txtPassDataBase.Text; auxNewIDPS.DatabaseName = txtSourceDataBase.Text; auxNewIDPS.DatabaseHost = txtHostDatabase.Text; auxNewIDPS.IdsVersion = txtIDPSVersion.Text; auxNewIDPS.Active = Convert.ToSByte(chkActive.Checked); switch (saveType) { case 1: //save if (oIDS.idsAdd(auxNewIDPS) > 0) { lblMessage.Text = "Datos guardados correctamente!"; clearFields(); activateFields(false, true); btnNew.Enabled = true; getIDPSData(); } else { lblMessage.Text = "Error al guardar los datos!"; } break; case 2: //update auxNewIDPS.IdsId = Convert.ToInt32(txtIDPSId.Text); if (oIDS.idsUpdate(auxNewIDPS)) { lblMessage.Text = "Datos actualizados correctamente!"; clearFields(); activateFields(false, true); btnSave.Enabled = false; getIDPSData(); } else { lblMessage.Text = "Error al guardar los datos!"; } break; } } else { lblMessage.Text = "Error, existen campos sin completar!"; } }
public DataTable getIDPSData() { DataSet dtsResult = new DataSet(); DataTable dttResult = new DataTable(); dttResult.Columns.Add(new DataColumn("IDPSId", System.Type.GetType("System.Int32"))); dttResult.Columns.Add(new DataColumn("EventsAlarmId", System.Type.GetType("System.Int32"))); dttResult.Columns.Add(new DataColumn("IDPSEventId", System.Type.GetType("System.Int32"))); dttResult.Columns.Add(new DataColumn("datetime ", System.Type.GetType("System.String"))); dttResult.Columns.Add(new DataColumn("description", System.Type.GetType("System.String"))); dttResult.Columns.Add(new DataColumn("source ", System.Type.GetType("System.String"))); List <eventsalarm> lstEventsAlarm = new List <eventsalarm>(); eventsalarmBus oEventsAlarm = new eventsalarmBus(); ids auxIDPS = new ids(); idsBus oIDPSBus = new idsBus(); lstEventsAlarm = oEventsAlarm.eventsalarmGetAll(); if (lstEventsAlarm.Count > 0) { foreach (eventsalarm row in lstEventsAlarm) { switch (row.IdsId) { case 1: //ossec auxIDPS = oIDPSBus.idsGetById(row.IdsId); dtsResult = requestOSSECEvents(auxIDPS.DatabaseHost, auxIDPS.DatabaseName, auxIDPS.DatabaseUser, auxIDPS.DatabasePass, row.IdsSignatureCategoryId); if (dtsResult.Tables[0].Rows.Count > 0) { foreach (DataRow rowResult in dtsResult.Tables[0].Rows) { dttResult.Rows.Add(row.IdsId, row.EventsAlarmId, Convert.ToInt32(rowResult[0].ToString()), rowResult[1].ToString(), rowResult[2].ToString(), rowResult[3].ToString()); } } break; case 2: //snort case 3: //suricata auxIDPS = oIDPSBus.idsGetById(row.IdsId); dtsResult = requestbarnyard2Events(auxIDPS.DatabaseHost, auxIDPS.DatabaseName, auxIDPS.DatabaseUser, auxIDPS.DatabasePass, row.IdsSignatureCategoryId); if (dtsResult.Tables[0].Rows.Count > 0) { foreach (DataRow rowResult in dtsResult.Tables[0].Rows) { dttResult.Rows.Add(row.IdsId, row.EventsAlarmId, Convert.ToInt32(rowResult[0].ToString()), rowResult[1].ToString(), rowResult[2].ToString(), rowResult[3].ToString()); } } break; case 4: //bro auxIDPS = oIDPSBus.idsGetById(row.IdsId); dtsResult = requestBroEvents(auxIDPS.DatabaseHost, auxIDPS.DatabaseName, auxIDPS.DatabaseUser, auxIDPS.DatabasePass, row.IdsSignatureCategoryId); if (dtsResult.Tables[0].Rows.Count > 0) { foreach (DataRow rowResult in dtsResult.Tables[0].Rows) { dttResult.Rows.Add(row.IdsId, row.EventsAlarmId, Convert.ToInt32(rowResult[0].ToString()), rowResult[1].ToString(), rowResult[2].ToString(), rowResult[3].ToString()); } } break; } } } return(dttResult); }
public bool idsUpdate( ids ids) { try { int update = SqlHelper.ExecuteNonQuery(SqlImplHelper.getConnectionString(), "idsUpdate", ids.IdsId, ids.DatabaseTypeId, ids.IdsTypeId, ids.Active, ids.IdsIP); if (update > 0) { return true; } else { return false; } } catch(Exception ex) { throw ex; } }
public int idsAdd(ids ids) { idsImpl oidsImpl = new idsImpl(); return(oidsImpl.idsAdd(ids)); }
public int idsAdd(ids ids) { idsImpl oidsImpl = new idsImpl(); return oidsImpl.idsAdd( ids); }
WritePropertyMultipleAsync(ids, attributeValues).GetAwaiter().GetResult();
protected void gvIDPS_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow row = gvIDPS.SelectedRow; ids auxIDPS = new ids(); idsBus oIDPS = new idsBus(); try { ddlIDPSType.SelectedValue = ((Label)row.FindControl("idsTypeId")).Text; ddlDatabaseType.SelectedValue = ((Label)row.FindControl("databaseTypeId")).Text; } catch { } if ((Label)row.FindControl("idsId") != null) { txtIDPSId.Text = ((Label)row.FindControl("idsId")).Text; } else { txtIDPSId.Text = ""; } if ((Label)row.FindControl("idsName") != null) { txtIDPSName.Text = ((Label)row.FindControl("idsName")).Text; } else { txtIDPSName.Text = ""; } if ((Label)row.FindControl("idsVersion") != null) { txtIDPSVersion.Text = ((Label)row.FindControl("idsVersion")).Text; } else { txtIDPSVersion.Text = ""; } if ((Label)row.FindControl("idsIP") != null) { txtIP.Text = ((Label)row.FindControl("idsIP")).Text; } else { txtIP.Text = ""; } if ((CheckBox)row.FindControl("active") != null) { chkActive.Checked = ((CheckBox)row.FindControl("active")).Checked; } else { chkActive.Checked = false; } auxIDPS = oIDPS.idsGetById(Convert.ToInt32(txtIDPSId.Text)); txtUserDataBase.Text = auxIDPS.DatabaseUser; txtPassDataBase.Text = auxIDPS.DatabasePass; txtSourceDataBase.Text = auxIDPS.DatabaseName; txtHostDatabase.Text = auxIDPS.DatabaseHost; activateFields(true, false); btnSave.Enabled = true; }
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 idsUpdate(ids ids) { idsImpl oidsImpl = new idsImpl(); return(oidsImpl.idsUpdate(ids)); }
public bint(ids l, ids r) { left = l; right = r isLeaf = l == null && r == null; }
public bool idsUpdate(ids ids) { idsImpl oidsImpl = new idsImpl(); return oidsImpl.idsUpdate( ids); }
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..."; } } }