コード例 #1
0
    public static string historicoRoles(string t001_apellido1, string t001_apellido2, string t001_nombre, int desde, int hasta)
    {
        IB.Progress.BLL.ROLIB rolesBLL = null;

        List <ROLIB> miHistorico = new List <ROLIB>();
        string       retval      = String.Empty;

        try
        {
            rolesBLL    = new IB.Progress.BLL.ROLIB();
            miHistorico = rolesBLL.CatHistoricoRoles(t001_apellido1, t001_apellido2, t001_nombre, desde, hasta);
            rolesBLL.Dispose();

            retval = JsonConvert.SerializeObject(miHistorico);
            return(retval);
        }
        catch (Exception ex)
        {
            if (rolesBLL != null)
            {
                rolesBLL.Dispose();
            }

            //PieMenu.sErrores = "msgerr = 'Ocurrió un error general en la aplicación.';";
            //Avisar a EDA por smtp

            Smtp.SendSMTP("Error en la aplicación PROGRESS", ex.ToString());
            throw ex;
        }
    }
コード例 #2
0
    public static List <ROLIB> obtenerRoles()
    {
        IB.Progress.BLL.ROLIB bllRoles = new IB.Progress.BLL.ROLIB();
        List <ROLIB>          roles    = bllRoles.Catalogo();

        bllRoles.Dispose();
        return(roles);
    }
コード例 #3
0
    public static void updatearRoles(List <short> listaRoles)
    {
        try
        {
            IB.Progress.BLL.ROLIB rlb = new IB.Progress.BLL.ROLIB();
            rlb.Update(listaRoles);
            rlb.Dispose();

            //Correo.Enviar("Correo Progress", ((IB.Progress.Models.Profesional)HttpContext.Current.Session["PROFESIONAL"]).nombre.ToString() + " ha actualizado los roles correctamente", ((IB.Progress.Models.Profesional)HttpContext.Current.Session["PROFESIONAL"]).Correo.ToString());
        }
        catch (Exception ex)
        {
            IB.Progress.Shared.Smtp.SendSMTP("Error al actualizar los roles", ex.Message);
        }
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        List <IB.Progress.Models.ROLIB> lisRolNoAprob = null;
        List <IB.Progress.Models.ROLIB> lisRolAprob   = null;

        IB.Progress.BLL.ROLIB rlb = null;

        bool bCont = true;

        try
        {
            rlb = new IB.Progress.BLL.ROLIB();
            List <IB.Progress.Models.ROLIB> lRolib = rlb.Catalogo();
            rlb.Dispose();

            //Cargar las tablas
            //LinQ para separar los aprobadores de los NO aprobadores
            lisRolNoAprob = (from rolib in lRolib
                             where rolib.t004_aprobador == false
                             select rolib).ToList <IB.Progress.Models.ROLIB>();

            lisRolAprob = (from rolib in lRolib
                           where rolib.t004_aprobador == true
                           select rolib).ToList <IB.Progress.Models.ROLIB>();
        }
        catch (IB.Progress.Shared.IBException ibex)
        {
            if (rlb != null)
            {
                rlb.Dispose();
            }
            bCont = false;

            string msgerr = "";
            switch (ibex.ErrorCode)
            {
            case 102:
                msgerr = ibex.Message;
                break;
            }
            PieMenu.sErrores = "msgerr = '" + msgerr + "';";
            //Avisar a EDA por smtp
            Smtp.SendSMTP("Error al cargar el catálogo de roles", " Roles/aprobadores");
        }
        catch (Exception ex)
        {
            if (rlb != null)
            {
                rlb.Dispose();
            }
            bCont = false;
            //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "script1", "msgerr = 'Ocurrió un error general en la aplicación.';", true);
            PieMenu.sErrores = "msgerr = 'Ocurrió un error general en la aplicación.';";
            //Avisar a EDA por smtp
            Smtp.SendSMTP("Ha ocurrido un error general", "Error general en Roles/aprobadores");
        }

        if (bCont)
        {
            try
            {
                //Cargamos la lista de no aprobadores
                foreach (IB.Progress.Models.ROLIB r in lisRolNoAprob)
                {
                    HtmlGenericControl listItem = new HtmlGenericControl("li");
                    listItem.Attributes.Add("class", "list-group-item");
                    listItem.InnerText = r.t004_desrol;
                    listItem.Attributes.Add("value", r.t004_idrol.ToString());
                    lisNoAprob.Controls.Add(listItem);
                }

                //Cargamos la lista de aprobadores
                foreach (IB.Progress.Models.ROLIB r in lisRolAprob)
                {
                    HtmlGenericControl listItem = new HtmlGenericControl("li");
                    listItem.Attributes.Add("class", "list-group-item");
                    listItem.InnerText = r.t004_desrol;
                    listItem.Attributes.Add("value", r.t004_idrol.ToString());
                    lisAprob.Controls.Add(listItem);
                }
            }
            catch (Exception)
            {
                //Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "script1", "msgerr = 'Ocurrió un error obteniendo los roles de base de datos';", true);
                PieMenu.sErrores = "msgerr = 'Ocurrió un error cargando las listas de los roles';";
            }
        }
    }