Ejemplo n.º 1
0
 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
         }
     }
 }
Ejemplo n.º 2
0
 protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
 {
     if (ObjUsuario != null)
     {
         if (ObjUsuario.isAdmEmp_DptoSalud() || ObjUsuario.isAdm_SucSalud() || ObjUsuario.isResponsable())
         {
             GridView1.Columns[7].Visible = false;
         }
     }
 }
Ejemplo n.º 3
0
 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;
         }
     }
 }
Ejemplo n.º 4
0
        //------------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);
        }
Ejemplo n.º 5
0
 protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
 {
     if (ObjUsuario != null)
     {
         if (ObjUsuario.isAdmEmp_DptoSalud() || ObjUsuario.isAdm_SucSalud() || ObjUsuario.isResponsable())
         {
             if (e.Row.RowType == DataControlRowType.Header)
             {
                 e.Row.Cells[6].Visible  = false;
                 e.Row.Cells[8].Visible  = false;
                 e.Row.Cells[9].Visible  = false;
                 e.Row.Cells[10].Visible = false;
             }
             if (e.Row.RowType == DataControlRowType.DataRow)
             {
                 e.Row.Cells[6].Visible  = false;
                 e.Row.Cells[8].Visible  = false;
                 e.Row.Cells[9].Visible  = false;
                 e.Row.Cells[10].Visible = false;
             }
         }
     }
 }
Ejemplo n.º 6
0
        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));
        }
Ejemplo n.º 7
0
        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));
        }