public frmKhachDat(KhachDatBL KhachDat, AutoCompleteEntryCollection listDataAutoComplete, bool isUpdate) { InitializeComponent(); g_IsUpdate = isUpdate; g_objKhachDat = KhachDat.ParseToEntity(); g_ListDataAutoComplete = listDataAutoComplete; }
/// <summary> /// hàm thực hiện lấy dữ liệu autocomplete /// </summary> private void LoadDuLieuForAutoComplete() { if (g_ListDataAutoComplete == null) { g_ListDataAutoComplete = new AutoCompleteEntryCollection(); } string address = ""; string streetAbbr = ""; float kd = 0; float vd = 0; using (DataTable dt = new DiaDanh().GetRoadData_Autocomplete()) { if (dt != null && dt.Rows.Count > 0) { int i = 1; foreach (DataRow row in dt.Rows) { address = row["Street"].ToString(); streetAbbr = row["StreetAbbr"].ToString(); kd = float.Parse(row["KinhDo"].ToString()); vd = float.Parse(row["ViDo"].ToString()); g_ListDataAutoComplete.Add(new AutoCompleteEntry(address, kd, vd, streetAbbr)); i++; } } } }
/// <summary> /// Contructor for Addnew Record /// </summary> /// <param name="listDataAutoComplete">Dữ liệu danh sách địa chỉ</param> //public frmKhachDat(CuocGoi cuocGoi, AutoCompleteEntryCollection listDataAutoComplete) //{ // InitializeComponent(); // refreshForm(); // lblTGTiepNhan.Text = string.Format("{0:HH:mm dd/MM/yyyy}", cuocGoi.ThoiDiemGoi); // g_IDCuocGoi = cuocGoi.IDCuocGoi; // txtDiaChi.Text = cuocGoi.DiaChiDonKhach; // txtDienThoai.Text = cuocGoi.PhoneNumber; // txtDienThoai.Enabled = false;//không được sửa số điện thoại gọi đến // //txtKenh.Enabled = false; // //txtSoLuong.Enabled = false; // txtKenh.Text = cuocGoi.Vung.ToString(); // if (cuocGoi.SoLuongXe == 0) // txtSoLuong.Text = "1"; // else // txtSoLuong.Text = cuocGoi.SoLuongXe.ToString(); // if (cuocGoi.LoaiXe == "") // chkXeKI4.Checked = true; // else // SetThongTinLoaiXe(cuocGoi.LoaiXe); // g_ListDataAutoComplete = listDataAutoComplete; //} /// <summary> /// Contructor for Update Record /// </summary> /// <param name="ID">ID for Update</param> /// <param name="listDataAutoComplete">Dữ liệu danh sách địa chỉ</param> public frmKhachDat(KhachDatBL KhachDat, AutoCompleteEntryCollection listDataAutoComplete) { InitializeComponent(); g_IsUpdate = true; objKhachDat = KhachDat; setDataInput(); g_ListDataAutoComplete = listDataAutoComplete; }
public static void ResetData() { listDataAutoComplete = null; _DMVung_GPS = null; vungToaDo = null; dicCommandModule = null; dicCommand = null; }
public static AutoCompleteEntryCollection GetAutoCompleteItems(string formName, string controlName) { AutoCompleteEntryCollection items = new AutoCompleteEntryCollection(); try { if (xmlAutoComplete != null) { // Create an XmlNamespaceManager to resolve the default namespace. XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlAutoComplete.NameTable); nsmgr.AddNamespace("autocp", "urn:autocomplete-schema"); XmlElement root = xmlAutoComplete.DocumentElement; XmlNode forms = root.SelectSingleNode("/autocp:application/autocp:forms", nsmgr); if (forms != null && forms.ChildNodes.Count > 0) { XmlNodeList nodeList = forms[formName].ChildNodes; if (nodeList != null) { for (int i = 0; i < nodeList.Count; i++) { XmlNode control = nodeList[i]; if (control.Name == controlName) { foreach (XmlNode node in control.ChildNodes) { items.Add(new AutoCompleteEntry(node.InnerText.Trim(), node.InnerText.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries))); } } } } } } } catch { } return(items); }
private void frmThongKeOnGoi_Load(object sender, EventArgs e) { if (Memory.IsDesignMode) { return; } cbGiaoHo.SelectedValue = -1; gxGiaoDanList1.FormatGrid(); DataTable tblNoiTu = Memory.GetData("SELECT DISTINCT NoiTu FROM TanHien"); DataTable tblDongTu = Memory.GetData("SELECT DISTINCT DongTu FROM TanHien"); DataTable tblNoiPhucVu = Memory.GetData("SELECT DISTINCT NoiPhucVu FROM TanHien"); //Load auto complete for Noi Tu AutoCompleteEntryCollection Items = new AutoCompleteEntryCollection(); foreach (DataRow row in tblNoiTu.Rows) { Items.Add(new AutoCompleteEntry(row[TanHienConst.NoiTu].ToString(), row[TanHienConst.NoiTu].ToString().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries))); } txtNoiTu.TextBox.Items = Items; //Load auto complete for Dong Tu Items = new AutoCompleteEntryCollection(); foreach (DataRow row in tblDongTu.Rows) { Items.Add(new AutoCompleteEntry(row[TanHienConst.DongTu].ToString(), row[TanHienConst.DongTu].ToString().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries))); } txtDongTu.TextBox.Items = Items; //Load auto complete for Noi Phuc Vu Items = new AutoCompleteEntryCollection(); foreach (DataRow row in tblNoiPhucVu.Rows) { Items.Add(new AutoCompleteEntry(row[TanHienConst.NoiPhucVu].ToString(), row[TanHienConst.NoiPhucVu].ToString().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries))); } txtNoiPhucVu.TextBox.Items = Items; }
public frmKhachDat() { InitializeComponent(); g_ListDataAutoComplete = new AutoCompleteEntryCollection(); }
public frmChenMoiMotCuocDienThoai(string lineCapPhep, AutoCompleteEntryCollection listDataAutoComplete) { InitializeComponent(); g_LinesDuocCapPhep = lineCapPhep; g_ListDataAutoComplete = listDataAutoComplete; }