예제 #1
0
        public frmCn_adminWeb(string mac)
        {
            InitializeComponent();
            Waiting.ShowWaitForm();
            this.Text += " : " + mac;
            Class.CN_ADMIN cn = new Class.CN_ADMIN();
            if (!cn.isLogin())
            {
                cn.Connect(Class.CN_ADMIN.User, Class.CN_ADMIN.Passwors);
            }
            string        CustomerName = "";
            string        Address      = "";
            string        Ward         = "";
            string        modemID      = "";
            List <string> l            = new List <string>();

            if (cn.isLogin())
            {
                // thuc hien lay mac theo dinh dang
                mac = mac.Replace(".", "");
                mac = mac.Replace(".", "");
                // khoi thao mac theo dinh dang
                mac = mac.Insert(2, ":");
                mac = mac.Insert(5, ":");
                mac = mac.Insert(8, ":");
                mac = mac.Insert(11, ":");
                mac = mac.Insert(14, ":");

                // l = cn.Device_Search(mac, "2", out CustomerName, out Address, out Ward);
                cn.Device_Search(mac, "2", out CustomerName, out Address, out Ward, out modemID);
            }
            webBrowser.Navigate("http://101.99.28.133/cn-admin/lib/rrd_hf.php?modemID=" + modemID);
            Waiting.CloseWaitForm();
        }
예제 #2
0
        public frmCn_adminWeb(string mac)
        {
            InitializeComponent();
            Waiting.ShowWaitForm();
            this.Text +=" : " + mac;
            Class.CN_ADMIN cn = new Class.CN_ADMIN();
            if (!cn.isLogin())
            {
                cn.Connect(Class.CN_ADMIN.User, Class.CN_ADMIN.Passwors);
            }
            string CustomerName = "";
            string Address = "";
            string Ward = "";
            string modemID ="";
            List<string> l = new List<string>();
            if (cn.isLogin())
            {
                // thuc hien lay mac theo dinh dang
                mac = mac.Replace(".", "");
                mac = mac.Replace(".", "");
                // khoi thao mac theo dinh dang
                mac = mac.Insert(2, ":");
                mac = mac.Insert(5, ":");
                mac = mac.Insert(8, ":");
                mac = mac.Insert(11, ":");
                mac = mac.Insert(14, ":");

                // l = cn.Device_Search(mac, "2", out CustomerName, out Address, out Ward);
                cn.Device_Search(mac, "2", out CustomerName, out Address, out Ward, out modemID);

            }
            webBrowser.Navigate("http://101.99.28.133/cn-admin/lib/rrd_hf.php?modemID=" + modemID);
            Waiting.CloseWaitForm();
        }
예제 #3
0
        private void btnLoadAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (Waiting.IsSplashFormVisible)
            {
                return;
            }
            Waiting.ShowWaitForm();
            Waiting.SetWaitFormDescription("Đang kêt nôi đến hệ thống khách hàng.!");
            gridItem.Enabled = false;
            if (gridItemDetail.RowCount > 0)
            {
                Class.CN_ADMIN cn = new Class.CN_ADMIN();
                if (!cn.isLogin())
                {
                    cn.Connect(Class.CN_ADMIN.User, Class.CN_ADMIN.Passwors);
                }
                string mac = "";
                string CustomerName = "";
                string Address = "";
                string Ward = "";
                string District = "";
                List<string> l = new List<string>();

                Waiting.SetWaitFormDescription("Đang kêt kiểm tra đăng nhập.!");
                if (cn.isLogin())
                {
                    Waiting.SetWaitFormDescription("Đang Tải thông tin khách hàng.!");
                    for (int i = 0; i < gridItemDetail.RowCount; i++)
                    {
                        CustomerName = ""; Address = "";
                        if (gridItemDetail.GetRowCellDisplayText(i,colMacAdress).ToString().Length > 1)
                        {
                            // thuc hien lay mac theo dinh dang
                            mac = gridItemDetail.GetRowCellDisplayText(i, colMacAdress).ToString();
                            mac = mac.Replace(".", "");
                            mac = mac.Replace(".", "");
                            // khoi thao mac theo dinh dang
                            mac = mac.Insert(2, ":");
                            mac = mac.Insert(5, ":");
                            mac = mac.Insert(8, ":");
                            mac = mac.Insert(11, ":");
                            mac = mac.Insert(14, ":");

                            // l = cn.Device_Search(mac, "2", out CustomerName, out Address, out Ward);
                            cn.Device__Edit_View(mac, out CustomerName, out Address, out Ward, out District);
                            gridItemDetail.SetRowCellValue(i, colCustomerName, CustomerName);
                            gridItemDetail.SetRowCellValue(i, colCustomerAddress, Address);
                            gridItemDetail.SetRowCellValue(i, colWard, Ward);
                            gridItemDetail.SetRowCellValue(i, colDisTrict, District);
                            //dt.Rows[i]["CustomerName"] = CustomerName;
                            //dt.Rows[i]["CustomerAddress"] = Address;
                            //dt.Rows[i]["Ward"] = Ward;
                            //dt.Rows[i]["District"] = District;
                        }
                    }
                }

                Waiting.SetWaitFormDescription("Hoàn tất quá trình tải.!");
            }
            gridItem.Enabled = true;
            Waiting.CloseWaitForm();
        }
