Ejemplo n.º 1
0
        public BE_Json UpdateRoleGeneral(BE_Roles bE_Roles)
        {
            BE_Json objJson     = null;
            var     objListaAux = string.Empty;

            try
            {
                BL_Roles bL_Roles = new BL_Roles();
                bL_Roles.connectionString = AppConfig.DbConnection;
                objListaAux = JsonConvert.SerializeObject(bL_Roles.UpdateRoleGeneral(bE_Roles));

                objJson        = new BE_Json();
                objJson.data   = objListaAux;
                objJson.status = CManager.RESULTADO_WCF.OK;
            }
            catch (Exception ex)
            {
                objJson        = new BE_Json();
                objJson.data   = "Hubo en error en servidor:" + ex.Message + ";" + ex.StackTrace + ";" + ex.ToString();
                objJson.status = CManager.RESULTADO_WCF.ERROR;
                objJson.status = CManager.RESULTADO_WCF.ERROR;
            }
            finally
            {
                objListaAux = null;
            }
            return(objJson);
        }
Ejemplo n.º 2
0
        public static DropDownList FillddlRoles(DropDownList ddl, int EVENT, int ID, string CODE)
        {
            ddl.Items.Clear();
            var dt = BL_Roles.GetRoles(EVENT, ID, CODE);

            if (dt.Rows.Count > 0)
            {
                ddl.DataSource     = dt;
                ddl.DataValueField = "ROLE_ID";
                ddl.DataTextField  = "ROLE_NAME";
                ddl.DataBind();
                ddl.Items.Insert(0, new ListItem("Select", "0", true));
            }
            return(ddl);
        }
Ejemplo n.º 3
0
        private void FillgvRoles()
        {
            DataTable dt = new DataTable();

            dt = BL_Roles.GetRoles(1, 0, "");
            if (dt.Rows.Count > 0)
            {
                gvUsersRoles.DataSource = dt;
                gvUsersRoles.DataBind();
            }
            else
            {
                gvUsersRoles.DataSource = new string[] { };
                gvUsersRoles.DataBind();
            }
        }
Ejemplo n.º 4
0
        private void InsUpdDelRoles(char Event, int Id)
        {
            BL_Roles obj = new BL_Roles();

            obj.EVENT     = Event;
            obj.ROLE_ID   = Id;
            obj.ROLE_NAME = txtRoleName.Text;
            string msg = "";

            msg = obj.InsUpdDelRoles(out Id);
            if (msg != "Record Inserted Successfully" || msg != "Record Updated Successfully" || msg != "Record Deleted Successfully")
            {
                msgbox.ShowSuccess(msg);
                FillgvRoles();
                filldropdown();
                txtRoleName.Text    = "";
                btnRole.CommandName = "Save";
            }
            else
            {
                msgbox.ShowWarning(msg);
            }
        }