示例#1
0
 public async Task <IActionResult> EditExperience(Guid id, [FromForm] MyProfile p)
 {
     p.Id = id;
     return(HandleResult(await Mediator.Send(new Edit.Commnad {
         Profile = p
     })));
 }
示例#2
0
        public ActionResult UpdateProfile()
        {
            int id = (int)Session["admin"];

            var admin        = _context.GetAdmin(id);
            var adminDetails = _context.GetUserProfileDetails(id);

            MyProfile Adminmodel = new MyProfile
            {
                Id            = admin.ID,
                FirstName     = admin.FirstName,
                LastName      = admin.LastName,
                Email         = admin.EmailID,
                PhoneNumber   = adminDetails.PhoneNumber,
                CountryCodeId = adminDetails.PhoneNumberCounrtyCode
            };

            MyProfileViewModel model = new MyProfileViewModel
            {
                Admin     = Adminmodel,
                Countries = _context.GetCountries()
            };

            return(View(model));
        }
示例#3
0
        public async Task <MyProfile> GetMyProfile(string username, string password)
        {
            var loginToken = Settings.AuthLoginToken;

            if (!string.IsNullOrEmpty(loginToken))
            {
                using (var client = new HttpClient())
                {
                    client.BaseAddress = new Uri(baseUrl);
                    client.DefaultRequestHeaders.Accept.Clear();
                    client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));


                    List <KeyValuePair <string, string> > postData = new List <KeyValuePair <string, string> >();

                    postData.Add(new KeyValuePair <string, string>("Authorization", "Bearer " + loginToken));
                    postData.Add(new KeyValuePair <string, string>("username", username));
                    postData.Add(new KeyValuePair <string, string>("password", password));
                    FormUrlEncodedContent content = new FormUrlEncodedContent(postData);

                    HttpResponseMessage response = await client.GetAsync("api/account/user/" + username);

                    string jsonString = await response.Content.ReadAsStringAsync();

                    MyProfile responseData = JsonHelper.Deserialize <MyProfile>(jsonString);

                    return(responseData);
                }
            }
            else
            {
                return(null);
            }
            //throw new NotImplementedException();
        }
        public void MyProfile_DrobDownInitialization_Test_2()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://lionbridge.com/");

                MyProfile myProfile = new MyProfile(driver);

                /* Set of assertions */

                Assert.AreEqual(-1, myProfile.ItemsDropDownListIsExpanded);
                Assert.AreEqual(-1, myProfile.ItemsDropDownIsFull);
                Assert.AreEqual(-1, myProfile.ChosenItemsPerPage);

                myProfile.DropDownInitialization(driver);

                Assert.AreEqual(-1, myProfile.ItemsDropDownListIsExpanded);
                Assert.AreEqual(-1, myProfile.ItemsDropDownIsFull);
                Assert.AreEqual(-1, myProfile.ChosenItemsPerPage);
            }
        }
示例#5
0
            public void TestProfileCreate()
            {
                var student = new Contact
                {
                    MessageHistory = "2412",
                    Name           = "42",
                    Online         = true
                };

                var student2 = new Contact
                {
                    MessageHistory = "2412",
                    Name           = "42",
                    Online         = true
                };

                var contactList = new List <Contact> {
                    student, student2
                };

                var profile = new MyProfile
                {
                    MyContacts = contactList,
                    MyName     = "SuperCat"
                };

                Assert.That(profile.MyName == "SuperCat" &&
                            profile.MyContacts == contactList);
            }
示例#6
0
        public void MyProfileEdditorTest5()
        {
            var student = new Contact
            {
                MessageHistory = "2412",
                Name           = "40",
                Online         = true
            };

            var student2 = new Contact
            {
                MessageHistory = "2412",
                Name           = "42",
                Online         = true
            };

            var contactList = new List <Contact> {
                student, student2
            };

            var profile = new MyProfile
            {
                MyContacts = contactList,
                MyName     = "Vova"
            };


            MyProfileEdditor.AddMessage(profile, "fdsgds", "123");
        }
