protected void GVJefesAD_RowCommand(object sender, GridViewCommandEventArgs e) { string correoJefe = e.CommandArgument.ToString(); if (e.CommandName == "correos") { try { foreach (GridViewRow item in GVjefesAgencias.Rows) { if (item.Cells[1].Text.Equals(correoJefe)) { throw new Exception("Ya existe jefe de agencia."); } } DataTable vData = new DataTable(); DataTable vDatos = (DataTable)Session["NotifJefeAgenciaATMCorrectivo"]; DataTable vDatosJefes = (DataTable)Session["ATM_BUSCAR_JEFE_CORRECTIVO"]; string CorreoJefe = correoJefe; String vNombre = ""; String vApellido = ""; DataRow[] result = vDatosJefes.Select("mail = '" + CorreoJefe + "'"); foreach (DataRow row in result) { if (row["mail"].ToString().Contains(CorreoJefe)) { vNombre = row["givenName"].ToString(); vApellido = row["sn"].ToString(); } } vData.Columns.Add("Correo"); vData.Columns.Add("Nombre"); vData.Columns.Add("Apellido"); //vData.Columns.Add("Nombre"); if (vDatos == null) { vDatos = vData.Clone(); } if (vDatos != null) { vDatos.Rows.Add(CorreoJefe, vNombre, vApellido); } GVjefesAgencias.DataSource = vDatos; GVjefesAgencias.DataBind(); Session["NotifJefeAgenciaATMCorrectivo"] = vDatos; } catch (Exception Ex) { // DLLTecnicoParticipante.SelectedValue = "0"; Mensaje(Ex.Message, WarningType.Danger); } } }
void LimpiarNotificacion() { Session["ATM_BUSCAR_JEFE_CORRECTIVO"] = null; Session["NotifJefeAgenciaATMCorrectivo"] = null; GVjefesAgencias.DataSource = null; GVjefesAgencias.DataBind(); GVJefesAD.DataSource = null; GVJefesAD.DataBind(); Session["NOTIFCORRECTIVO"] = null; DLLtecResponsable.Items.Clear(); txtHrInicioMant.Text = string.Empty; txtHrFinMant.Text = string.Empty; txtATM.Text = string.Empty; txtsysaid.Text = string.Empty; txtUbicacionATM.Text = string.Empty; txtdireccion.Text = string.Empty; txtsucursalNotif.Text = string.Empty; txtipNotif.Text = string.Empty; txtzonaNotif.Text = string.Empty; txtidentidadTecResponsable.Text = string.Empty; }
protected void GVjefesAgencias_RowCommand(object sender, GridViewCommandEventArgs e) { DataTable vDatos = (DataTable)Session["NotifJefeAgenciaATMCorrectivo"]; if (e.CommandName == "eliminar") { String vCorreo = e.CommandArgument.ToString(); if (Session["NotifJefeAgenciaATMCorrectivo"] != null) { DataRow[] result = vDatos.Select("Correo = '" + vCorreo + "'"); foreach (DataRow row in result) { if (row["Correo"].ToString().Contains(vCorreo)) { vDatos.Rows.Remove(row); } } } } GVjefesAgencias.DataSource = vDatos; GVjefesAgencias.DataBind(); Session["NotifJefeAgenciaATMCorrectivo"] = vDatos; }