Exemple #1
0
        public static List <object> AuthResult(Authenticates.CriteriaInfo criteriaInfo)
        {
            Authenticates authenticate = Authenticates.GetData(criteriaInfo);
            List <object> res          = new List <object>((IEnumerable <object>)authenticate);

            return(res);
        }
Exemple #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            Authenticates.CriteriaInfo authParams = new Authenticates.CriteriaInfo();
            string username = txt_uname.Text,
                   password = txt_pword.Text;

            if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password))
            {
                authParams.Username = username;
                authParams.Password = password;
                if (Account.AuthenticateUser(authParams))
                {
                    Authenticate  aut    = new Authenticate();
                    Object        resObj = new Object();
                    List <object> auth   = new List <object>();
                    auth = Account.AuthResult(authParams);
                    //((WritersWeb.Data.Authenticate)new System.Collections.Generic.Mscorlib_CollectionDebugView<object>(auth).Items[0]).Fullname
                    resObj = Account.AuthResult(authParams);

                    frmMain open = new frmMain();
                    open.ShowDialog();
                }
                else
                {
                    MessageBox.Show("Invalid user!!!");
                }
            }
            else
            {
                MessageBox.Show("Fields missing!!!");
            }
        }
Exemple #3
0
        public static bool AuthenticateUser(Authenticates.CriteriaInfo criteriaInfo)
        {
            Authenticates authenticate = Authenticates.GetData(criteriaInfo);

            if (authenticate.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #4
0
        public static int AuthenticateUser(Authenticates.CriteriaInfo criteriaInfo)
        {
            Authenticates authenticate = Authenticates.GetData(criteriaInfo);
            List <object> res          = new List <object>((IEnumerable <object>)authenticate);

            if (authenticate.Count > 0)
            {
                return(authenticate.Count);
            }
            else
            {
                return(0);
            }
        }
Exemple #5
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            Authenticates.CriteriaInfo authParams = new Authenticates.CriteriaInfo();
            string username = txt_uname.Text,
                   password = txt_pword.Text;

            if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password))
            {
                authParams.Username = username;
                authParams.Password = password;
                if (Account.AuthenticateUser(authParams) > 0)
                {
                    Object resObj = new Object();
                    resObj = Account.Result(authParams);

                    frmMain open = new frmMain();
                    open.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("Fields missing!!!");
            }
        }
Exemple #6
0
        public static Authenticates Result(Authenticates.CriteriaInfo criteriaInfo)
        {
            Authenticates authenticate = Authenticates.GetData(criteriaInfo);

            return(authenticate);
        }