Ejemplo n.º 1
0
        string HandleAccountRequest(HttpContext context, string op)
        {
            AccountService service = new AccountService();
            string result = string.Empty;

            switch (op)
            {
                case "login":
                    result = service.ValidateLogin(context);
                    break;
                case "getavatar":
                    result = service.GetAvatar(context);
                    break;
                case "GetPersonalInfo":
                    result = service.GetPersonalInfo(context);
                    break;
                case "getfriends":
                    result = service.GetFriends(context);
                    break;
                default:
                    break;
            }

            return result;
        }
Ejemplo n.º 2
0
        string HandleAlbumRequest(HttpContext context, string op)
        {
            AlbumService albumservice = new AlbumService();
            AccountService accountservice = new AccountService();

            string result = string.Empty;

            switch (op)
            {
                case "upload":
                    result = accountservice.ValidateLogin(context);
                    if (result == "1")
                    {
                        result = albumservice.UploadPicture(context);
                    }
                    break;
                case "getalbumlist":
                    result = accountservice.ValidateLogin(context);
                    if (result == "1")
                    {
                        result = albumservice.GetAlbumList(context);
                    }
                    break;
                case "getpicturelist":
                    result = accountservice.ValidateLogin(context);
                    if (result == "1")
                    {
                        result = albumservice.GetPictureList(context);
                    }
                    break;
                case "getpicture":
                    result = accountservice.ValidateLogin(context);
                    if (result == "1")
                    {
                        result = albumservice.GetPicture(context);
                    }
                    break;
                case "addalbum":
                    result = accountservice.ValidateLogin(context);
                    if (result == "1")
                    {
                        result = albumservice.AddAlbum(context);
                    }
                    break;
                case "deletealbum":
                    result = accountservice.ValidateLogin(context);
                    if (result == "1")
                    {
                        result = albumservice.DeleteAlbum(context);
                    }
                    break;
                case "deletepicture":
                    result = accountservice.ValidateLogin(context);
                    if (result == "1")
                    {
                        result = albumservice.DeletePicture(context);
                    }
                    break;
                case "getpiccomments":
                    result = accountservice.ValidateLogin(context);
                    if (result == "1")
                    {
                        result = albumservice.GetPictureComments(context);
                    }
                    break;
                case "addpiccomment":
                    result = accountservice.ValidateLogin(context);
                    if (result == "1")
                    {
                        result = albumservice.AddPictureComment(context);
                    }
                    break;
                case "deletepiccomment":
                    result = accountservice.ValidateLogin(context);
                    if (result == "1")
                    {
                        result = albumservice.DeletePicComment(context);
                    }
                    break;
                default:
                    break;
            }

            return result;
        }