Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        m_panelRef[0] = m_panelMain;
        m_panelRef[1] = m_panelSetup;
        m_panelRef[2] = m_panelNewProfile;
        m_panelRef[3] = m_panelEditBook;

        SelectBook script = (SelectBook)m_BookList.GetComponent(typeof(SelectBook));

        script.CollectBooks(m_RootPath, m_BookList);
        m_availableProgress.RecollectProgress(m_RootPath);

        foreach (Transform child in m_panelSetup.transform)
        {
            if (child.gameObject.name == "ListBox")
            {
                m_profileSetup = (ProfileUpdate)child.gameObject.GetComponent(typeof(ProfileUpdate));
            }
        }
        m_profileSetup.InitProfiles(m_availableProgress);

        SwitchToPanel(m_panelSetup);
        m_panelMain.SetActive(false);

        GameObject m_test = (GameObject)Instantiate(prefabButton);

        m_test.transform.localScale = new Vector3(1, 1, 1);

        UtilityHelper.CreateText(gameObject);
    }
Ejemplo n.º 2
0
        public void NETFX_ProfileUpdateTest7()
        {
            MixpanelClient client = MixpanelClient.GetCurrentClient();
            ProfileUpdate  pu     = GetProfileUpdate7();

            client.Track(pu);
        }
Ejemplo n.º 3
0
        public async Task WP8SL_TrySendLocalElementsTest()
        {
            MixpanelClient client = await MixpanelClient.GetCurrentClient();

            TrackingEvent e1 = GetEvent1();
            await client.SaveElement <TrackingEvent>(e1);

            TrackingEvent e2 = GetEvent2();
            await client.SaveElement <TrackingEvent>(e2);

            ProfileUpdate p1 = GetProfileUpdate1();
            await client.SaveElement <ProfileUpdate>(p1);

            ProfileUpdate p2 = GetProfileUpdate2();
            await client.SaveElement <ProfileUpdate>(p2);

            ProfileUpdate p3 = GetProfileUpdate3();
            await client.SaveElement <ProfileUpdate>(p3);

            ProfileUpdate p4 = GetProfileUpdate4();
            await client.SaveElement <ProfileUpdate>(p4);

            ProfileUpdate p5 = GetProfileUpdate5();
            await client.SaveElement <ProfileUpdate>(p5);

            ProfileUpdate p6 = GetProfileUpdate6();
            await client.SaveElement <ProfileUpdate>(p6);

            ProfileUpdate p7 = GetProfileUpdate7();
            await client.SaveElement <ProfileUpdate>(p7);

            await client.TrySendLocalElements();
        }
Ejemplo n.º 4
0
        private ProfileUpdate GetProfileUpdate2()
        {
            ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.SetOnce);

            pu.OperationValues["First login date"] = MixpanelClient.ConvertToMixpanelDate(DateTime.Now);
            return(pu);
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> UserSettings(ProfileUpdate profileUpdate)
        {
            var x = _userManager.FindByNameAsync(User.Identity.Name);

            if (!string.IsNullOrEmpty(profileUpdate.FullName) && !string.IsNullOrWhiteSpace(profileUpdate.FullName))
            {
                x.Result.FullName = profileUpdate.FullName;
            }

            if (!string.IsNullOrEmpty(profileUpdate.Description) && !string.IsNullOrWhiteSpace(profileUpdate.Description))
            {
                x.Result.Description = profileUpdate.Description;
            }

            if (profileUpdate.Image != null)
            {
                var fullpath  = _folder + $"/img/uploads/{profileUpdate.Image.FileName}";
                var shortPath = $"/img/uploads/{profileUpdate.Image.FileName}";
                using (var stream = new FileStream(fullpath, FileMode.Create))
                {
                    await profileUpdate.Image.CopyToAsync(stream);
                }

                x.Result.ImageUrl = shortPath;
            }

            _users.SaveChanges();

            return(RedirectToAction("UserSettings"));
        }
Ejemplo n.º 6
0
        private ProfileUpdate GetProfileUpdate3()
        {
            ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.Add);

            pu.OperationValues["Coins gathered"] = 12;
            return(pu);
        }
Ejemplo n.º 7
0
        private ProfileUpdate GetProfileUpdate4()
        {
            ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.Append);

            pu.OperationValues["Power Ups"] = "Bubble Lead";
            return(pu);
        }
