Exemple #1
0
        private void btn_logout_Click(object sender, EventArgs e)
        {
            Boolean outed = UserSessionAgent.logout();

            if (outed)
            {
                this.tb_username.Text    = "";
                this.tb_password.Text    = "";
                this.tb_username.Enabled = true;
                this.tb_password.Enabled = true;
                this.btn_login.Enabled   = true;
                this.cb_facility.Enabled = true;
                this.btn_logout.Enabled  = false;
            }
        }
Exemple #2
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            //MessageBox.Show(UserSessionAgent.machineCode(), "MAC");
            String info = "";

            API.APIRE_PhysicalWarehouse pw = (API.APIRE_PhysicalWarehouse) this.cb_facility.SelectedItem;

            Boolean done = UserSessionAgent.login(pw.physical_warehouse_id, this.tb_username.Text, this.tb_password.Text, out info);

            if (done)
            {
                this.tb_username.Enabled = false;
                this.tb_password.Enabled = false;
                this.btn_login.Enabled   = false;
                this.cb_facility.Enabled = false;
                this.btn_logout.Enabled  = true;
            }
            else
            {
                MessageBox.Show("人类真是虚无,登录不能啊。参考:" + info, "登录");
            }
        }