private void btnConfig_Click(object sender, EventArgs e)
        {
            try
            {
                string ip = txtIPAddress.Text;
                BLL.tb_gateway_config        c = new BLL.tb_gateway_config();
                List <BLL.tb_gateway_config> l = c.LoadConfig();

                //  c.tb_id = Convert.ToInt32(l[0]);
                c.tb_id     = 1;
                c.ipaddress = ip;
                c.port      = txtPort.Text;
                c.password  = txtPassword.Text;
                c.username  = txtUserName.Text;
                c.tsc1      = txtServerNumber.Text;
                c.tsc2      = txtServiceNumber2.Text;
                c.t15       = txtServiceNumber15.Text;
                c.UpdateConfig(c);
                MessageBox.Show("Updated");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            {
            }
        }
Пример #2
0
        private void frmAddUser_Load(object sender, EventArgs e)
        {
            BLL.tb_gateway_config        c = new BLL.tb_gateway_config();
            List <BLL.tb_gateway_config> l = c.LoadConfig();

            if (l.Count > 0)
            {
                ipaddress  = l[0].ipaddress;
                port       = l[0].port;
                username   = l[0].password;
                welcomemsg = l[0].welcomemsg;
                password   = l[0].password;
            }
        }
        private void frmConfigurations_Load(object sender, EventArgs e)
        {
            BLL.tb_gateway_config        c = new BLL.tb_gateway_config();
            List <BLL.tb_gateway_config> l = c.LoadConfig();

            if (l.Count > 0)
            {
                txtIPAddress.Text       = l[0].ipaddress;
                txtPort.Text            = l[0].port;
                txtPassword.Text        = l[0].password;
                txtUserName.Text        = l[0].username;
                txtServerNumber.Text    = l[0].tsc1;
                txtServiceNumber2.Text  = l[0].tsc2;
                txtServiceNumber15.Text = l[0].t15;
            }
        }