Example #1
0
        private void btnConect_Click(object sender, EventArgs e)
        {
            string User = ConfigurationManager.AppSettings["User"].ToString();
            string Pass = ConfigurationManager.AppSettings["Pass"].ToString();

            string Connection = string.Format("{0}User ID={1};Password={2}", ConfigurationManager.ConnectionStrings["PMSConnectionString"].ConnectionString.ToString(), User, Pass);
            qlND = new clsQLNguoiDung(Connection);

            List<NguoiDung> listNguoiDung = qlND.GetListNguoiDung();
            if (listNguoiDung == null)
            {
                barStaticItemThongBao.Caption = "Network Connection Failure";
                txtConectID.Visible = true;
                txtConectPass.Visible = true;
                lblConectID.Visible = true;
                lblConectPass.Visible = true;
                btnConect.Visible = true;
            }
            else
            {
                barStaticItemThongBao.Caption = "Network Connection Successful";
                txtConectID.Visible = false;
                txtConectPass.Visible = false;
                lblConectID.Visible = false;
                lblConectPass.Visible = false;
                btnConect.Visible = false;

                Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
                AppSettingsSection appSet = config.AppSettings;
                appSet.Settings["User"].Value = txtConectID.Text.Trim();
                appSet.Settings["Pass"].Value = txtConectPass.Text.Trim();
                config.Save();
                //login();
            }
        }
Example #2
0
 public frmMainForm()
 {
     InitializeComponent();
     qlND = new clsQLNguoiDung();
 }
 public frmSystem_ListPatient_AddNew_v2()
 {
     InitializeComponent();
     qlND = new clsQLNguoiDung();
     ResizeForm();
 }
 public frm_AddPatient_ExerciseOptions()
 {
     InitializeComponent();
     qlND = new clsQLNguoiDung();
 }
Example #5
0
 public frmSystem_AddPatient()
 {
     InitializeComponent();
     qlND = new clsQLNguoiDung();
 }
 public frmSystem_ListPatient_History()
 {
     InitializeComponent();
     qlND = new clsQLNguoiDung();
 }
Example #7
0
        private void frmLogin_Load(object sender, EventArgs e)
        {
            qlND = new clsQLNguoiDung();
            try
            {
                //CauHinh
                //string strIP = ConfigurationManager.AppSettings["SERVER_IP"].ToString();

                List<NguoiDung> listNguoiDung = qlND.GetListNguoiDung();
                if (listNguoiDung == null)
                {
                    barStaticItemThongBao.Caption = "Network Connection Failure";
                    txtConectID.Visible = true;
                    txtConectPass.Visible = true;
                    lblConectID.Visible = true;
                    lblConectPass.Visible = true;
                    btnConect.Visible = true;
                }
                else
                {
                    barStaticItemThongBao.Caption = "Network Connection Successful";
                    txtConectID.Visible = false;
                    txtConectPass.Visible = false;
                    lblConectID.Visible = false;
                    lblConectPass.Visible = false;
                    btnConect.Visible = false;
                    //login();
                }
            }
            catch //(Exception ex)
            {
                barStaticItemThongBao.Caption = "Network Connection Failure";
                txtConectID.Visible = true;
                btnConect.Visible = true;
            }
        }