Ejemplo n.º 1
0
        public int editAccount(long userId, string userName, string id, string pass, string address, string avt, long phone, bool sessionAuth)
        {
            DTO_Account dto_account = new DTO_Account();

            dto_account.UserId   = userId;
            dto_account.UserName = userName;
            dto_account.Id       = id;
            dto_account.Pass     = pass;
            dto_account.Address  = address;
            dto_account.Phone    = phone;

            try
            {
                if (checkPermission.checkAuth(sessionAuth))
                {
                    if (checkPermission.isAdmin(userId) /*|| checkRoleAccount.checkRole(userId)*/)
                    {
                        return(dal_account.editAccount(dto_account) == true ? 200 : 400);
                    }
                    else
                    {
                        return(403);
                    }
                }
                else
                {
                    return(403);
                }
            }
            catch
            {
                return(400);
            }
        }