Ejemplo n.º 8
0
        public async Task UNIVERSAL_ProfileUpdateTest6()
        {
            MixpanelClient client = await MixpanelClient.GetCurrentClient();

            ProfileUpdate pu = GetProfileUpdate6();
            await client.Track <ProfileUpdate>(pu);
        }
Ejemplo n.º 9
0
        public async Task WP8SL_ProfileUpdateTest7()
        {
            MixpanelClient client = await MixpanelClient.GetCurrentClient();

            ProfileUpdate pu = GetProfileUpdate7();
            await client.Track <ProfileUpdate>(pu);
        }
Ejemplo n.º 10
0
        public void NETFX_RevenueTrackingTest()
        {
            MixpanelClient client = MixpanelClient.GetCurrentClient();
            ProfileUpdate  pu     = GetRevenueTracking();

            client.IsVerboseEnabled     = true;
            client.IsGeolocationEnabled = false;
            client.Track(pu);
        }
Ejemplo n.º 11
0
        private ProfileUpdate GetProfileUpdate1()
        {
            ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.Set);

            pu.IP = "123.123.123.123";
            pu.OperationValues["Address"]  = "1313 Mockingbird Lane";
            pu.OperationValues["Birthday"] = "1948-01-01";
            return(pu);
        }
Ejemplo n.º 12
0
        private ProfileUpdate GetRevenueTracking()
        {
            ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.Append);
            Dictionary <string, object> transactions = new Dictionary <string, object>();

            transactions["$time"]               = "2013-01-03T09:00:00";
            transactions["$amount"]             = 25.34f;
            pu.OperationValues["$transactions"] = transactions;
            return(pu);
        }
Ejemplo n.º 13
0
        private ProfileUpdate GetProfileUpdate5()
        {
            ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.Union);

            pu.OperationValues["Items purchased"] = new List <string>()
            {
                "socks", "shirts"
            };
            return(pu);
        }
Ejemplo n.º 14
0
        private ProfileUpdate GetProfileUpdate6()
        {
            ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.Unset);

            pu.UnsetValueList = new List <string>()
            {
                "Days overdue"
            };
            return(pu);
        }
Ejemplo n.º 15
0
        public async Task WP8SL_RevenueTrackingTest()
        {
            MixpanelClient client = await MixpanelClient.GetCurrentClient();

            client.IsGeolocationEnabled = false;
            ProfileUpdate pu = GetRevenueTracking();

            client.IsVerboseEnabled = true;

            await client.Track <ProfileUpdate>(pu);
        }
Ejemplo n.º 16
0
        public void UT_ProfleUpdate_IFC()
        {
            // test 0: "IFC BREP-26" => "IFC_BREP26"
            initGr("IFC BREP-26");

            var xx = new ProfileUpdate(ref elmGroups);
            Assert.AreEqual("ifc_brep-26", elmGroups[0].prf);
            Assert.AreEqual("IFC_BREP-26", elmGroups[0].Prf);

            //test 1: 
        }
        public JsonResult update(ProfileUpdate profile)
        {
            String userId           = User.Identity.GetUserId();
            ApplicationDbContext db = new ApplicationDbContext();
            var prop = db.Users.Where(item => item.Id == userId).FirstOrDefault();

            prop.Email       = profile.Email;
            prop.adresse     = profile.adresse;
            prop.PhoneNumber = profile.PhoneNumber;
            prop.nomComplet  = profile.nomComplet;
            db.SaveChanges();
            return(Json("Profile updated"));
        }
Ejemplo n.º 18
0
        public bool ProfileEdit(ProfileUpdate model)
        {
            var query =
                _context
                .Profiles
                .Single(j => j.ProfileId == model.ProfileId);

            query.ProfileId = model.ProfileId;
            query.UserName  = model.UserName;
            query.FirstName = model.FirstName;
            query.LastName  = model.LastName;
            query.Email     = model.Email;
            return(_context.SaveChanges() == 1);
        }
Ejemplo n.º 19
0
        public void UpdateUserProfile()

        {
            ProfileUpdate profile = new ProfileUpdate();

            Thread.Sleep(2000);
            Actions action = new Actions(Driver.driver);

            action.MoveToElement(profile.Account).Click().Build().Perform();
            profile.Profile.Click();
            profile.FirstName.SendKeys("S");
            profile.Lastname.SendKeys("Survys");
            profile.ZipCode.Clear();
            profile.ZipCode.SendKeys("06905");
            profile.ZipCode.Submit();
        }
