Example #1
0
        private void frmDangnhap_Load(object sender, EventArgs e)
        {
            this.Text = "Dang nhap CRM [phien ban " + phienban + "]";

            WebClient client = new WebClient();

            try
            {
                client.DownloadFile("ftp://10.131.0.19/CRM.txt", "c:\\CRM.txt");
            }
            catch { }

            try
            {
                StreamReader reader3 = new StreamReader("c:\\CRM.txt");
                str_update = reader3.ReadLine();
                reader3.Close();

                if (phienban != str_update)
                {
                    frmCapnhat capnhat = new frmCapnhat();
                    capnhat.ShowDialog();
                    this.Close();
                }
            }
            catch { }

            try
            {
                StreamReader reader1 = new StreamReader("database.txt");
                line = reader1.ReadLine();
                reader1.Close();
            }
            catch
            {
                MessageBox.Show("Không đọc được file database.txt");
                this.Close();
            }

            try
            {
                conn = new SqlConnection("user id=sa;" +
                                         "password=qaz@123;server=" + line + ";" +
                                         "Trusted_Connection=no;" +
                                         "database=CRM; " +
                                         "connection timeout=0;" +
                                         "Max Pool Size=30;" +
                                         "Pooling=True");
            }
            catch
            {
                MessageBox.Show("Không kết nối được máy chủ");
                this.Close();
            }

            mahoa = new Mahoa(key);
        }
Example #2
0
        private void frmUser_Load(object sender, EventArgs e)
        {
            //tao doi tuong de ma hoa
            mahoa = new Mahoa(key);
            //me = this;

            if (frmMain.cn == "4800")
            {
                cbbMaCN.Enabled = true;
            }
            else
            {
                cbbMaCN.Enabled = false;
            }

            layDS_CN();
            layDS_Phong();
            layDS_Chucvu();
            layDS_Nhom();
            layDanhsach();
        }
Example #3
0
 private void frmDoimatkhau_Load(object sender, EventArgs e)
 {
     mahoa = new Mahoa(key);
 }