Пример #1
0
        public List <PerfilesDropDownListModel> CargarPerfilesDropDownListModel(Guid UidSegPerfil)
        {
            List <PerfilesDropDownListModel> lsPerfilesDropDownListModel = new List <PerfilesDropDownListModel>();

            SqlCommand query = new SqlCommand();

            query.CommandType = CommandType.Text;

            // No tiene el perfil SuperAdminEscuela query.CommandText = "select sp.UidSegPerfil, sp.VchNombre, tp.VchDescripcion as VchPerfil, es.VchDescripcion as VchEstatus, es.VchIcono  from SegPerfiles sp, TiposPerfiles tp, Estatus es where sp.UidSegPerfil != '17BB8F08-9D5F-425C-9B9B-1CA230C07C7F' and sp.UidTipoPerfil = tp.UidTipoPerfil and sp.UidEstatus = es.UidEstatus and tp.UidTipoPerfil = '" + UidSegPerfil + "'";
            query.CommandText = "select sp.UidSegPerfil, sp.VchNombre, tp.VchDescripcion as VchPerfil, es.VchDescripcion as VchEstatus, es.VchIcono from SegPerfiles sp, TiposPerfiles tp, Estatus es where sp.UidSegPerfil != '17BB8F08-9D5F-425C-9B9B-1CA230C07C7F' and sp.UidSegPerfil != 'ED9F4B98-EA8F-4D8F-8248-6BA42EC87B4E' and sp.UidTipoPerfil = tp.UidTipoPerfil and sp.UidEstatus = es.UidEstatus and tp.UidTipoPerfil = '" + UidSegPerfil + "'";

            DataTable dt = this.Busquedas(query);

            foreach (DataRow item in dt.Rows)
            {
                perfilesDropDownListModel = new PerfilesDropDownListModel()
                {
                    UidSegPerfil = new Guid(item["UidSegPerfil"].ToString()),
                    VchNombre    = item["VchNombre"].ToString(),
                    VchPerfil    = item["VchPerfil"].ToString(),
                    VchEstatus   = item["VchEstatus"].ToString(),
                    VchIcono     = item["VchIcono"].ToString()
                };

                lsPerfilesDropDownListModel.Add(perfilesDropDownListModel);
            }

            return(lsPerfilesDropDownListModel);
        }
Пример #2
0
        public List <PerfilesDropDownListModel> CargarPerfilesClienteDropDownListModel(Guid UidCliente, Guid UidTipoPerfil)
        {
            List <PerfilesDropDownListModel> lsPerfilesDropDownListModel = new List <PerfilesDropDownListModel>();

            SqlCommand query = new SqlCommand();

            query.CommandType = CommandType.Text;

            query.CommandText = "select sp.UidSegPerfil, sp.VchNombre, tp.VchDescripcion as VchPerfil, es.VchDescripcion as VchEstatus, es.VchIcono, sp.UidFranquiciatario from SegPerfiles sp, TiposPerfiles tp, Estatus es where sp.UidTipoPerfil = tp.UidTipoPerfil and sp.UidEstatus = es.UidEstatus and sp.UidCliente = '" + UidCliente + "' and tp.UidTipoPerfil = '" + UidTipoPerfil + "'";

            DataTable dt = this.Busquedas(query);

            foreach (DataRow item in dt.Rows)
            {
                perfilesDropDownListModel = new PerfilesDropDownListModel()
                {
                    UidSegPerfil = new Guid(item["UidSegPerfil"].ToString()),
                    VchNombre    = item["VchNombre"].ToString(),
                    VchPerfil    = item["VchPerfil"].ToString(),
                    VchEstatus   = item["VchEstatus"].ToString(),
                    VchIcono     = item["VchIcono"].ToString()
                };

                lsPerfilesDropDownListModel.Add(perfilesDropDownListModel);
            }

            return(lsPerfilesDropDownListModel);
        }