Exemplo n.º 1
0
Arquivo: Form1.cs Projeto: sinri/MyCE6
        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;
            }
        }
Exemplo n.º 2
0
Arquivo: Form1.cs Projeto: sinri/MyCE6
        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, "登录");
            }
        }