Ejemplo n.º 20
0
        public async Task <IActionResult> UpdateProfile([FromBody] ProfileUpdate model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var user = await _profileRepository.GetUserProfile(model.id);

            if (user == null)
            {
                return(BadRequest());
            }



            user.FirstName = model.firstname;
            user.LastName  = model.lastname;
            user.UserName  = model.username;
            user.City      = model.city;
            user.State     = model.state;
            user.ZipCode   = model.zipcode;


            if (model.file.Length > 0)
            {
                string fileupload = _fileuploadService.FileUpload(model.file);
                if (fileupload != "")
                {
                    user.Image = fileupload;
                }
            }
            else
            {
                user.Image = "";
            }



            _profileRepository.UpdateUserProfile(user);

            if (_profileRepository.SaveChanges() > 0)
            {
                return(Ok());
            }

            return(BadRequest());
        }
Ejemplo n.º 21
0
        public void UT_ProfileUpdate_PL()   // Пластины
        {
            // test 0: "PL6" -> "—6"
            initGr("PL6");
            var xx = new ProfileUpdate(ref elmGroups);
            Assert.AreEqual("—6", elmGroups[0].Prf);

            // test 1: "PL100*6" => "—6x100"
            initGr("PL100x6");
            xx = new ProfileUpdate(ref elmGroups);
            Assert.AreEqual("—6x100", elmGroups[0].Prf);

            // test 2: "PL6*100" => "—6x100"
            initGr("PL6*100");
            xx = new ProfileUpdate(ref elmGroups); 
            Assert.AreEqual("—6x100", elmGroups[0].Prf);
        }
Ejemplo n.º 22
0
        public void UT_ProfileUpdate_TK_TP()
        {
            // test 0TP: "TР 480X32" -> "TP480x32"
            initGr("TР 480X32");
            var xx = new ProfileUpdate(ref elmGroups);
            Assert.AreEqual("TP480x32", elmGroups[0].Prf);

            // test 1TP: "Тр. 50X25X3" -> "TP480x32"
            initGr("Тр. 50X25X3");
            xx = new ProfileUpdate(ref elmGroups);
            Assert.AreEqual("TP50x25x3", elmGroups[0].Prf);

            // test 2TK: "TK 133X6" -> "TK133x6"
            initGr("TK 133X6");
            xx = new ProfileUpdate(ref elmGroups);
            Assert.AreEqual("TK133x6", elmGroups[0].Prf);
        }
