예제 #1
0
        void repPoints_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            if (this.ucPoint.SelectedPoint != null || this.ucPoint.PointID > 0)
            {
                BusinessLogicLayer.IPoint busPoint = new BusinessLogicLayer.Point();
                Entities.Point            point    = (this.ucPoint.SelectedPoint != null) ? this.ucPoint.SelectedPoint : null;

                if (point == null)
                {
                    point = busPoint.GetPointForPointId(this.ucPoint.PointID);
                }

                if (point == null)
                {
                    this.ucPoint.SelectedPoint = null;
                    this.ucPoint.PointID       = -1;
                    this.repPoints.DataSource  = new DataTable();
                }
                else
                {
                    this.repPoints.DataSource = new DataTable();
                    repPoints.DataSource      = busPoint.GetFuzzyPointsToMerge(this.ucPoint.SelectedPoint.Description, float.Parse(this.pointDescriptionRadSlider.SelectedValue), String.Empty, 0, this.ucPoint.SelectedPoint.Address.AddressLine1,
                                                                               float.Parse(this.addressLine1RadSlider.SelectedValue), this.ucPoint.SelectedPoint.Address.PostTown, float.Parse(this.townRadSlider.SelectedValue),
                                                                               this.chkMatchOnPostCode.Checked ? this.ucPoint.SelectedPoint.Address.PostCode : String.Empty, 0);
                }
            }
            else
            {
                this.repPoints.DataSource = new DataTable();
            }
        }
예제 #2
0
 private void LoadData()
 {
     if (this.ucPoint.SelectedPoint != null)
     {
         BusinessLogicLayer.IPoint busPoint = new BusinessLogicLayer.Point();
         repPoints.DataSource = busPoint.GetFuzzyPointsToMerge(this.ucPoint.SelectedPoint.Description, float.Parse(this.pointDescriptionRadSlider.SelectedValue), String.Empty, 0, this.ucPoint.SelectedPoint.Address.AddressLine1,
                                                               float.Parse(this.addressLine1RadSlider.SelectedValue), this.ucPoint.SelectedPoint.Address.PostTown, float.Parse(this.townRadSlider.SelectedValue),
                                                               this.chkMatchOnPostCode.Checked ? this.ucPoint.SelectedPoint.Address.PostCode : String.Empty, 0);
     }
     else
     {
         this.repPoints.DataSource = null;
     }
 }