Ejemplo n.º 1
0
        public static bool ChangeUserInRoles(string ApplicationName, Guid UserID, string RoleNamesUnselected, string RoleNamesSelected, int PortalID)
        {
            string sp = "[dbo].[usp_ChangeUserInRoles]";
            SageFrameSQLHelper sagesql = new SageFrameSQLHelper();
            try
            {
                List<KeyValuePair<string, object>> ParamCollInput = new List<KeyValuePair<string, object>>();
                ParamCollInput.Add(new KeyValuePair<string, object>("@ApplicationName", ApplicationName));
                ParamCollInput.Add(new KeyValuePair<string, object>("@UserID", UserID));
                ParamCollInput.Add(new KeyValuePair<string, object>("@RoleNamesUnselected", RoleNamesUnselected));
                ParamCollInput.Add(new KeyValuePair<string, object>("@RoleNamesSelected", RoleNamesSelected));
                ParamCollInput.Add(new KeyValuePair<string, object>("@PortalID", PortalID));
                sagesql.ExecuteNonQuery(sp, ParamCollInput);

                return true;
            }
            catch (Exception)
            {

                throw;
            }

        }
Ejemplo n.º 2
0
        public static bool ChangePassword(UserInfo obj)
        {
            string sp = "[dbo].[usp_sf_ResetPassword]";
            SageFrameSQLHelper sagesql = new SageFrameSQLHelper();

            try
            {
                List<KeyValuePair<string, object>> ParamCollInput = new List<KeyValuePair<string, object>>();
                ParamCollInput.Add(new KeyValuePair<string, object>("@UserID", obj.UserID));
                ParamCollInput.Add(new KeyValuePair<string, object>("@NewPassword", obj.Password));
                ParamCollInput.Add(new KeyValuePair<string, object>("@PasswordSalt", obj.PasswordSalt));
                ParamCollInput.Add(new KeyValuePair<string, object>("@PasswordFormat", obj.PasswordFormat));

                sagesql.ExecuteNonQuery(sp, ParamCollInput);
                return true;
            }
            catch (Exception)
            {

                throw;
            }
        }
Ejemplo n.º 3
0
        public static bool AddUserInRoles(UserInfo obj)
        {
            string sp = "[dbo].[usp_sf_UserInRolesAdd]";
            SageFrameSQLHelper sagesql = new SageFrameSQLHelper();
            try
            {
                List<KeyValuePair<string, object>> ParamCollInput = new List<KeyValuePair<string, object>>();
                ParamCollInput.Add(new KeyValuePair<string, object>("@ApplicationName", obj.ApplicationName));
                ParamCollInput.Add(new KeyValuePair<string, object>("@UserID", obj.UserID));
                ParamCollInput.Add(new KeyValuePair<string, object>("@RoleNames", obj.RoleNames));
                ParamCollInput.Add(new KeyValuePair<string, object>("@PortalID", obj.PortalID));

                sagesql.ExecuteNonQuery(sp, ParamCollInput);


                return true;
            }
            catch (Exception)
            {

                throw;
            }

        }