示例#1
0
        private void InsUpdDelUserRoles(char EVENT, int ID)
        {
            BL_UserRoles obj = new BL_UserRoles();

            obj.EVENT   = EVENT;
            obj.ID      = ID;
            obj.ROLE_ID = Convert.ToInt32((string)ddlRoles.SelectedValue);
            obj.USER_ID = Convert.ToInt32((string)ddlUsers.SelectedValue);
            string msg = "";

            msg = obj.InsUpdDelUserRoles(out ID);
            if (msg == "Record Inserted Successfully" || msg == "Record Updated Successfully" || msg == "Record Deleted Successfully")
            {
                msgbox.ShowSuccess(msg);
                ddlUsers.SelectedValue = "0";
                ddlRoles.SelectedValue = "0";
                btnSave.CommandName    = "Save";
                btnSave.Text           = "Save";
                FillgvUserRoles();
            }
            else
            {
                msgbox.ShowWarning(msg);
            }
        }
示例#2
0
        private void FillgvUserRoles()
        {
            DataTable dt = new DataTable();

            dt = BL_UserRoles.GetUserRoles(1, 0, "");
            if (dt.Rows.Count > 0)
            {
                gvUsersRoles.DataSource = dt;
                gvUsersRoles.DataBind();
            }
            else
            {
                gvUsersRoles.DataSource = new string[] { };
                gvUsersRoles.DataBind();
            }
        }