예제 #4
0
        private void btnLoadAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (Waiting.IsSplashFormVisible)
            {
                return;
            }
            Waiting.ShowWaitForm();
            Waiting.SetWaitFormDescription("Đang kêt nôi đến hệ thống khách hàng.!");
            gridItem.Enabled = false;
            if (gridItemDetail.RowCount > 0)
            {
                Class.CN_ADMIN cn = new Class.CN_ADMIN();
                if (!cn.isLogin())
                {
                    cn.Connect(Class.CN_ADMIN.User, Class.CN_ADMIN.Passwors);
                }
                string        mac          = "";
                string        CustomerName = "";
                string        Address      = "";
                string        Ward         = "";
                string        District     = "";
                List <string> l            = new List <string>();

                Waiting.SetWaitFormDescription("Đang kêt kiểm tra đăng nhập.!");
                if (cn.isLogin())
                {
                    Waiting.SetWaitFormDescription("Đang Tải thông tin khách hàng.!");
                    for (int i = 0; i < gridItemDetail.RowCount; i++)
                    {
                        CustomerName = ""; Address = "";
                        if (gridItemDetail.GetRowCellDisplayText(i, colMacAdress).ToString().Length > 1)
                        {
                            // thuc hien lay mac theo dinh dang
                            mac = gridItemDetail.GetRowCellDisplayText(i, colMacAdress).ToString();
                            mac = mac.Replace(".", "");
                            mac = mac.Replace(".", "");
                            // khoi thao mac theo dinh dang
                            mac = mac.Insert(2, ":");
                            mac = mac.Insert(5, ":");
                            mac = mac.Insert(8, ":");
                            mac = mac.Insert(11, ":");
                            mac = mac.Insert(14, ":");

                            // l = cn.Device_Search(mac, "2", out CustomerName, out Address, out Ward);
                            cn.Device__Edit_View(mac, out CustomerName, out Address, out Ward, out District);
                            gridItemDetail.SetRowCellValue(i, colCustomerName, CustomerName);
                            gridItemDetail.SetRowCellValue(i, colCustomerAddress, Address);
                            gridItemDetail.SetRowCellValue(i, colWard, Ward);
                            gridItemDetail.SetRowCellValue(i, colDisTrict, District);
                            //dt.Rows[i]["CustomerName"] = CustomerName;
                            //dt.Rows[i]["CustomerAddress"] = Address;
                            //dt.Rows[i]["Ward"] = Ward;
                            //dt.Rows[i]["District"] = District;
                        }
                    }
                }

                Waiting.SetWaitFormDescription("Hoàn tất quá trình tải.!");
            }
            gridItem.Enabled = true;
            Waiting.CloseWaitForm();
        }