Exemplo n.º 1
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            IValidate objIValidate = BinderSingleton.Instance.GetInstance <IValidate>();
            ResultDTO result       = objIValidate.validateLogin(txtusername.Text.Trim(), txtpassword.Text.Trim());

            if (result.IsSuccess)
            {
                ITransactionBusiness objITransactionBusiness = BinderSingleton.Instance.GetInstance <ITransactionBusiness>();

                ResultDTO resultdto = objITransactionBusiness.AuthenticateUser(txtusername.Text.Trim(), txtpassword.Text.Trim());

                if (resultdto.IsSuccess)
                {
                    this.Hide();
                    MDIParent MdiParent = new MDIParent(txtusername.Text.Trim(), resultdto.PHCID);
                    MdiParent.Show();
                }
                else
                {
                    pnlstatus.BackColor = System.Drawing.Color.Red;
                    lblstatus.Text      = resultdto.Message;
                }
            }
            else
            {
                pnlstatus.BackColor = System.Drawing.Color.Orange;
                lblstatus.Text      = result.Message;
            }
        }