Exemplo n.º 1
0
        private void statbarUserProfile_Click(object sender, EventArgs e)
        {
            ProfileForm f = new ProfileForm(MSettings.CurrentSession.LoggedUser);

            f.ShowDialog();
            RefreshStatusBarData();
        }
Exemplo n.º 2
0
        public ServiceResult UpdateProfile(ProfileForm p)
        {
            if (p == null)
            {
                return(ServiceResponse.Error("Invalid form sent to server."));
            }

            UserManager userManager = new UserManager(Globals.DBConnectionKey, Request.Headers?.Authorization?.Parameter);

            TreeMon.Models.Membership.Profile dbProfile = userManager.GetCurrentProfile(p.UserUUID);
            if (dbProfile == null)
            {
                return(ServiceResponse.Error("Profile not found."));
            }

            var config = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <ProfileForm, TreeMon.Models.Membership.Profile>();
            });

            IMapper mapper = config.CreateMapper();
            var     dest   = mapper.Map <ProfileForm, TreeMon.Models.Membership.Profile>(p);

            return(userManager.LogUserProfile(dest));
        }
Exemplo n.º 3
0
        public void CheckValidation()
        {
            HomeForm home     = new HomeForm();
            string   expected = "2018 FIFA World Cup Russia™";
            string   actual   = home.Header.GetTitleText;

            Assert.AreEqual(expected.ToLower(), actual.ToLower());
            home.Header.OpenLoginForm();

            LoginPopup loginPopup = new LoginPopup();

            expected = loginPopup.GetLoginDescription;
            actual   = "Please sign in to your FIFA.com user account below. This will allow you to make the most of your account with personalization, plus get access to commenting tools, exclusive games, the chance to win cool football prizes and much, much more.";
            Assert.AreEqual(expected, actual);
            loginPopup.Login();

            LoginForm loginForm = new LoginForm();

            loginForm.SubmitLoginForm("*****@*****.**", "2lVyjYxxXks5K");
            loginForm.SignIn();
            home.Header.OpenLoginForm();
            expected = loginPopup.GetUsername;
            actual   = "TestUser13";
            Assert.AreEqual(expected, actual);

            loginPopup.GoToUserProfile();
            ProfileForm profile = new ProfileForm();

            expected = profile.UserEmail;
            actual   = "*****@*****.**";
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 4
0
        public JsonResult GetProfileJ(string userId, int loginId, int profileId)
        {
            List <ProfileForm> profs      = new List <ProfileForm>();
            ProfileForm        prof       = new ProfileForm();
            List <EntryCard>   entrycards = new List <EntryCard>();
            List <RoleForm>    roles      = new List <RoleForm>();

            prof = _userservices.GetProfileForm(userId, loginId, profileId);
            //prof.resp.message = "er|NO DATOS ENCONTRADOS|Admin Mgr";
            profs.Add(prof);

            entrycards = _userservices.GetEntryCards("", 0, prof.ProfileId, "");
            roles      = _userservices.GetRolesForm(userId);

            string sdata = "er|NO DATOS ENCONTRADOS|Admin Mgr";

            if (profs.Count > 0)
            {
                sdata  = Objeto.SerializarLista(profs, '|', '~', false);
                sdata += "^";
                if (entrycards.Count > 0)
                {
                    sdata += Objeto.SerializarLista(entrycards, '|', '~', false);
                }
                sdata += "^";
                if (roles.Count > 0)
                {
                    sdata += Objeto.SerializarLista(roles, '|', '~', false);
                }
            }

            return(Json(sdata));
        }
Exemplo n.º 5
0
        public void RunTest()
        {
            MainForm mainForm = new MainForm();

            Log.Step(1);
            mainForm.ClickCatalogMenu();
            CatalogPage catalog = new CatalogPage();

            Log.Step(2);
            catalog.Select_Catalog_Product();
            nameProductFromCatalog = catalog.GetNameProduct();

            Log.Step(3);
            catalog.ShowPricesForProduct();

            Log.Step(4);
            catalog.AddBookmark();

            Log.Step(5);
            LoginForm loginForm = new LoginForm();

            loginForm.Login(_email, _password);

            Log.Step(6);
            ProfileForm profile = new ProfileForm();

            profile.OpenBookmakers("Каталог");
            profile.AssertName(nameProductFromCatalog);

            Log.Step(7);
            profile.RemoveAllBookmakers();
            profile.AssertName(nameProductFromCatalog);
        }
        private void dataGridView_ListStudentProfile_DoubleClick(object sender, EventArgs e)
        {
            ProfileForm profileForm = new ProfileForm();

            ProfileForm.dgvr = dataGridView_ListStudentProfile;
            profileForm.ShowDialog();
        }
Exemplo n.º 7
0
        private void metroButton2_Click(object sender, EventArgs e)
        {
            ProfileForm pf = new ProfileForm(this, username);

            pf.Show();
            this.Hide();
        }
Exemplo n.º 8
0
        public async Task <ActionResult <ApiResult <Profile> > > Update([FromForm] ProfileForm profileForm)
        {
            return(ReturnResponse(() =>
            {
                Document cv = null;
                Document photo = null;

                if (profileForm.Cv != null)
                {
                    cv = new Document(profileForm.DocumentId_CV, profileForm.Cv);
                }
                if (profileForm.Photo != null)
                {
                    photo = new Document(profileForm.DocumentId_Photo, profileForm.Photo);
                }

                Profile profile = new Profile
                {
                    Advantage = profileForm.Advantage,
                    isPrincipal = profileForm.isPrincipal,
                    PastPro = profileForm.PastPro,
                    Presentation = profileForm.Presentation,
                    Price = profileForm.Price,
                    WhyMe = profileForm.WhyMe,
                    Cv = cv,
                    Photo = photo,
                    ProfileId = profileForm.ProfileId,
                    DocumentId_CV = profileForm.DocumentId_CV,
                    DocumentId_Photo = profileForm.DocumentId_Photo
                };

                return _profile.Update(profile);
            }));
        }
Exemplo n.º 9
0
        private void luckyButton_Click(object sender, EventArgs e)
        {
            int rndID       = _finderRepository.GetRandomID(CurrentUser.GetId());
            var profileForm = new ProfileForm(rndID);

            profileForm.Show();
        }
Exemplo n.º 10
0
        public void PrintProfileView()
        {
            ProfileForm frm = new ProfileForm();

            frm.ShowDialog();
            //ActivateItem(_profileReportVM);
        }
Exemplo n.º 11
0
        public void otvoriProfil()
        {
            Profile pomProfile = getProfile(this.logovaniKorisnik.Username);
            List <MatchStatistics> pomListMatchHistory = getUserMatchHistory(this.logovaniKorisnik.Username);
            ProfileForm            pf = new ProfileForm(pomProfile, pomListMatchHistory);

            pf.ShowDialog();
        }
        private void profilebtn_Click(object sender, EventArgs e)
        {
            ProfileForm prffrm = new ProfileForm();

            this.Hide();
            prffrm.ShowDialog();
            this.Close();
        }
Exemplo n.º 13
0
 public void InsertFriend(int idx, ProfileForm people)
 {
     list[idx].List.Add(new ProfileForm()
     {
         Uid       = people.Uid,
         NickName  = people.NickName,
         Introduce = people.Introduce
     });
 }
        public JsonResult Update(ProfileForm form)
        {
            var user = _userManager.FindById(User.Identity.GetUserId());
            user.Email = form.EmailAddress;
            user.UserName = form.FullName;
            _userManager.Update(user);

            return Json(true);
        }
Exemplo n.º 15
0
        public async Task <ProfileForm> InsertAsync(ProfileForm profileForm)
        {
            using (var connection = GetConnection())
            {
                await connection.QueryAsync(_queryFactory.GetQuery(QueryType.Insert), ProfileForm.New(profileForm));

                return(profileForm);
            }
        }
Exemplo n.º 16
0
        public CausesForm(ProfileForm profile, List <Cause> organizationCauses)
        {
            InitializeComponent();

            parent     = profile;
            controller = new CausesController(this, organizationCauses);

            controller.OnScreenCreated();
        }
Exemplo n.º 17
0
        public JsonResult Update(ProfileForm form)
        {
            var user = _userManager.FindById(User.Identity.GetUserId());

            user.Email    = form.EmailAddress;
            user.UserName = form.FullName;
            _userManager.Update(user);

            return(Json(true));
        }
Exemplo n.º 18
0
 void OnRegister()
 {
     if (!Utils.IsValidEmailAddress(username_input.text))
     {
         PopupManager.instance.ShowAlertPopup("กรุณากรอกอีเมล์ให้ถูกต้อง");
         return;
     }
     form       = ProfileForm.register;
     urlService = "http://thewalklifestylemall.com/service/register";
     RequestToServer(urlService);
 }
Exemplo n.º 19
0
        public JsonResult OnPost([FromBody] ProfileForm form)
        {
            JsonResult res = new JsonResult("{\"success\":\"False\"," +
                                            "\"reason\":\"none\"}", new System.Text.Json.JsonSerializerOptions());

            if (form.Action == "request")
            {
                res = handleRequest(form);
            }

            return(res);
        }
Exemplo n.º 20
0
        private void btnProfile_Click(object sender, EventArgs e)
        {
            if (selected != 1)
            {
                closeCurrentForm();

                profileForm           = new ProfileForm();
                selected              = 1;
                profileForm.MdiParent = this;
                profileForm.Show();
            }
        }
        private void FriendTreeView_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (((TreeViewItem)sender).DataContext is FriendTreeViewForm)
            {
                SelectedProfile = null;
                return;
            }

            ((TreeViewItem)sender).IsSelected = true;
            e.Handled       = true;
            SelectedProfile = FriendTreeView.SelectedItem as ProfileForm;
        }
