Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bool bEnable = false;

            oIsUsuario = oWeb.ValidaUserAppReport();

            if ((!string.IsNullOrEmpty(oIsUsuario.NKeyDeudor)) && (!string.IsNullOrEmpty(oIsUsuario.NKeyUsuario)) || (!string.IsNullOrEmpty(oIsUsuario.NCodHolding)))
            {
                DBConn oConn = new DBConn();
                if (oConn.Open())
                {
                    cDashboard oGestiones = new cDashboard(ref oConn);
                    oGestiones.nKeyCliente = oIsUsuario.NKeyUsuario;
                    oGestiones.nKeyDeudor  = oIsUsuario.NKeyDeudor;
                    oGestiones.CodHolding  = oIsUsuario.NCodHolding;
                    //Response.Write("GetGestiones;" + DateTime.Now.Millisecond.ToString() + "<br>");
                    DataTable dt = oGestiones.GetGestiones();
                    //Response.Write("GetGestiones;" + DateTime.Now.Millisecond.ToString() + "<br>");
                    if (dt != null)
                    {
                        if (dt.Rows.Count > 0)
                        {
                            bEnable = true;
                            gdGestiones.DataSource = dt;
                            gdGestiones.DataBind();
                        }
                        else
                        {
                            bEnable = false;
                            getDummyTable();
                        }
                    }
                    else
                    {
                        bEnable = false;
                        getDummyTable();
                    }
                }
                oConn.Close();

                if (bEnable)
                {
                    idGestionesEnable.Visible   = true;
                    idGestionesNoEnable.Visible = false;
                }
                else
                {
                    idGestionesEnable.Visible   = false;
                    idGestionesNoEnable.Visible = true;
                }
            }
            else
            {
                idGestionesEnable.Visible   = false;
                idGestionesNoEnable.Visible = false;
            }
        }