Ejemplo n.º 23
0
 //update profile info
 public bool UpdateProfileInfo(ProfileUpdate profile)
 {
     using (var ctx = new ApplicationDbContext())
     {
         var oldProfile = ctx.UserProfile.Include("Photo").SingleOrDefault(e => e.UserID == _userId);
         if (oldProfile != null)
         {
             if (profile.PhotoUpload != null && profile.PhotoUpload.ContentLength > 0)
             {
                 var photo = new Photo
                 {
                     PhotoName      = System.IO.Path.GetFileName(profile.PhotoUpload.FileName),
                     FileType       = FileType.Profile,
                     ContentType    = profile.PhotoUpload.ContentType,
                     DateOfCreation = DateTimeOffset.UtcNow
                 };
                 using (var reader = new System.IO.BinaryReader(profile.PhotoUpload.InputStream))
                 {
                     photo.Content = reader.ReadBytes(profile.PhotoUpload.ContentLength);
                 }
                 if (oldProfile.Photo.Count > 0)
                 {
                     oldProfile.Photo.Clear();
                 }
                 oldProfile.Photo = new List <Photo> {
                     photo
                 };
             }
             oldProfile.About = profile.About;
             oldProfile.DateOfModification = DateTimeOffset.UtcNow;
             var save = ctx.SaveChanges();
             if (save == 3 || save == 4)
             {
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         else
         {
             return(false);
         }
     }
 }
Ejemplo n.º 24
0
        public ActionResult Edit(ProfileUpdate model)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            var service = GetProfileService();

            if (!service.ProfileEdit(model))
            {
                ModelState.AddModelError("", "Internal server error");
                return(View(model));
            }

            return(RedirectToAction(nameof(Index)));
        }
        public async Task <ActionResult> Update(ProfileUpdate profileUpdate)
        {
            var updateUser = profileUpdate.GetUserForUpdate();

            if (updateUser != null)
            {
                await GraphHelper.UpdateUserProfileAsync(updateUser);
            }

            var updatePhoneUser = profileUpdate.GetUserForMobilePhoneUpdate();

            if (updatePhoneUser != null)
            {
                await GraphHelper.UpdateUserProfileAsync(updatePhoneUser);
            }

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 26
0
 public async void OnUpdateCommand()
 {
     if (string.IsNullOrEmpty(Phoneno))
     {
         await App.Current.MainPage.DisplayAlert("HMS", "Please enter mobile no.", "OK");
     }
     else if (Phoneno.Length != 10)
     {
         await App.Current.MainPage.DisplayAlert("HMS", "Please enter 10 digit mobile no.", "OK");
     }
     else
     {
         profileUpdate            = new ProfileUpdate();
         profileUpdate.studentId  = App.userid;
         profileUpdate.stuPhoneNo = Phoneno;
         studentService.UpdateProfile(profileUpdate);
     }
 }
Ejemplo n.º 27
0
        public void NETFX_TrySendLocalElementsTest()
        {
            MixpanelClient client = MixpanelClient.GetCurrentClient();

            TrackingEvent e1 = GetEvent1();

            client.SaveElement(e1);

            TrackingEvent e2 = GetEvent2();

            client.SaveElement(e2);

            ProfileUpdate p1 = GetProfileUpdate1();

            client.SaveElement(p1);

            ProfileUpdate p2 = GetProfileUpdate2();

            client.SaveElement(p2);

            ProfileUpdate p3 = GetProfileUpdate3();

            client.SaveElement(p3);

            ProfileUpdate p4 = GetProfileUpdate4();

            client.SaveElement(p4);

            ProfileUpdate p5 = GetProfileUpdate5();

            client.SaveElement(p5);

            ProfileUpdate p6 = GetProfileUpdate6();

            client.SaveElement(p6);

            ProfileUpdate p7 = GetProfileUpdate7();

            client.SaveElement(p7);

            client.TrySendLocalElements();
        }
Ejemplo n.º 28
0
        public ActionResult Edit(string id)
        {
            var service = GetProfileService();

            if (!service.GetByIdTest(id))
            {
                return(RedirectToAction(nameof(Index)));
            }
            var detail  = service.GetById(id);
            var profile = new ProfileUpdate
            {
                ProfileId = detail.ProfileId,
                UserName  = detail.UserName,
                FirstName = detail.FirstName,
                LastName  = detail.LastName,
                Email     = detail.Email
            };

            return(View(profile));
        }
Ejemplo n.º 29
0
        public ActionResult Edit(ProfileUpdate update)
        {
            if (!ModelState.IsValid)
            {
                return(View(update));
            }
            if (update.UserID != Guid.Parse(User.Identity.GetUserId()))
            {
                ModelState.AddModelError("", "Id Mismatch");
                return(View(update));
            }
            var service = CreateProfileService();

            if (service.UpdateProfileInfo(update))
            {
                TempData["SaveResult"] = "Your Profile was updated";
                return(RedirectToAction("Index"));
            }
            return(View(update));
        }
Ejemplo n.º 30
0
        public void UT_ProfileUpdate_L()
        {
            // Уголки равнополочные ГОСТ 8509-93 и неравнополочные ГОСТ 8510-86 --- 
            // test 1L: "L40X5_8509_93" => "L40x5"
            initGr("L40X5_8509_93");
            var xx = new ProfileUpdate(ref elmGroups);
            Assert.AreEqual("l40x5", elmGroups[0].prf);
            Assert.AreEqual("L40x5", elmGroups[0].Prf);

            // test 2L: "L250X35_8509_93" => "L250x35"
            initGr("L250X35_8509_93");
            xx = new ProfileUpdate(ref elmGroups);
            Assert.AreEqual("l250x35", elmGroups[0].prf);
            Assert.AreEqual("L250x35", elmGroups[0].Prf);

            // test 3L: "L75X50X8_8510_86" => "L75x50x8"
            initGr("L75X50X8_8510_86");
            xx = new ProfileUpdate(ref elmGroups);
            Assert.AreEqual("l75x50x8", elmGroups[0].prf);
            Assert.AreEqual("L75x50x8", elmGroups[0].Prf);
        }
Ejemplo n.º 31
0
        public ProfilePrediction Put(ProfileUpdate request)
        {
            var dueDate = repo.DueDates.GetById(1);

            var profile = getCurrentProfileFromSession();

            if (profile != null)
            {
                profile.Name = request.Name ?? profile.Name;

                repo.Profiles.Update(profile);

                return getAggregate(profile);
            }
            else
            {

            }
            return null;
        }