Exemplo n.º 22
0
        public void ProfileFormTest()
        {
            int         aId              = 1;
            ProfileForm pF               = new ProfileForm(aId, false);
            bool        editVisibility   = pF.GetEditButtonVisibility();
            bool        deleteVisibility = pF.GetDeleteButtonVisibility();
            int         actualId         = pF.GetAcId();

            Assert.AreEqual(aId, actualId);
            Assert.AreEqual(false, editVisibility);
            Assert.AreEqual(false, deleteVisibility);
        }
Exemplo n.º 23
0
        public JsonResult handleRequest(ProfileForm form)
        {
            var success = false;

            try
            {
                var handler = new ConnectionHandler();
                using (MySqlConnection connection = handler.Connection)
                {
                    string       sql = "SELECT requestId FROM BookRequests WHERE ISBN=@ISBN AND userId=@USERID";
                    MySqlCommand cmd = new MySqlCommand(sql, connection);

                    cmd.Parameters.AddWithValue("@ISBN", form.Data);
                    cmd.Parameters.AddWithValue("@USERID", HttpContext.Session.GetString("userId"));
                    int requestId = -1;

                    using (MySqlDataReader rdr = cmd.ExecuteReader())
                    {
                        if (rdr.Read())
                        {
                            requestId = (int)rdr[0];
                        }
                    }

                    // if there is already a request of this book from the user, ignore this
                    if (requestId != -1)
                    {
                        success = true;
                    }
                    else
                    {
                        cmd.CommandText = "INSERT INTO BookRequests(userId, ISBN, dateRequested) VALUES (@USERID, @ISBN, CURDATE())";
                        cmd.ExecuteNonQuery();
                        success = true;
                    }
                }
            }
            catch (Exception ex)
            {
                success = false;
                Console.WriteLine(ex);
            }

            var reason = "unknown";

            if (success)
            {
                reason = "none";
            }
            return(new JsonResult($"{{\"success\":\"{success}\"," +
                                  $"\"reason\":\"{reason}\"}}", new System.Text.Json.JsonSerializerOptions()));
        }