示例#7
0
        public void MyProfileEdditorTest4()
        {
            var student = new Contact
            {
                MessageHistory = "2412",
                Name           = "40",
                Online         = true
            };

            var student2 = new Contact
            {
                MessageHistory = "2412",
                Name           = "42",
                Online         = true
            };

            var contactList = new List <Contact> {
                student, student2
            };

            var profile = new MyProfile
            {
                MyContacts = contactList,
                MyName     = "Vova"
            };


            MyProfileEdditor.ChangeStatus(profile, "esfs", false);

            Assert.True(profile.MyContacts[0].Online);

            MyProfileEdditor.DeleteContact(profile, "fdsgds");

            Assert.That(2, Is.EqualTo(profile.MyContacts.Count));
        }
        public void MyProfile_SaveButtonClick_Test_2()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://lionbridge.com/");

                MyProfile myProfile = new MyProfile(driver);

                /* Set of assertions */

                Assert.AreEqual(-1, myProfile.MyProfileBodyIsDisplayed);
                Assert.AreEqual(-1, myProfile.CloseButtonIsDisplayed);
                Assert.AreEqual(-1, myProfile.ReduceButtonIsDisplayed);
                Assert.AreEqual(-1, myProfile.FullscreenButtonIsDisplayed);
                Assert.AreEqual(-1, myProfile.SaveButtonIsDisplayed);

                myProfile.SaveButtonClick(driver);

                Assert.AreEqual(-1, myProfile.MyProfileBodyIsDisplayed);
                Assert.AreEqual(-1, myProfile.CloseButtonIsNull);
                Assert.AreEqual(-1, myProfile.ReduceButtonIsNull);
                Assert.AreEqual(-1, myProfile.FullscreenButtonIsNull);
                Assert.AreEqual(-1, myProfile.SaveButtonIsNull);
            }
        }
示例#9
0
        public ProfileDeepData LoadProfileDeepData(MyProfile profile)
        {
            _cacheProfileById.TryGetValue(profile.Id, out var cacheProfile);

            if (cacheProfile == null)
            {
                cacheProfile = new ProfileCache(profile);
            }

            if (cacheProfile.IsDeepLoad == false || !_enableCache)
            {
                var testTypes = new Dictionary <long, long>();

                _testTypeSelect.Parameters["@PROF_ID"].Value = profile.Id;

                using (var reader = _testTypeSelect.ExecuteReader())
                    while (reader.Read())
                    {
                        testTypes.Add(reader.GetInt32(0), reader.GetInt32(1));
                    }

                foreach (var testType in testTypes)
                {
                    FillParameters(cacheProfile.Profile.DeepData, testType.Key, testType.Value);
                }

                if (_enableCache)
                {
                    cacheProfile.IsDeepLoad       = true;
                    _cacheProfileById[profile.Id] = cacheProfile;
                }
            }

            return(cacheProfile.Profile.DeepData.Copy());
        }
示例#10
0
        public void MyProfileEdditorTest2()
        {
            var student = new Contact
            {
                MessageHistory = "2412",
                Name           = "40",
                Online         = true
            };

            var student2 = new Contact
            {
                MessageHistory = "2412",
                Name           = "42",
                Online         = true
            };

            var contactList = new List <Contact> {
                student, student2
            };

            var profile = new MyProfile
            {
                MyContacts = contactList,
                MyName     = "Vova"
            };


            MyProfileEdditor.AddMessage(profile, "40", "123");

            Assert.That("2412Vova : \n 123 \n", Is.EqualTo(profile.MyContacts[0].MessageHistory));

            Assert.That(1, Is.EqualTo(MyProfileEdditor.FindIndex(contactList, "42")));
            Assert.That(0, Is.EqualTo(MyProfileEdditor.FindIndex(contactList, "40")));
        }
        public void MyProfile_DrobDownButtonClick_Test_1()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = ""; // Project Name
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);
                testProjectPage.ProfileClick(driver);

                MyProfile myProfile = new MyProfile(driver);

                /* Set of assertions */

                Assert.AreEqual(0, myProfile.ItemsDropDownListIsExpanded);

                myProfile.ItemsDropDownButtonClick(driver);
                Assert.AreEqual(1, myProfile.ItemsDropDownListIsExpanded);
            }
        }
示例#12
0
        public ActionResult MyProfile(MyProfile profile)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction("MyProfile"));
            }

            using (var _Context = new ApplicationContext())
            {
                var user    = _Context.Users.Single(x => x.Email == User.Identity.Name);
                var details = _Context.User_Details.Single(x => x.UserId == user.UserId);

                profile.MAptoModel(user, details);

                if (profile.Image == null)
                {
                    details.Profile_Img = details.Profile_Img;
                }
                else
                {
                    details.Profile_Img = "../Members/" + user.UserId + "/" + profile.ProfileImage;
                    string _path = System.IO.Path.Combine(Server.MapPath("~/Members/" + user.UserId), profile.ProfileImage);
                    profile.Image.SaveAs(_path);
                }

                user.Modified_By      = user.UserId;
                user.Modified_Date    = DateTime.Now;
                details.Modified_date = DateTime.Now;

                _Context.SaveChanges();

                return(RedirectToAction("MyProfile"));
            }
        }
        public void MyProfile_ParsingCorrectly_Test_1()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = ""; // Project Name
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);
                testProjectPage.ProfileClick(driver);

                MyProfile myProfile = new MyProfile(driver);

                /* Set of assertions */

                Assert.AreEqual(1, myProfile.MyProfileBodyIsDisplayed);
                Assert.AreEqual(1, myProfile.CloseButtonIsDisplayed);
                Assert.AreEqual(1, myProfile.ReduceButtonIsDisplayed);
                Assert.AreEqual(1, myProfile.FullscreenButtonIsDisplayed);
                Assert.AreEqual(1, myProfile.SaveButtonIsDisplayed);
                Assert.IsTrue(myProfile.IsParsingCorrect);
            }
        }
