Esempio n. 1
0
        public void GetRBTsForAlbum()
        {
            JSONController jsoncontroller            = new JSONController();
            Input <Models.Inputs.RBTsForAlbums> rbts = new Input <Models.Inputs.RBTsForAlbums>();

            Models.Inputs.RBTsForAlbums rbt = new Models.Inputs.RBTsForAlbums();
            rbt.operatorid = "1";
            rbt.albumid    = "4";
            //rbt.artistid = "1";
            rbts.input = rbt;

            Models.CommonInputParams param = new CommonInputParams();
            param.company  = "iSYS";
            param.deviceid = "123123123";
            param.password = "******";
            param.username = "******";

            rbts.param = param;
            var result = jsoncontroller.GetRBTsForAlbums(rbts);



            Assert.IsNotNull(result);
            Assert.AreEqual("0", result.status.statuscode);
            Assert.AreNotEqual(result.response.RBTs.Count, 0);
        }
Esempio n. 2
0
        public ActionResult Index(int customerId, CreateProjectFromUI project)
        {
            using (var connection = this.getConnection())
            {
                try
                {
                    int newProjectId = this.CreateProject(customerId, project, connection);
                    this.CreateRooms(customerId, newProjectId, connection, project);
                    this.AttachProjectToCustomer(customerId, newProjectId, connection);

                    //  This creates a quote as well.  This needs to stop post beta
                    Project Quote = new Project();
                    Quote.FKParentProject = newProjectId;
                    JSONController jc = new JSONController();
                    jc.ProjectCopy(Quote, (int)Status.Quote);

                    @ViewBag.success = true;
                    @ViewBag.message = "Project created!";
                }
                catch (SqlException e)
                {
                    @ViewBag.success = false;
                    @ViewBag.message = e.Message;
                }
            }

            return(View("passFail"));
        }
Esempio n. 3
0
        protected override void Seed(Movie_DB.Data.MovieDbContext context)
        {
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method
            //  to avoid creating duplicate seed data. E.g.
            //
            //    context.People.AddOrUpdate(
            //      p => p.FullName,
            //      new Person { FullName = "Andrew Peters" },
            //      new Person { FullName = "Brice Lambson" },
            //      new Person { FullName = "Rowan Miller" }
            //    );
            //
            using (StreamReader reader = new StreamReader(@"D:\______SOFTDEVELOP\__TELERIK\ALPHA\SQL_DB\DB-TeamProject\TKL-MovieDB\Movie-DB\XML\movie.xml"))
            {
                XmlDocument doc = new XmlDocument();
                doc.Load(@"D:\______SOFTDEVELOP\__TELERIK\ALPHA\SQL_DB\DB-TeamProject\TKL-MovieDB\Movie-DB\XML\movie.xml");

                var people = doc.DocumentElement;
                if (!context.Persons.Any())
                {
                    foreach (XmlElement person in people)
                    {
                        var personFirstName = person["firstName"];
                        var personLastName  = person["lastName"];
                        var personJob       = person["job"];
                        var personMovie     = person["movie"];

                        Console.WriteLine(personMovie.InnerText);
                        if (personFirstName != null && personLastName != null &&
                            personJob != null && personMovie != null)
                        {
                            var myPerson = new Person()
                            {
                                FirstName = personFirstName.InnerText,
                                LastName  = personLastName.InnerText,
                                Job       = personJob.InnerText,
                                Movie     = personMovie.InnerText
                            };
                            context.Persons.Add(myPerson);
                        }
                    }
                }
                var genres = JSONController.ReadGenresFromJSON();
                foreach (var g in genres)
                {
                    context.Genres.Add(g);
                }

                var persons = JSONController.ReadPersonsFromJSON();
                foreach (var p in persons)
                {
                    context.Persons.Add(p);
                }

                context.SaveChanges();
            }
        }
Esempio n. 4
0
 void Start()
 {
     json = new JSONController();
     json.LoadField();
     if (json.item.loggedIn == "true")
     {
         text.text = PlayerPrefs.GetString("USERNAME");
     }
 }
    void Start()
    {
        screenW = Screen.width;
        screenH = Screen.height;

        jsonController = new JSONController();

        programNames = jsonController.getPrograms("name");
        programCodes = jsonController.getPrograms("code");
    }
Esempio n. 6
0
 public void OnClickLogout()
 {
     json = new JSONController();
     json.LoadField();
     json.item.loggedIn = "false";
     json.item.Name     = "";
     json.SaveField();
     text.text = "None";
     PlayerPrefs.DeleteKey("EMAIL");
     PlayerPrefs.DeleteKey("PASSWORD");
 }
Esempio n. 7
0
 public void OnClick()
 {
     json = new JSONController();
     json.LoadField();
     if (json.item.loggedIn == "true")
     {
         SceneManager.LoadScene(3);
     }
     else
     {
         SceneManager.LoadScene(2);
     }
 }
Esempio n. 8
0
    void Start()
    {
        json = new JSONController();
        json.LoadField();
        if (string.IsNullOrEmpty(PlayFabSettings.TitleId))
        {
            PlayFabSettings.TitleId = "321";
        }


        if (json.item.loggedIn == "true")
        {
            userEmail    = PlayerPrefs.GetString("EMAIL");
            userPassword = PlayerPrefs.GetString("PASSWORD");
            var requst = new LoginWithEmailAddressRequest {
                Email = userEmail, Password = userPassword
            };
            PlayFabClientAPI.LoginWithEmailAddress(requst, OnLoginSuccess, OnLoginFailureStart);
        }
    }
Esempio n. 9
0
        public async Task GetPhotoAlbum()
        {
            var findAlbumResponse = new Album
            {
                UserId = 2,
                Id     = 20,
                Title  = "voluptas rerum iure ut enim"
            };

            var findPhotoResponse = new Photo
            {
                Id           = 1000,
                AlbumId      = 20,
                Title        = "est consequatur deleniti quos minus",
                Url          = "https://via.placeholder.com/600/fab5da",
                ThumbnailUrl = "https://via.placeholder.com/150/fab5da"
            };


            var PhotoAlbumResponse = new AlbumPhoto
            {
                Photos = new List <Photo> {
                    findPhotoResponse
                },
                Albums = new List <Album> {
                    findAlbumResponse
                }
            };

            var photoAlbumRepo = new Mock <IJsonPhotoAlbumService>();

            photoAlbumRepo.Setup(x => x.GetAlbumPhotoByUserId(2)).ReturnsAsync(PhotoAlbumResponse);

            var classUnderTest = new JSONController(photoAlbumRepo.Object);

            var result = await classUnderTest.GetByUserId(2);

            Assert.True(result.Equals(PhotoAlbumResponse));
        }
Esempio n. 10
0
 void Start()
 {
     _json = FindObjectOfType <JSONController>();
     CreateLocations(_json.Locations);
     _json.OnDataLoaded.AddListener(CreateLocations);
 }
Esempio n. 11
0
 public UnitTest1()
 {
     _orderService   = new OrderService();
     _productService = new ProductService();
     _controller     = new JSONController(_productService, _orderService);
 }