Exemplo n.º 24
0
 //主控面>>員工連結
 private void btnEmployee_Click(object sender, EventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;
     try
     {
         ProfileForm p = new ProfileForm();
         p.Show();
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Exemplo n.º 25
0
        private void KORSN_btnProfile_Click(object sender, EventArgs e)
        {
            if (KORSN_dgvUsers.SelectedRows.Count == 0)
            {
                MUtility.ShowInformation("Odaberite korisnika");
                return;
            }

            User sel = (User)KORSN_dgvUsers.SelectedRows[0].DataBoundItem;

            ProfileForm pf = new ProfileForm(sel);

            pf.ShowDialog();
        }
Exemplo n.º 26
0
        public void ShowProfileFormTest()
        {
            int      aId = 1;
            MainForm mF  = new MainForm();

            mF.SetIsAdminLoggedIn(true);
            ProfileForm pF               = mF.ShowProfileForm(aId);
            bool        editVisibility   = pF.GetEditButtonVisibility();
            bool        deleteVisibility = pF.GetDeleteButtonVisibility();
            int         actualId         = pF.GetAcId();

            Assert.AreEqual(aId, actualId);
            Assert.AreEqual(true, editVisibility);
            Assert.AreEqual(true, deleteVisibility);
        }
Exemplo n.º 27
0
        private void LargeHeader_Submited(object sender, TappedRoutedEventArgs e)
        {
            var form = new ProfileForm()
            {
                Name     = nameTb.Text,
                Sex      = sexTb.SelectedIndex,
                Birthday = birthdayTb.Date.Value.ToString("yyyy-MM-dd")
            };

            if (string.IsNullOrWhiteSpace(form.Name))
            {
                _ = new MessageDialog(Constants.GetString("edit_name_error")).ShowAsync();
                return;
            }
            _ = EditProfileAsync(form);
        }
Exemplo n.º 28
0
        // GET: Me/Profile
        public ActionResult Index()
        {
            ProfileViewModel ViewModel = new ProfileViewModel();
            AspNetUser       user      = db.AspNetUsers.Where(x => x.UserName.Equals(User.Identity.Name)).FirstOrDefault();

            UserProfile profile = user.UserProfile;

            if (null != profile)
            {
                var form = new ProfileForm();
                form.Firstname        = profile.Firstname;
                form.Surname          = profile.Surname;
                form.Profession       = profile.Profession;
                ViewModel.ProfileForm = form;
            }
            return(View(ViewModel));
        }
Exemplo n.º 29
0
        public string UpdateProf(string profileId,
                                 string activopf,
                                 string nombrepf,
                                 string supervidorId,
                                 string phonepf,
                                 string extensionpf,
                                 string phproveedorId,
                                 string contactosPerm,
                                 string twitter,
                                 string facebook,
                                 string instagram,
                                 string linkedIn
                                 )
        {
            ResponseModel resp = new ResponseModel();

            resp.message = "wn| Usuario No encontrado|Usuarios Mgr";


            ProfileForm prof = new ProfileForm();

            //prof = _userservices.GetProfileForm(int.Parse(xprofileId));

            if (prof != null)
            {
                prof.ProfileId           = int.Parse(profileId);
                prof.Activo              = (activopf == "true") ? true : false;
                prof.Nombre              = nombrepf;
                prof.SupervisorID        = int.Parse(Global.ExtractOnlyNumeric(supervidorId));
                prof.Phone               = phonepf;
                prof.Extension           = extensionpf;
                prof.PhoneProviderID     = int.Parse(Global.ExtractOnlyNumeric(phproveedorId));
                prof.ContactosPermitidos = int.Parse(Global.ExtractOnlyNumeric(contactosPerm));

                prof.twitter   = "" + twitter;
                prof.facebook  = "" + facebook;
                prof.instagram = "" + instagram;
                prof.linkedIn  = "" + linkedIn;

                resp = _userservices.UpdateProfile(prof);
            }

            return(resp.message);
        }
Exemplo n.º 30
0
        //loginclicked
        void btnLoginClicked(object sender, MouseEventArgs e)
        {
            TcpClient     tcpClient = new TcpClient(server, 7000);
            NetworkStream stream    = tcpClient.GetStream();
            string        id        = tbx_ID.Text;
            string        password  = tbx_password.Text;
            ByteField     loginmsg  = new ByteField(256);

            string    msg = id + " " + password;
            TcpHeader head;

            head.mode    = 2;
            head.msgsize = 0;
            loginmsg.setHeader(head);
            loginmsg.ConcStrAfterHead(msg);
            loginmsg.setHeadLenByIndex();

            stream.Write(loginmsg.m_field, 0, (int)loginmsg.getheader().msgsize);

            int       cnt         = 0;
            ByteField msgFromServ = new ByteField(256);

            cnt += stream.Read(msgFromServ.m_field, 0, 256 - cnt);
            while (cnt < 8)
            {
                cnt += stream.Read(msgFromServ.m_field, cnt, 256 - cnt);
            }

            if (msgFromServ.getheader().mode == 200)
            {
                // 로그인 시작
                Form client = new ProfileForm();
                ((ProfileForm)client).initData(tbx_ID.Text, tcpClient, msgFromServ.getMsgStr());

                client.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("아이디와비밀번호를 확인해주세요");
            }
        }
Exemplo n.º 31
0
        public ServiceResult GetUserProfile()
        {
            UserManager userManager = new UserManager(Globals.DBConnectionKey, Request.Headers?.Authorization?.Parameter);

            TreeMon.Models.Membership.Profile profile = userManager.GetCurrentProfile(GetUser(Request.Headers?.Authorization?.Parameter)?.UUID);

            var config = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <TreeMon.Models.Membership.Profile, ProfileForm>();
            });

            IMapper mapper = config.CreateMapper();
            var     p      = mapper.Map <TreeMon.Models.Membership.Profile, ProfileForm>(profile);

            if (p == null)
            {
                p             = new ProfileForm();
                p.UserUUID    = CurrentUser.UUID;
                p.AccountUUID = CurrentUser.AccountUUID;
            }

            return(ServiceResponse.OK("", p));
        }