示例#14
0
        private async Task ExecuteGetCPFeedCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            GetCPFeedCommand.ChangeCanExecute();

            try
            {
                myProfile = await cpFeed.GetMyProfile("stanley_alves", "cqzp798371@");

                this.Avatar      = myProfile.avatar;
                this.DisplayName = myProfile.displayName;
                Profile.Add(myProfile);
                // avatar.Add(profiles.avatar);
                IsBusy = false;
            }
            catch (Exception ex)
            {
            }
        }
        public void ParticularProjectPage_ProfileClick_Test_1()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = ""; // Project Name
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.ProfileClick(driver);
                MyProfile testProfile = new MyProfile(driver);

                /* Set of assertions */

                Assert.IsFalse(testProfile.MyProfileBodyIsNull);
                Assert.AreEqual(0, testProfile.ItemsBodyIsNull);
                Assert.AreEqual(-1, testProfile.ItemsDropDownIsFull);
                Assert.AreEqual(-1, testProfile.ChosenItemsPerPage);
            }
        }
示例#16
0
        public string deleteEmployment(string ID, int emp, MyProfile _Profile)
        {
            string result = string.Empty;

            if (Connection.State == ConnectionState.Open)
            {
                Connection.Close();
            }
            Connection.Open();
            command.Connection = Connection;
            command.Parameters.Add(new SqlParameter("@UserID", ID));
            command.Parameters.Add(new SqlParameter("@emp", emp));
            command.Parameters.AddWithValue("@result", "").Direction = ParameterDirection.Output;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "SP_deleteProfileEMP";
            DataAdapter         = new SqlDataAdapter(command);
            _dataset            = new DataSet();
            DataAdapter.Fill(_dataset);
            result = command.Parameters["@result"].Value.ToString();
            GetProfile(_dataset, _Profile);

            Connection.Close();
            command.Dispose();
            return(result);
        }
示例#17
0
        public void TestUpdateCurrentProfile()
        {
            new LoginPage()
            .SetEmailOrUserName("*****@*****.**")
            .SetPassword("control123")
            .ValidateLoginButton()
            .ClickLoginButton();

            MyProfile.GoTo()
            .IsAccountDisplayed()
            .SetUserName("Matt Damon")
            .SetRealName("Carlos Orellana")
            .SetEmail("*****@*****.**")
            .CheckKeepMyEmailAddressprivate()
            .SetCompany("Home")
            .SetLocation("Bol")
            .ClickUpdateProfile()

            .GoToUpdateAccountPopup()
            .ClickOk()

            .GoToMyProfilePage()
            .IsAccountDisplayed()
            .ValidateUserName("Matt Damon")
            .ValidateRealName("Carlos Orellana")
            .ValidateEmail("*****@*****.**")
            .IsCheckedKeepMyEmailAddressprivate()
            .ValidateCompany("Home")
            .ValidateLocation("Bol");
        }
