public void Road_Add(clsRoad NewRoad) { NewRoad.Num = this.RoadCount; this.Roads = (clsRoad[]) Utils.CopyArray((Array) this.Roads, new clsRoad[this.RoadCount + 1]); this.Roads[this.RoadCount] = NewRoad; this.RoadCount++; }
private void deleteRecord() { try { if (gridVietTatTenDuong.SelectedItems.Count > 0 && gridVietTatTenDuong.CurrentRow.RowIndex >= 0) { RoadEntity objRoad = (RoadEntity)(gridVietTatTenDuong.SelectedItems[0]).GetRow().DataRow; int Id = objRoad.ID; string dialog = new MessageBox.MessageBoxBA().Show("Bạn có muốn xóa không ?", "Thông báo", MessageBox.MessageBoxButtonsBA.YesNo, MessageBox.MessageBoxIconBA.Question); if (dialog == "Yes") { clsRoad objTenDuong = new clsRoad(); if (objTenDuong.Delete_TenVietTat(Id)) { LoadAllRoad("", 0); } else { new MessageBox.MessageBoxBA().Show("Xóa không thành công", "Thông báo", MessageBox.MessageBoxButtonsBA.OK, MessageBox.MessageBoxIconBA.Error); } } } } catch (Exception ex) { LogError.WriteLogError("deleteRecord: ", ex); } }
private void LoadAllRoad() { try { clsRoad clsRoads = new clsRoad(); List <clsPOIEntity> lstRoad = clsRoads.T_GetAllPOI_Type(Convert.ToInt16(cbType.SelectedValue)); //gridBaoCaoBieuMau1.DataSource = lstRoad; gridVietTatTenDuong.SetDataBinding(lstRoad, "ListRoad"); //GridEXFilterCondition Filter = new GridEXFilterCondition(gridVietTatTenDuong.RootTable.Columns["NameVN"], ConditionOperator.Equal, G_NameVN); //if (gridVietTatTenDuong.Find(Filter, -1, 1)) //{ // GridEXRow row = ((GridEXSelectedItem)gridVietTatTenDuong.SelectedItems[0]).GetRow(); // GridEXFormatStyle RowStyle = new GridEXFormatStyle(); // RowStyle.BackColor = System.Drawing.Color.DodgerBlue; // row.RowStyle = RowStyle; // //gridVietTatTenDuong.RootTable.ApplyFilter(ab); //} if (lstRoad != null && lstRoad.Count > 0) { MainMap.Overlays[0].Markers.Clear(); foreach (clsPOIEntity item in lstRoad) { MainMap.AddMarkerRedCircle(item.ViDo, item.KinhDo, item.NameVN); } } } catch (Exception) { } }
private void LoadType() { DataTable dt = new clsRoad().T_POI_Type(); cbType.DataSource = dt; cbType.DisplayMember = "Name"; cbType.ValueMember = "TypeId"; }
private void LoadAllRoad(string MaCungXN, int ProvinceID) { try { clsRoad clsRoads = new clsRoad(); List <RoadEntity> lstRoad = clsRoads.GetAllRoadbyMAXN_ProvinceID(MaCungXN, ProvinceID); #region Update All Kinh Do - Vi Do //gridBaoCaoBieuMau1.DataSource = lstRoad; //float viDo = 0; //float kinhDo = 0; //string toaDo = ""; //foreach (clsRoadEntity item in lstRoad) //{ // if (item.KinhDo > 0 && item.ViDo > 0) continue; // toaDo = GetGeobyAddressBA2(item.NameVN); // if (toaDo != "*" && toaDo != string.Empty) // { // string[] arrString = toaDo.Split(' '); // float.TryParse(arrString[0], NumberStyles.AllowDecimalPoint ,new CultureInfo("vi-VN", true), out viDo); // float.TryParse(arrString[1], NumberStyles.AllowDecimalPoint, new CultureInfo("vi-VN", true), out kinhDo); // } // new clsRoad().Update_TenVietTat(item.ID, item.VietTat, item.NameVN, item.NameEN, kinhDo, viDo); //} #endregion gridVietTatTenDuong.SetDataBinding(lstRoad, "ListRoad"); GridEXFilterCondition Filter = new GridEXFilterCondition(gridVietTatTenDuong.RootTable.Columns["NameVN"], ConditionOperator.Equal, G_NameVN); if (gridVietTatTenDuong.Find(Filter, -1, 1)) { GridEXRow row = ((GridEXSelectedItem)gridVietTatTenDuong.SelectedItems[0]).GetRow(); GridEXFormatStyle RowStyle = new GridEXFormatStyle(); RowStyle.BackColor = System.Drawing.Color.DodgerBlue; row.RowStyle = RowStyle; //gridVietTatTenDuong.RootTable.ApplyFilter(ab); } } catch (Exception ex) { LogError.WriteLogError(this.Name, ex); } }
private void LoadAllRoad(string MaCungXN, int ProvinceID) { try { clsRoad clsRoads = new clsRoad(); List <RoadEntity> lstRoad = clsRoads.GetAllRoadbyMAXN_ProvinceID(MaCungXN, ProvinceID); gridVietTatTenDuong.SetDataBinding(lstRoad, "ListRoad"); GridEXFilterCondition Filter = new GridEXFilterCondition(gridVietTatTenDuong.RootTable.Columns["NameVN"], ConditionOperator.Equal, G_NameVN); if (gridVietTatTenDuong.Find(Filter, -1, 1)) { GridEXRow row = (gridVietTatTenDuong.SelectedItems[0]).GetRow(); GridEXFormatStyle RowStyle = new GridEXFormatStyle(); RowStyle.BackColor = System.Drawing.Color.DodgerBlue; row.RowStyle = RowStyle; } } catch (Exception ex) { LogError.WriteLogError("LoadAllRoad: ", ex); } }