protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { if (ObjUsuario != null) { if (ObjUsuario.isAdmEmp_DptoSeg() || ObjUsuario.isAdm_SucSeg()) { #region codigo if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[8].Visible = false; } if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[8].Visible = false; } #endregion } else if (ObjUsuario.isAdm_SucSalud() || ObjUsuario.isAdmEmp_DptoSalud() || ObjUsuario.isResponsable())//Adm Emp { #region codigo if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[7].Visible = false; e.Row.Cells[8].Visible = false; } if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[7].Visible = false; e.Row.Cells[8].Visible = false; } #endregion } } }
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { if (ObjUsuario != null) { if (ObjUsuario.isAdmEmp_DptoSeg() || ObjUsuario.isAdmEmp_DptoSalud()) { GridView1.Columns[4].Visible = false; GridView1.Columns[5].Visible = false; } if (ObjUsuario.isAdm_SucSeg() || ObjUsuario.isAdm_SucSalud() || ObjUsuario.isResponsable()) { GridView1.Columns[4].Visible = false; GridView1.Columns[5].Visible = false; } } }
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { ObjUsuario = Utilidades.ValidarSesion(HttpContext.Current.User.Identity as FormsIdentity, this); if (ObjUsuario.isAdmEmp_DptoSeg() || ObjUsuario.isAdm_SucSeg() || ObjUsuario.isAdmEmp_DptoSalud() || ObjUsuario.isAdm_SucSalud() || ObjUsuario.isResponsable()) { if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[5].Visible = false; e.Row.Cells[6].Visible = false; } if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[5].Visible = false; e.Row.Cells[6].Visible = false; } } }
//------------FUNCIONES DE SETTER public static int Set_IdSucursalDDl(Model_UsuarioSistema ObjUsuario, DropDownList ddlSucursal) { int IdSucursal = 0; if (ObjUsuario.isAdm_Grupoli()) { IdSucursal = Convert.ToInt32(ddlSucursal.SelectedValue); } else if (ObjUsuario.isAdm_Empresa() || ObjUsuario.isAdmEmp_DptoSeg() || ObjUsuario.isAdmEmp_DptoSalud()) { IdSucursal = Convert.ToInt32(ddlSucursal.SelectedValue); } else { IdSucursal = ObjUsuario.Id_sucursal; } return(IdSucursal); }
public static Tuple <int, int> Get_IdEmpresa_IdSucursal(Model_UsuarioSistema ObjUsuario, DropDownList ddlEmpresa, DropDownList ddlSucursal) { int IdSucursal = 0; int IdEmpresa = 0; if (ObjUsuario.isAdm_Grupoli()) { IdEmpresa = Convert.ToInt32(ddlEmpresa.SelectedValue); IdSucursal = Convert.ToInt32(ddlSucursal.SelectedValue); } else if (ObjUsuario.isAdm_Empresa() || ObjUsuario.isAdmEmp_DptoSeg() || ObjUsuario.isAdmEmp_DptoSalud()) { IdEmpresa = ObjUsuario.Id_empresa; IdSucursal = Convert.ToInt32(ddlSucursal.SelectedValue); } else { IdEmpresa = ObjUsuario.Id_empresa; IdSucursal = ObjUsuario.Id_sucursal; } return(Tuple.Create(IdEmpresa, IdSucursal)); }
public static Tuple <bool, bool> Get_Empresa_Sucursal(Model_UsuarioSistema ObjUsuario) { bool Sucursal = true; bool Empresa = true; if (ObjUsuario.isAdm_Grupoli()) { Sucursal = true; Empresa = true; } else if (ObjUsuario.isAdm_Empresa() || ObjUsuario.isAdmEmp_DptoSeg() || ObjUsuario.isAdmEmp_DptoSalud()) { Sucursal = true; Empresa = false; } else { Sucursal = false; Empresa = false; } return(Tuple.Create(Empresa, Sucursal)); }