示例#18
0
        public List <MyProfile> GetProfilesSuperficially(string mmeCode, string name = null)
        {
            try
            {
                var       profiles = new List <MyProfile>();
                DbCommand profileSelect;

                if (mmeCode == null)
                {
                    throw new ArgumentNullException(nameof(mmeCode));
                }
                if (string.IsNullOrEmpty(mmeCode))
                {
                    profileSelect = _selectAllTopProfile;
                }
                else if (string.IsNullOrEmpty(name))
                {
                    profileSelect = _profilesByMmeSelect;
                    profileSelect.Parameters["@MME_CODE"].Value = mmeCode;
                }
                else
                {
                    throw new NotImplementedException("_ProfilesByNameByMMESelect");
                    //profileSelect = _ProfilesByNameByMMESelect;
                    //profileSelect.Parameters["@PROF_NAME"].Value = name;
                    //profileSelect.Parameters["@MME_CODE"].Value = mmeCode;
                }

                if (_enableCache)
                {
                    _cacheProfilesByMmeCode.TryGetValue(mmeCode, out profiles);
                    if (profiles != null)
                    {
                        return(profiles.Select(m => m.Copy()).ToList());
                    }

                    _cacheProfilesByMmeCode[mmeCode] = profiles = new List <MyProfile>();
                }

                using (var reader = profileSelect.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var readProfile = new MyProfile(reader.GetInt32(0), reader.GetString(1), reader.GetGuid(2), reader.GetInt32(3), reader.GetDateTime(4));
                        profiles.Add(readProfile);
                        if (_enableCache)
                        {
                            _cacheProfileById[readProfile.Id] = new ProfileCache(readProfile);
                        }
                    }
                }

                return(profiles.Select(m => m.Copy()).ToList());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public void SetupTest()
 {
     this.driver    = new ChromeDriver();
     this.login     = new LoginMain(this.driver);
     this.utilities = new UtilitiesMain(this.driver);
     this.myprof    = new MyProfile(this.driver);
     utilities.ReportSetup();
 }
示例#20
0
        private void miPerfilToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var myProfile = new MyProfile();

            myProfile.Show();

            this.Close();
        }
示例#21
0
        public IActionResult Put(int id, [FromBody] MyProfile myProfile)
        {
            var profile = myProfileRepository.GetById(id);

            myProfileRepository.Update(profile);
            unitofwork.commit();

            return(Ok(myProfile));
        }
 public void SetupTest()
 {
     this.driver     = new ChromeDriver();
     this.myprofile  = new MyProfile(this.driver);
     this.login      = new LoginMain(this.driver);
     this.homepage   = new HomepageMain(this.driver);
     this.mybookings = new MyBookings(this.driver);
     this.utilities  = new UtilitiesMain(this.driver);
     utilities.ReportSetup();
 }
示例#23
0
    public void PrintDetails()
    {
        Accept a = new Accept();

        a.AcceptDetails();
        System.Console.Write("Hello " + a.firstname + " " + a.lastname + "!!!\nYou have Created Classes in OOP");
        MyProfile mp = new MyProfile();

        mp.DisplayProfile();
    }
        private void UpdateStatus(object sender, PropertyChangedEventArgs e)
        {
            _profile = MyProfileEdditor.ChangeStatus(_profile, _connection.StatusUpdate.Key,
                                                     _connection.StatusUpdate.Value);


            ContaktsListPresenter.GetContaktsViewModel(_profile.MyContacts, _mainWindow);


            _mainWindow.ChangeStatusContact(_connection.StatusUpdate.Key);
        }
示例#25
0
        public void RefreshProfile(MyProfile newProfile)
        {
            //Убираем задваивание
            newProfile.DeepData.TestParametersAndNormatives.Clear();
            _dbService.InvalidCacheById(ProfileVm.SelectedProfile.Id, ProfileVm.SelectedMmeCode);


            ProfileVm.Profiles.Insert(ProfileVm.Profiles.IndexOf(ProfileVm.SelectedProfile), newProfile);
            ProfileVm.Profiles.Remove(ProfileVm.SelectedProfile);
            ProfileVm.SelectedProfile = newProfile;
        }
示例#26
0
        public MyProfilePage NavigateToMyProfile()
        {
            MyProfile = WebElement.FindByXpath("//a[@class='nav-control-link']//span[@class='ng-scope'][contains(text(),'My Profile')]");

            MyProfile.Click();

            MyProfileChoice = WebElement.FindByXpath("//a[@class='nav-subitem-link']//span[@class='ng-scope'][contains(text(),'My Profile')]");

            MyProfileChoice.Click();

            return(new MyProfilePage(GetDriver()));
        }
示例#27
0
        public void Test6()
        {
            var student = new Contact
            {
                MessageHistory = "2412",
                Name           = "40",
                Online         = true
            };

            var student2 = new Contact
            {
                MessageHistory = "2412",
                Name           = "42",
                Online         = true
            };

            var contactList = new List <Contact> {
                student, student2
            };

            var profile = new MyProfile
            {
                MyContacts = contactList,
                MyName     = "i"
            };

            ConnectionServer server = new ConnectionServer();

            var mock = new Mock <IMessengerServerService>();

            var list = new[]
            {
                new Friend
                {
                    Name   = "Man",
                    Online = true
                },
                new Friend
                {
                    Name   = "LOL",
                    Online = true
                }
            };

            mock.Setup(foo => foo.FindUser("dsa")).Returns(list);

            server.Client = mock.Object;

            server.AddContact("dsa");

            mock.Verify(foo => foo.FindUser("dsa"), Times.Once);
        }
