Пример #1
0
        private void IsValid()
        {
            try
            {
                var signIn = new Medi_Care.Models.SignIn
                {
                    Name     = txtUserName.Text,
                    Password = txtPassword.Text
                };

                var exist = signInService.GetUser(signIn);

                if (exist)
                {
                    Reception reception = new Reception();
                    reception.SignedInUser(signIn.Name.ToLower());
                    reception.Show();
                    this.Hide();

                    string            msge    = "Log In Successfull!";
                    string            title   = "Success";
                    MessageBoxButtons buttons = MessageBoxButtons.OK;
                    MessageBoxIcon    icon    = MessageBoxIcon.Information;

                    message.message(msge, title, buttons, icon);
                }
                else
                {
                    string            msge    = "Incorrect User Name or Password.";
                    string            title   = "Sign In Fail";
                    MessageBoxButtons buttons = MessageBoxButtons.RetryCancel;
                    MessageBoxIcon    icon    = MessageBoxIcon.Warning;

                    message.message(msge, title, buttons, icon);
                    RefreshForm();
                }
            }
            catch (Exception)
            {
            }
        }