예제 #1
0
        public void List_Option(ListOption pAction)
        {
            fAction = pAction;

            switch (fAction)
            {
            case ListOption.active:

                if (chk_notactive.Checked == true)
                {
                    LoadData(CUser_exten.NotActive(new DAL()));
                }
                else
                {
                    LoadData(CUser_exten.Active(new DAL()));
                }

                break;

            case ListOption.notactive:

                if (chk_notactive.Checked == true)
                {
                    LoadData(CUser_exten.NotActive(new DAL()));
                }
                else
                {
                    LoadData(CUser_exten.Active(new DAL()));
                }

                break;

            case ListOption.Search:
                if (txt_user_name.Text != "")
                {
                    List <User> list = new List <User>
                    {
                        CUser_exten.SearchName(txt_user_name.Text, new DAL())
                    };
                    LoadData(list);
                }
                else
                {
                    LoadData(CUser_exten.Active(new DAL()));
                }
                break;

            default:
                LoadData(CUser_exten.Active(new DAL()));
                break;
            }
        }
예제 #2
0
        private void Btn_login_Click(object sender, EventArgs e)
        {
            if (errorcount < 5)
            {
                User obj = CUser_exten.SearchName(txt_user_name.Text.ToUpper(), new DAL());

                if (obj.User_name != "")
                {
                    if (obj.User_password == txt_user_password.Text)
                    {
                        Current.User               = obj.User_id;
                        Current.User_name          = obj.User_name;
                        txt_errorUserPassword.Text = "";
                        timer_warning.Stop();
                        Hide();

                        RaiseEvent_NeedToRefresh();
                    }
                    else
                    {
                        txt_user_password.Text     = "";
                        txt_errorUserPassword.Text = "Warning ! Check user password ";
                        txt_user_password.Focus();
                        errorcount++;
                    }
                }
                else
                {
                    txt_user_password.Text     = "";
                    txt_user_name.Text         = "";
                    txt_errorUserPassword.Text = "Warning ! Check user Name ";
                    txt_user_name.Focus();
                    errorcount++;
                }
            }
            else
            {
                txt_user_password.Text     = "";
                txt_user_name.Text         = "";
                txt_user_name.Enabled      = false;
                txt_user_password.Enabled  = false;
                btn_login.Enabled          = false;
                txt_errorUserPassword.Text = "Sorry ! You have tried 5 atempt error \r\n so it goes locked on ! contact admin... ";
            }
        }