示例#28
0
        // GET: Profile

        public ActionResult Index()
        {
            List <MyProfile> profileList;

            try
            {
                dbcon.Open();
                profileList = MyProfile.GetProfileList(dbcon, "");
                dbcon.Close();
            }
            catch (Exception ex) { throw new Exception(ex.Message); }
            return(View(profileList));
        }
        public static MyProfile ChangeStatus(MyProfile profile, string contactName, bool status)
        {
            var i = FindIndex(profile.MyContacts, contactName);

            if (i == -1)
            {
                return(profile);
            }

            profile.MyContacts[i].Online = status;

            return(profile);
        }
        public static MyProfile DeleteContact(MyProfile profile, string contactName)
        {
            var i = FindIndex(profile.MyContacts, contactName);

            if (i == -1)
            {
                return(profile);
            }

            profile.MyContacts.RemoveAt(i);

            return(profile);
        }
示例#31
0
        private void ListProfileCallback()
        {
            if (_mp != null) { return; }
            _mp = new MyProfile();
            var web = (HttpWebRequest)WebRequest.Create(string.Format("https://api.vk.com/method/getProfiles?fields=photo&uid={0}&access_token={1}", Client.Instance.Access_token.uid, Client.Instance.Access_token.token));
            web.Method = "POST";
            web.ContentType = "application/x-www-form-urlencoded";
            web.BeginGetResponse(delegate(IAsyncResult e)
                                     {
                                         var request = (HttpWebRequest)e.AsyncState;
                                         var response = (HttpWebResponse)request.EndGetResponse(e);

                                         var responseReader = new StreamReader(response.GetResponseStream());

                                         try
                                         {
                                             var responseStringprofile = responseReader.ReadToEnd();
                                             var o = JObject.Parse(responseStringprofile);
                                             var responseArray = (JArray)o["response"];

                                             _mp = new MyProfile
                                                       {
                                                           Full_name = (string)responseArray[0]["first_name"] + " " + (string)responseArray[0]["last_name"],
                                                           Photo = (string)responseArray[0]["photo"]
                                                       };
                                             Dispatcher.BeginInvoke(StatusCallback);
                                         }
                                         catch (Exception ex)
                                         {
                                             Dispatcher.BeginInvoke(() =>
                                                                        {
                                                                            MessageBox.Show(ex.Message);
                                                                            progressBar1.IsIndeterminate = false;
                                                                        });
                                         }
                                     }, web);
            if (progressBar1.IsIndeterminate == false)
            {
                progressBar1.IsIndeterminate = true;
            }
        }
示例#32
0
        private void ProfileCallback()
        {
            if (_mp != null) { return; }
            _mp = new MyProfile();
            var web = (HttpWebRequest)WebRequest.Create(string.Format("https://api.vkontakte.ru/method/getProfiles?fields=photo_medium,contacts,bdate,city,education&uid={0}&access_token={1}", _uid, Client.Instance.Access_token.token));
            web.Method = "POST";
            web.ContentType = "application/x-www-form-urlencoded";
            web.BeginGetResponse(delegate(IAsyncResult e)
            {
                var request = (HttpWebRequest)e.AsyncState;
                var response = (HttpWebResponse)request.EndGetResponse(e);

                var responseReader = new StreamReader(response.GetResponseStream());
                try
                {
                    string responseStringprofile = responseReader.ReadToEnd();
                    var o = JObject.Parse(responseStringprofile);
                    var responseArray = (JArray)o["response"];
                    _mp = new MyProfile((string)responseArray[0]["first_name"], (string)responseArray[0]["last_name"], (string)responseArray[0]["photo_medium"]);
                    _mp.Full_name = _mp.First_name + " " + _mp.Last_name;
                    _mp.Mobile_phone = (string)responseArray[0]["mobile_phone"];
                    _mp.Bdate = (string)responseArray[0]["bdate"];
                    _mp.Sex = (string)responseArray[0]["sex"];
                    _mp.City = (string)responseArray[0]["city"];
                    _mp.University = (string)responseArray[0]["university_name"];
                    Dispatcher.BeginInvoke(() =>
                    {
                        ProfileStatusCallback();
                        Profile.Title = _mp.Full_name;
                    });
                }
                catch (Exception ex)
                {
                    Dispatcher.BeginInvoke(() =>
                    {
                        MessageBox.Show(ex.Message);
                        if (!progressBar1.IsIndeterminate) return;
                        progressBar1.IsIndeterminate = false;
                    });
                }
            }, web);
            if (progressBar1.IsIndeterminate == false)
            {
                progressBar1.IsIndeterminate = true;
            }
        }