void Recetas_InitComplete(object sender, EventArgs e) { oblColonias = new MedNeg.Colonias.BlColonias(); oblPoblaciones = new MedNeg.Poblaciones.BlPoblaciones(); oblMunicipios = new MedNeg.Municipios.BlMunicipios(); oblEstados = new MedNeg.Estados.BlEstados(); oblLineasCredito = new MedNeg.LineasCredito.BlLineasCredito(); oblProductos = new MedNeg.Productos.BlProductos(); blRecetas = new BlRecetas(); cargaDdlTipos(); txbFecha.Text = DateTime.Today.ToShortDateString(); }
//Lista de contactos del cliente //List<MedDAL.DAL.clientes_contacto> lstContactosNuevos, lstContactosEliminar, lstContactosGriedView, lstContactosBD; #endregion #region Configuración de inicio protected void Page_Load(object sender, EventArgs e) { //Asignar titulo de modulo lblNombreModulo = (Label)Master.FindControl("lblNombreModulo"); lblNombreModulo.Text = "Clientes"; //Cargar permisos Hashtable htbPermisos = (Hashtable)Session["permisos"]; char cPermiso = 'N'; //cPermiso = (char)htbPermisos["vendedores"]; try { cPermiso = (char)htbPermisos["clientes"]; //Obtener los controles de master. imbNuevo = (ImageButton)Master.FindControl("imgBtnNuevo"); imbNuevo.Click += new ImageClickEventHandler(this.imbNuevo_Click); imbEditar = (ImageButton)Master.FindControl("imgBtnEditar"); imbEditar.Click += new ImageClickEventHandler(this.imbEditar_Click); imbEliminar = (ImageButton)Master.FindControl("imgBtnEliminar"); imbEliminar.Click += new ImageClickEventHandler(this.imbEliminar_Click); imbMostrar = (ImageButton)Master.FindControl("imgBtnMostrar"); imbMostrar.Click += new ImageClickEventHandler(this.imbMostrar_Click); imbImprimir = (ImageButton)Master.FindControl("imgBtnImprimir"); imbImprimir.Click += new ImageClickEventHandler(this.imbImprimir_Click); imbReportes = (ImageButton)Master.FindControl("imgBtnReportes"); imbReportes.Click += new ImageClickEventHandler(this.imbReportes_Click); imbAceptar = (ImageButton)Master.FindControl("imgBtnAceptar"); imbAceptar.Click += new ImageClickEventHandler(this.imbAceptar_Click); imbAceptar.ValidationGroup = "vgCliente"; imbCancelar = (ImageButton)Master.FindControl("imgBtnCancelar"); imbCancelar.Click += new ImageClickEventHandler(this.imbCancelar_Click); rdbTipo = (RadioButton)Master.FindControl("rdbFiltro1"); rdbTipo.Text = "Tipo"; rdbClave = (RadioButton)Master.FindControl("rdbFiltro2"); rdbClave.Text = "Clave1"; rdbNombre = (RadioButton)Master.FindControl("rdbFiltro3"); rdbNombre.Text = "Nombre"; btnBuscar = (Button)Master.FindControl("btnBuscar"); btnBuscar.Click += new EventHandler(this.btnBuscar_Click); txbBuscar = (TextBox)Master.FindControl("txtBuscar"); //GT 0175 imbReportes = (ImageButton)Master.FindControl("imgBtnReportes"); imbReportes.Click += new ImageClickEventHandler(this.imbReportes_Click); //Deshabilitar botones del toolbar switch (cPermiso) { case 'T': break; case 'E': DesactivarEdicionEliminacion(); break; case 'L': DesactivarEdicionEliminacion(); DesactivarNuevo(); break; } //Inicializacion de objetos oblColonias = new MedNeg.Colonias.BlColonias(); oblPoblaciones = new MedNeg.Poblaciones.BlPoblaciones(); oblMunicipios = new MedNeg.Municipios.BlMunicipios(); oblEstados = new MedNeg.Estados.BlEstados(); oblTipos = new MedNeg.Tipos.BlTipos(); oblBitacora = new MedNeg.Bitacora.BlBitacora(); oblCliente = new MedNeg.BlClientes.BlClientes(); //lstContactosGriedView = new List<MedDAL.DAL.clientes_contacto>(); gdvContactosCliente.Visible = true; gdvContactosCliente.ShowHeader = true; gdvContactosCliente.DataSource = ((List<MedDAL.DAL.clientes_contacto>)Session["lstContactosDB"]); gdvContactosCliente.DataBind(); gdvContactosCliente.DataKeyNames = new String[] { "idContacto" }; CargarCamposEditables(); if (!IsPostBack) { MostrarAreaTrabajo(false, false); Session["lstContactosDB"] = new List<MedDAL.DAL.clientes_contacto>(); Session["gridviewdatasource"] = null; Session["ajustecontrolesreporte"] = false; Session["resultadoquery"] = ""; ViewState["direccionsorting"] = System.Web.UI.WebControls.SortDirection.Ascending; Session["reporteactivo"] = 0; Session["reportdocument"] = ""; Session["titulo"] = ""; //GT 0175 ConfigurarMenuBotones(true, true, false, false, false, false, true, true); } if ((bool)Session["ajustecontrolesreporte"] && !(bool)Session["ajustecontrolesreportecandado"]) { CargarListaReportes(); Session["ajustecontrolesreporte"] = false; } } catch (NullReferenceException) { //this.Page.LoadControl("~/Login.aspx"); if (!ClientScript.IsStartupScriptRegistered("alertsession")) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alertsession", "alertarSesion();", true); } MostrarAreaTrabajo(false, false); Site1 oPrincipal = (Site1)this.Master; oPrincipal.DeshabilitarControles(this); oPrincipal.DeshabilitarControles(); } }
protected void Page_Load(object sender, EventArgs e) { Hashtable htbPermisos = (Hashtable)Session["permisos"]; char cPermiso = 'N'; try { #region Interfaz cPermiso = (char)htbPermisos["proveedores"]; imbNuevo = (ImageButton)Master.FindControl("imgBtnNuevo"); imbNuevo.Click += new ImageClickEventHandler(this.imbNuevo_Click); imbEditar = (ImageButton)Master.FindControl("imgBtnEditar"); imbEditar.Click += new ImageClickEventHandler(this.imbEditar_Click); imbEliminar = (ImageButton)Master.FindControl("imgBtnEliminar"); imbEliminar.Click += new ImageClickEventHandler(this.imbEliminar_Click); imbMostrar = (ImageButton)Master.FindControl("imgBtnMostrar"); imbMostrar.Click += new ImageClickEventHandler(this.imbMostrar_Click); imbImprimir = (ImageButton)Master.FindControl("imgBtnImprimir"); imbImprimir.Click += new ImageClickEventHandler(this.imbImprimir_Click); imbAceptar = (ImageButton)Master.FindControl("imgBtnAceptar"); imbAceptar.Click += new ImageClickEventHandler(this.imbAceptar_Click); imbAceptar.ValidationGroup = "Proveedores"; imbCancelar = (ImageButton)Master.FindControl("imgBtnCancelar"); imbCancelar.Click += new ImageClickEventHandler(this.imbCancelar_Click); rdbTipos = (RadioButton)Master.FindControl("rdbFiltro1"); rdbTipos.Text = "Tipo"; rdbClave = (RadioButton)Master.FindControl("rdbFiltro2"); rdbClave.Text = "Clave"; rdbNombre = (RadioButton)Master.FindControl("rdbFiltro3"); rdbNombre.Text = "Nombre"; btnBuscar = (Button)Master.FindControl("btnBuscar"); btnBuscar.Click += new EventHandler(this.btnBuscar_Click); txbBuscar = (TextBox)Master.FindControl("txtBuscar"); lblNombreModulo = (Label)Master.FindControl("lblNombreModulo"); lblNombreModulo.Text = "Proveedores"; //GT 0175 imbReportes = (ImageButton)Master.FindControl("imgBtnReportes"); imbReportes.Click += new ImageClickEventHandler(this.imbReportes_Click); switch (cPermiso) { case 'T': break; case 'E': DesactivarEdicionEliminacion(); break; case 'L': DesactivarEdicionEliminacion(); DesactivarNuevo(); break; } #endregion oblProveedores = new MedNeg.Proveedores.BlProveedores(); oblProveedoresContactos = new MedNeg.ProveedoresContactos.BlProveedoresContactos(); oblBitacora = new MedNeg.Bitacora.BlBitacora(); oblCamposEditables = new MedNeg.CamposEditables.BlCamposEditables(); oblColonias = new MedNeg.Colonias.BlColonias(); oblEstados = new MedNeg.Estados.BlEstados(); oblMunicipios = new MedNeg.Municipios.BlMunicipios(); oblPoblaciones = new MedNeg.Poblaciones.BlPoblaciones(); oblTipos = new MedNeg.Tipos.BlTipos(); if (!IsPostBack) { Session["lstproveedorescontactos"] = new List <MedDAL.DAL.proveedores_contactos>(); Session["provedoresaccion"] = 1; CargarFormulario(false); upnForm.Visible = false; pnlFiltroReportes.Visible = false; Session["resultadoquery"] = ""; ViewState["direccionsorting"] = System.Web.UI.WebControls.SortDirection.Ascending; Session["reporteactivo"] = 0; Session["reportdocument"] = ""; Session["titulo"] = ""; //GT 0175 ConfigurarMenuBotones(true, true, false, false, false, false, true, true); } gdvContactos.Visible = true; gdvContactos.ShowHeader = true; gdvContactos.DataSource = ((List <MedDAL.DAL.proveedores_contactos>)Session["lstproveedorescontactos"]); gdvContactos.DataBind(); gdvContactos.DataKeyNames = new String[] { "idContactoProveedor" }; } catch (NullReferenceException) { if (!ClientScript.IsStartupScriptRegistered("alertsession")) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alertsession", "alertarSesion();", true); } upnForm.Visible = false; pnlFiltroReportes.Visible = false; Site1 oPrincipal = (Site1)this.Master; oPrincipal.DeshabilitarControles(this); oPrincipal.DeshabilitarControles(); } }
protected void Page_Load(object sender, EventArgs e) { blRecetas = new BlRecetas(); Hashtable htbPermisos = (Hashtable)Session["permisos"]; char cPermiso = 'N'; try { Master.FindControl("btnReportes").Visible = false; cPermiso = (char)htbPermisos["recetas"]; oblColonias = new MedNeg.Colonias.BlColonias(); oblPoblaciones = new MedNeg.Poblaciones.BlPoblaciones(); oblMunicipios = new MedNeg.Municipios.BlMunicipios(); oblEstados = new MedNeg.Estados.BlEstados(); imbAceptar = (ImageButton)Master.FindControl("imgBtnAceptar"); imbAceptar.Click += new ImageClickEventHandler(imbAceptar_Click); imbMostrar = (ImageButton)Master.FindControl("imgBtnMostrar"); imbMostrar.Click += new ImageClickEventHandler(imbMostrar_Click); imbNuevo = (ImageButton)Master.FindControl("imgBtnNuevo"); imbNuevo.Click += new ImageClickEventHandler(imbNuevo_Click); imbEditar = (ImageButton)Master.FindControl("imgBtnEditar"); imbEditar.Click += new ImageClickEventHandler(imbEditar_Click); imbImprimir = (ImageButton)Master.FindControl("imgBtnImprimir"); imbImprimir.Click += new ImageClickEventHandler(imbImprimir_Click); imbCancelar = (ImageButton)Master.FindControl("imgBtnCancelar"); imbCancelar.Click += new ImageClickEventHandler(this.imbCancelar_Click); rdbFolio = (RadioButton)Master.FindControl("rdbFiltro1"); rdbFolio.Text = "Folio"; rdbTipo = (RadioButton)Master.FindControl("rdbFiltro2"); rdbTipo.Text = "Tipo"; rdbFecha = (RadioButton)Master.FindControl("rdbFiltro3"); rdbFecha.Text = "Fecha"; rdbFecha.AutoPostBack = true; btnBuscar = (Button)Master.FindControl("btnBuscar"); btnBuscar.Click += new EventHandler(btnBuscar_Click); txbBuscar = (TextBox)Master.FindControl("txtBuscar"); lblNombreModulo = (Label)Master.FindControl("lblNombreModulo"); lblNombreModulo.Text = "Recetas"; lblAvisosVendedores.Text = ""; //GT 0175 imbReportes = (ImageButton)Master.FindControl("imgBtnReportes"); imbReportes.Click += new ImageClickEventHandler(this.imbReportes_Click); oCalendarExtender = new AjaxControlToolkit.CalendarExtender(); oCalendarExtender.TargetControlID = "txbBuscar"; oblBitacoraFaltantes = new MedNeg.BitacoraFaltantes.BlBitacoraFaltantes(); oblRecetasPartidaFaltantes = new MedNeg.RecetasPartidaFaltantes.BlRecetasPartidaFaltantes(); oblRecetas = new BlRecetas(); oblProductos = new MedNeg.Productos.BlProductos(); txbCantRecetada.TextChanged += new EventHandler(this.txbCantRecetada_TextChanged); txbCantSurtida.TextChanged += new EventHandler(this.txbCantSurtida_TextChanged); if (!IsPostBack) { oCalendarExtender.Enabled = false; user = blRecetas.buscarUsuario(Session["usuario"].ToString()); Session["lstrecetaspartida"] = new List<MedDAL.DAL.recetas_partida>(); Session["lstrecetaspartidaedicion"] = new List<MedDAL.DAL.recetas_partida>(); lProductos = new List<Producto>(); Session["resultadoquery"] = ""; ViewState["direccionsorting"] = System.Web.UI.WebControls.SortDirection.Ascending; Session["recetasIdCliente"] = 0; Session["recetasIdCausesCie"] = null; Session["reporteactivo"] = 0; Session["reportdocument"] = ""; Session["titulo"] = ""; estadoActual = 0; //GT 0175 ConfigurarMenuBotones(true, true, false, false, false, false, true, true); } dgvPartidaDetalle.DataSource = ((List<MedDAL.DAL.recetas_partida>)Session["lstrecetaspartida"]); dgvPartidaDetalle.DataBind(); if (estadoActual == 2) { int iContador = ((List<MedDAL.DAL.recetas_partida>)Session["lstrecetaspartida"]).Count - ((List<MedDAL.DAL.recetas_partida>)Session["lstrecetaspartidaedicion"]).Count; int i = 0; foreach (GridViewRow oRow in dgvPartidaDetalle.Rows) { oRow.Cells[9].Controls.Clear(); i++; if (i == iContador) break; } } gdvContactosCliente.DataSource = ((List<MedDAL.DAL.clientes_contacto>)Session["lstContactosDB"]); gdvContactosCliente.DataBind(); gdvContactosCliente.DataKeyNames = new String[] { "idContacto" }; } catch (NullReferenceException) { if (!ClientScript.IsStartupScriptRegistered("alertsession")) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alertsession", "alertarSesion();", true); } divFormulario.Visible = false; divListado.Visible = false; Site1 oPrincipal = (Site1)this.Master; oPrincipal.DeshabilitarControles(this); oPrincipal.DeshabilitarControles(); } }
protected void Page_Load(object sender, EventArgs e) { Hashtable htbPermisos = (Hashtable)Session["permisos"]; char cPermiso = 'N'; try { #region Interfaz cPermiso = (char)htbPermisos["almacenes"]; imbNuevo = (ImageButton)Master.FindControl("imgBtnNuevo"); imbNuevo.Click += new ImageClickEventHandler(this.imbNuevo_Click); imbEditar = (ImageButton)Master.FindControl("imgBtnEditar"); imbEditar.Click += new ImageClickEventHandler(this.imbEditar_Click); imbEliminar = (ImageButton)Master.FindControl("imgBtnEliminar"); imbEliminar.Click += new ImageClickEventHandler(this.imbEliminar_Click); imbMostrar = (ImageButton)Master.FindControl("imgBtnMostrar"); imbMostrar.Click += new ImageClickEventHandler(this.imbMostrar_Click); imbImprimir = (ImageButton)Master.FindControl("imgBtnImprimir"); imbImprimir.Click += new ImageClickEventHandler(this.imbImprimir_Click); imbAceptar = (ImageButton)Master.FindControl("imgBtnAceptar"); imbAceptar.Click += new ImageClickEventHandler(this.imbAceptar_Click); imbAceptar.ValidationGroup = "Almacenes"; imbCancelar = (ImageButton)Master.FindControl("imgBtnCancelar"); imbCancelar.Click += new ImageClickEventHandler(this.imbCancelar_Click); rdbTipo = (RadioButton)Master.FindControl("rdbFiltro1"); rdbTipo.Text = "Tipo"; rdbClave = (RadioButton)Master.FindControl("rdbFiltro2"); rdbClave.Text = "Clave"; rdbNombre = (RadioButton)Master.FindControl("rdbFiltro3"); rdbNombre.Text = "Nombre"; btnBuscar = (Button)Master.FindControl("btnBuscar"); btnBuscar.Click += new EventHandler(this.btnBuscar_Click); txbBuscar = (TextBox)Master.FindControl("txtBuscar"); lblNombreModulo = (Label)Master.FindControl("lblNombreModulo"); lblNombreModulo.Text = "Almacenes"; //GT 0175 imbReportes = (ImageButton)Master.FindControl("imgBtnReportes"); imbReportes.Click += new ImageClickEventHandler(this.imbReportes_Click); switch (cPermiso) { case 'T': break; case 'E': DesactivarEdicionEliminacion(); break; case 'L': DesactivarEdicionEliminacion(); DesactivarNuevo(); break; } #endregion oblAlmacenes = new MedNeg.Almacenes.BlAlmacenes(); oblAlmacenesContactos = new MedNeg.AlmacenesContactos.BlAlmacenesContactos(); oblColonias = new MedNeg.Colonias.BlColonias(); oblPoblaciones = new MedNeg.Poblaciones.BlPoblaciones(); oblMunicipios = new MedNeg.Municipios.BlMunicipios(); oblEstados = new MedNeg.Estados.BlEstados(); oblBitacora = new MedNeg.Bitacora.BlBitacora(); oblCamposEditables = new MedNeg.CamposEditables.BlCamposEditables(); oblTipos = new MedNeg.Tipos.BlTipos(); if (!IsPostBack) { Session["lstalmacenescontactos"] = new List<MedDAL.DAL.almacenes_contactos>(); Session["almacenesaccion"] = 0; //CargarFormulario(false); upnForm.Visible = false; pnlFiltroReportes.Visible = false; Session["resultadoquery"] = ""; ViewState["direccionsorting"] = System.Web.UI.WebControls.SortDirection.Ascending; Session["reporteactivo"] = 0; Session["reportdocument"] = ""; Session["titulo"] = ""; //GT 0175 ConfigurarMenuBotones(true, true, false, false, false, false, true, true); } gdvContactos.Visible = true; gdvContactos.ShowHeader = true; gdvContactos.DataSource = ((List<MedDAL.DAL.almacenes_contactos>)Session["lstalmacenescontactos"]); gdvContactos.DataBind(); gdvContactos.DataKeyNames = new String[] { "idContacto" }; } catch (NullReferenceException) { if (!ClientScript.IsStartupScriptRegistered("alertsession")) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alertsession", "alertarSesion();", true); } upnForm.Visible = false; pnlLista.Visible = false; pnlFiltroReportes.Visible = false; Site1 oPrincipal = (Site1)this.Master; oPrincipal.DeshabilitarControles(this); oPrincipal.DeshabilitarControles(); } }
protected void Page_Load(object sender, EventArgs e) { //Asignar titulo de modulo lblNombreModulo = (Label)Master.FindControl("lblNombreModulo"); lblNombreModulo.Text = "Vendedores"; //Cargar permisos Hashtable htbPermisos = (Hashtable)Session["permisos"]; char cPermiso = 'N'; try { //Obtener los controles de master. cPermiso = (char)htbPermisos["vendedores"]; imbNuevo = (ImageButton)Master.FindControl("imgBtnNuevo"); imbNuevo.Click += new ImageClickEventHandler(this.imbNuevo_Click); imbEditar = (ImageButton)Master.FindControl("imgBtnEditar"); imbEditar.Click += new ImageClickEventHandler(this.imbEditar_Click); imbEliminar = (ImageButton)Master.FindControl("imgBtnEliminar"); imbEliminar.Click += new ImageClickEventHandler(this.imbEliminar_Click); imbMostrar = (ImageButton)Master.FindControl("imgBtnMostrar"); imbMostrar.Click += new ImageClickEventHandler(this.imbMostrar_Click); imbImprimir = (ImageButton)Master.FindControl("imgBtnImprimir"); imbImprimir.Click += new ImageClickEventHandler(this.imbImprimir_Click); imbReportes = (ImageButton)Master.FindControl("imgBtnReportes"); imbReportes.Click += new ImageClickEventHandler(this.imbReportes_Click); imbAceptar = (ImageButton)Master.FindControl("imgBtnAceptar"); imbAceptar.Click += new ImageClickEventHandler(this.imbAceptar_Click); imbAceptar.ValidationGroup = "vendedorVG"; imbCancelar = (ImageButton)Master.FindControl("imgBtnCancelar"); imbCancelar.Click += new ImageClickEventHandler(this.imbCancelar_Click); rdbTipo = (RadioButton)Master.FindControl("rdbFiltro1"); rdbTipo.Text = "Tipo"; rdbClave = (RadioButton)Master.FindControl("rdbFiltro2"); rdbClave.Text = "Clave"; rdbNombre = (RadioButton)Master.FindControl("rdbFiltro3"); rdbNombre.Text = "Nombre"; btnBuscar = (Button)Master.FindControl("btnBuscar"); btnBuscar.Click += new EventHandler(this.btnBuscar_Click); txbBuscar = (TextBox)Master.FindControl("txtBuscar"); //GT 0175 imbReportes = (ImageButton)Master.FindControl("imgBtnReportes"); imbReportes.Click += new ImageClickEventHandler(this.imbReportes_Click); //Deshabilitar botones del toolbar switch (cPermiso) { case 'T': break; case 'E': DesactivarEdicionEliminacion(); break; case 'L': DesactivarEdicionEliminacion(); DesactivarNuevo(); break; } //Inicializacion de objetos oblColonias = new MedNeg.Colonias.BlColonias(); oblPoblaciones = new MedNeg.Poblaciones.BlPoblaciones(); oblMunicipios = new MedNeg.Municipios.BlMunicipios(); oblEstados = new MedNeg.Estados.BlEstados(); oblTipos = new MedNeg.Tipos.BlTipos(); oblBitacora = new MedNeg.Bitacora.BlBitacora(); oblVinculacion = new MedNeg.VendedorVinculacion.BlVendedorVinculacion(); oblEspecialidad = new MedNeg.VendedorEspecialidad.BlVendedorEspecialidad(); oblVendedores = new MedNeg.Vendedores.BlVendedores(); if (!IsPostBack) { MostrarAreaTrabajo(false, false); CargarCamposEditables(); Session["reporteactivo"] = 0; Session["reportdocument"] = ""; Session["titulo"] = ""; Session["resultadoquery"] = ""; ViewState["direccionsorting"] = System.Web.UI.WebControls.SortDirection.Ascending; //GT 0175 ConfigurarMenuBotones(true, true, false, false, false, false, true, true); } } catch (NullReferenceException) { if (!ClientScript.IsStartupScriptRegistered("alertsession")) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alertsession", "alertarSesion();", true); } MostrarAreaTrabajo(false, false); Site1 oPrincipal = (Site1)this.Master; oPrincipal.DeshabilitarControles(this); oPrincipal.DeshabilitarControles(); } }
protected void Page_Load(object sender, EventArgs e) { //Obtener los controles de master. Hashtable htbPermisos = (Hashtable)Session["permisos"]; char cPermiso = 'N'; try { #region Interfaz cPermiso = (char)htbPermisos["municipios"]; imbNuevo = (ImageButton)Master.FindControl("imgBtnNuevo"); imbNuevo.Click += new ImageClickEventHandler(this.imbNuevo_Click); imbEditar = (ImageButton)Master.FindControl("imgBtnEditar"); imbEditar.Click += new ImageClickEventHandler(this.imbEditar_Click); imbEliminar = (ImageButton)Master.FindControl("imgBtnEliminar"); imbEliminar.Click += new ImageClickEventHandler(this.imbEliminar_Click); imbMostrar = (ImageButton)Master.FindControl("imgBtnMostrar"); imbMostrar.Click += new ImageClickEventHandler(this.imbMostrar_Click); imbAceptar = (ImageButton)Master.FindControl("imgBtnAceptar"); imbAceptar.Click += new ImageClickEventHandler(this.imbAceptar_Click); imbImprimir = (ImageButton)Master.FindControl("imgBtnImprimir"); imbImprimir.Click += new ImageClickEventHandler(this.imbImprimir_Click); imbAceptar.ValidationGroup = "Municipios"; imbCancelar = (ImageButton)Master.FindControl("imgBtnCancelar"); imbCancelar.Click += new ImageClickEventHandler(this.imbCancelar_Click); rdbTodos = (RadioButton)Master.FindControl("rdbFiltro1"); rdbTodos.Text = "Nombre y Clave"; rdbClave = (RadioButton)Master.FindControl("rdbFiltro2"); rdbClave.Text = "Clave"; rdbNombre = (RadioButton)Master.FindControl("rdbFiltro3"); rdbNombre.Text = "Nombre"; btnBuscar = (Button)Master.FindControl("btnBuscar"); btnBuscar.Click += new EventHandler(this.btnBuscar_Click); txbBuscar = (TextBox)Master.FindControl("txtBuscar"); lblNombreModulo = (Label)Master.FindControl("lblNombreModulo"); lblNombreModulo.Text = "Municipios"; //GT 0175 imbReportes = (ImageButton)Master.FindControl("imgBtnReportes"); imbReportes.Click += new ImageClickEventHandler(this.imbReportes_Click); switch (cPermiso) { case 'T': break; case 'E': DesactivarEdicionEliminacion(); break; case 'L': DesactivarEdicionEliminacion(); DesactivarNuevo(); break; } #endregion oblMunicipios = new MedNeg.Municipios.BlMunicipios(); oblEstados = new MedNeg.Estados.BlEstados(); oblBitacora = new MedNeg.Bitacora.BlBitacora(); if (!IsPostBack) { Session["municipiosaccion"] = 0; pnlCatalogo.Visible = false; pnlFormulario.Visible = false; Session["resultadoquery"] = ""; ViewState["direccionsorting"] = System.Web.UI.WebControls.SortDirection.Ascending; Session["reporteactivo"] = 0; Session["reportdocument"] = ""; Session["titulo"] = ""; //GT 0175 ConfigurarMenuBotones(true, true, false, false, false, false, true, true); } } catch (NullReferenceException) { if (!ClientScript.IsStartupScriptRegistered("alertsession")) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alertsession", "alertarSesion();", true); } pnlCatalogo.Visible = false; pnlFormulario.Visible = false; Site1 oPrincipal = (Site1)this.Master; oPrincipal.DeshabilitarControles(this); oPrincipal.DeshabilitarControles(); } }
protected void Page_Load(object sender, EventArgs e) { oblEstados = new MedNeg.Estados.BlEstados(); oblPoblaciones = new MedNeg.Poblaciones.BlPoblaciones(); oblMunicipios = new MedNeg.Municipios.BlMunicipios(); MedNeg.Usuarios.BlUsuarios oblUsuario = new MedNeg.Usuarios.BlUsuarios(); try { MedDAL.DAL.usuarios oUsuario = new MedDAL.DAL.usuarios(); oUsuario = (MedDAL.DAL.usuarios)oblUsuario.Buscar(Session["usuario"].ToString()); if ((bool)oUsuario.FiltradoActivado) { txbAlmacenf_AutoCompleteExtender.Enabled = false; } else { txbAlmacenf_AutoCompleteExtender.Enabled = true; } if (lsbSeleccionf.SelectedIndex == -1) { btnGenerar.Visible = false; } if (!IsPostBack) { Session["reportdocument"] = ""; LimpiarPaneles(); if (pnlLocalidadf.Visible) { CargarEstados(); } } } catch (NullReferenceException) { //if (!Page.ClientScript.IsStartupScriptRegistered("alertsession")) //{ // Page.ClientScript.RegisterStartupScript(this.GetType(), // "alertsession", "alertarSesion();", true); //} //pnlGeneral.Visible = false; } }
//Lista de contactos del cliente //List<MedDAL.DAL.clientes_contacto> lstContactosNuevos, lstContactosEliminar, lstContactosGriedView, lstContactosBD; #endregion #region Configuración de inicio protected void Page_Load(object sender, EventArgs e) { //Asignar titulo de modulo lblNombreModulo = (Label)Master.FindControl("lblNombreModulo"); lblNombreModulo.Text = "Clientes"; //Cargar permisos Hashtable htbPermisos = (Hashtable)Session["permisos"]; char cPermiso = 'N'; //cPermiso = (char)htbPermisos["vendedores"]; try { cPermiso = (char)htbPermisos["clientes"]; //Obtener los controles de master. imbNuevo = (ImageButton)Master.FindControl("imgBtnNuevo"); imbNuevo.Click += new ImageClickEventHandler(this.imbNuevo_Click); imbEditar = (ImageButton)Master.FindControl("imgBtnEditar"); imbEditar.Click += new ImageClickEventHandler(this.imbEditar_Click); imbEliminar = (ImageButton)Master.FindControl("imgBtnEliminar"); imbEliminar.Click += new ImageClickEventHandler(this.imbEliminar_Click); imbMostrar = (ImageButton)Master.FindControl("imgBtnMostrar"); imbMostrar.Click += new ImageClickEventHandler(this.imbMostrar_Click); imbImprimir = (ImageButton)Master.FindControl("imgBtnImprimir"); imbImprimir.Click += new ImageClickEventHandler(this.imbImprimir_Click); imbReportes = (ImageButton)Master.FindControl("imgBtnReportes"); imbReportes.Click += new ImageClickEventHandler(this.imbReportes_Click); imbAceptar = (ImageButton)Master.FindControl("imgBtnAceptar"); imbAceptar.Click += new ImageClickEventHandler(this.imbAceptar_Click); imbAceptar.ValidationGroup = "vgCliente"; imbCancelar = (ImageButton)Master.FindControl("imgBtnCancelar"); imbCancelar.Click += new ImageClickEventHandler(this.imbCancelar_Click); rdbTipo = (RadioButton)Master.FindControl("rdbFiltro1"); rdbTipo.Text = "Tipo"; rdbClave = (RadioButton)Master.FindControl("rdbFiltro2"); rdbClave.Text = "Clave1"; rdbNombre = (RadioButton)Master.FindControl("rdbFiltro3"); rdbNombre.Text = "Nombre"; btnBuscar = (Button)Master.FindControl("btnBuscar"); btnBuscar.Click += new EventHandler(this.btnBuscar_Click); txbBuscar = (TextBox)Master.FindControl("txtBuscar"); //GT 0175 imbReportes = (ImageButton)Master.FindControl("imgBtnReportes"); imbReportes.Click += new ImageClickEventHandler(this.imbReportes_Click); //Deshabilitar botones del toolbar switch (cPermiso) { case 'T': break; case 'E': DesactivarEdicionEliminacion(); break; case 'L': DesactivarEdicionEliminacion(); DesactivarNuevo(); break; } //Inicializacion de objetos oblColonias = new MedNeg.Colonias.BlColonias(); oblPoblaciones = new MedNeg.Poblaciones.BlPoblaciones(); oblMunicipios = new MedNeg.Municipios.BlMunicipios(); oblEstados = new MedNeg.Estados.BlEstados(); oblTipos = new MedNeg.Tipos.BlTipos(); oblBitacora = new MedNeg.Bitacora.BlBitacora(); oblCliente = new MedNeg.BlClientes.BlClientes(); //lstContactosGriedView = new List<MedDAL.DAL.clientes_contacto>(); gdvContactosCliente.Visible = true; gdvContactosCliente.ShowHeader = true; gdvContactosCliente.DataSource = ((List <MedDAL.DAL.clientes_contacto>)Session["lstContactosDB"]); gdvContactosCliente.DataBind(); gdvContactosCliente.DataKeyNames = new String[] { "idContacto" }; CargarCamposEditables(); if (!IsPostBack) { MostrarAreaTrabajo(false, false); Session["lstContactosDB"] = new List <MedDAL.DAL.clientes_contacto>(); Session["gridviewdatasource"] = null; Session["ajustecontrolesreporte"] = false; Session["resultadoquery"] = ""; ViewState["direccionsorting"] = System.Web.UI.WebControls.SortDirection.Ascending; Session["reporteactivo"] = 0; Session["reportdocument"] = ""; Session["titulo"] = ""; //GT 0175 ConfigurarMenuBotones(true, true, false, false, false, false, true, true); } if ((bool)Session["ajustecontrolesreporte"] && !(bool)Session["ajustecontrolesreportecandado"]) { CargarListaReportes(); Session["ajustecontrolesreporte"] = false; } } catch (NullReferenceException) { //this.Page.LoadControl("~/Login.aspx"); if (!ClientScript.IsStartupScriptRegistered("alertsession")) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alertsession", "alertarSesion();", true); } MostrarAreaTrabajo(false, false); Site1 oPrincipal = (Site1)this.Master; oPrincipal.DeshabilitarControles(this); oPrincipal.DeshabilitarControles(); } }