예제 #1
0
        /// <summary>
        /// Show the window to enter some winfo about woman (login, password, etc.)
        /// </summary>
        /// <returns>True if all went till the end.</returns>
        public static bool EditWoman()
        {
            NewEditWomanForm form = new NewEditWomanForm();

            form.WomanName     = CurrentWoman.Name;
            form.WomanPassword = CurrentWoman.Password;
            form.Text          = TEXT.Get["Edit_woman"];
            if (form.ShowDialog() == DialogResult.OK)
            {
                CurrentWoman.Name     = form.WomanName;
                CurrentWoman.Password = form.WomanPassword;
                if (!string.IsNullOrEmpty(CurrentWoman.Password))
                {
                    CurrentWoman.AllwaysAskPassword = true;
                }

                ApplicationForm.SetWomanName(CurrentWoman.Name);
                return(true);
            }

            return(false);
        }
예제 #2
0
        /// <summary>
        /// Make an attempt to leave current woman and create a new one.
        /// </summary>
        /// <returns>Truye if new woman was created and applied.</returns>
        public static bool NewWoman()
        {
            if (AskAndSaveCurrentWoman())
            {
                NewEditWomanForm form = new NewEditWomanForm();
                if (form.ShowDialog() == DialogResult.OK)
                {
                    Woman w = new Woman();
                    w.Name     = form.WomanName;
                    w.Password = form.WomanPassword;
                    if (!string.IsNullOrEmpty(w.Password))
                    {
                        w.AllwaysAskPassword = true;
                    }

                    CurrentWoman = w;
                    return(true);
                }
            }

            return(false);
        }