/// <summary>
    /// populate
    /// </summary>
    public void Populate(
        WasteTransferSearchFilter filter,
        WasteTransfers.FacilityCountObject counts)
    {
        // check that any relases are selected
        //this.rbHazardousGroup.Items.Clear();

        if (!filter.WasteTypeFilter.NonHazardousWaste &&
            !filter.WasteTypeFilter.HazardousWasteCountry &&
            !filter.WasteTypeFilter.HazardousWasteTransboundary)
        {
            this.compareChartPanel.Visible   = false;
            this.litNoResult.Visible         = true;
            EnableDisable.Visible            = false;
            this.ucWasteTypeSelector.Visible = false;
            return;
        }

        // let flex chart be visible
        this.litNoResult.Visible       = false;
        this.NoDataReturned.Visible    = false; //flex (not asp)
        this.compareChartPanel.Visible = true;

        // update viewstate
        SearchFilter          = filter;
        ViewState[DATA_NONHW] = null;
        ViewState[DATA_HWIC]  = null;
        ViewState[DATA_HWOC]  = null;

        this.ucWasteTypeSelector.PopulateRadioButtonList(filter.WasteTypeFilter, counts);
    }
Пример #2
0
    /// <summary>
    /// update header
    /// </summary>
    private void updateHeader(WasteTransferSearchFilter filter, bool includeFacilityCount, string text)
    {
        Dictionary <string, string> header = SheetHeaderBuilder.GetWasteTransferSearchHeader(filter, includeFacilityCount);

        this.ucSheetSubHeader.PopulateHeader(header);
        this.ucSheetSubHeader.Text = text;
    }
    /// <summary>
    /// populate and sort
    /// </summary>
    private void PopulateList(WasteTransferSearchFilter filter, string sortColumn)
    {
        SortColumn = sortColumn;
        int startRowIndex = PageIndex;

        bool descending = sortDescending(sortColumn);

        this.lvFacilityResult.DataSource = QueryLayer.WasteTransfers.FacilityList(
            filter,
            sortColumn,
            descending,
            startRowIndex,
            getPageSize(),
            SelectedWasteType);

        this.lvFacilityResult.DataBind();

        if (ContentChanged != null)
        {
            ContentChanged.Invoke(null, EventArgs.Empty);
        }

        if (filter.Count == 0)
        {
            this.ucWasteTypeSelector.Visible = false;
        }

        HideTreatmentColumns();
    }
    private void showContent(string command)
    {
        hideSubControls();
        this.ucSheetLinks.HighLight(command);
        string txt = string.Empty;
        WasteTransferSearchFilter filter = this.WasteTransferSearchFilter;

        bool   conf  = ConfidentialityAffected;
        string alert = conf ? Resources.GetGlobal("Common", "ConfidentialityAlertLink") : string.Empty;

        if (command.Equals(Sheets.WasteReceiverDetails.Treaters.ToString()))
        {
            this.litHeadline.Text          = Resources.GetGlobal("WasteTransfers", "HazWasteTreater");
            this.ucSheetTitleIcon.ImageURL = null;
            txt = Resources.GetGlobal("WasteTransfers", "AllValuesAreYearlyTransfersOnlyHW");
            this.ucHazRecieverTreatment.Populate(filter, this.CountryCode);
            this.ucHazRecieverTreatment.Visible = true;
        }
        else if (command.Equals(Sheets.WasteReceiverDetails.Confidentiality.ToString()))
        {
            this.litHeadline.Text                     = Resources.GetGlobal("WasteTransfers", "HazWasteConfidentiality");
            this.ucSheetTitleIcon.ImageURL            = null;
            this.ucHazRecieverConfidentiality.Visible = true;
            this.ucHazRecieverConfidentiality.Populate(filter, conf, this.CountryCode);
        }
        else
        {
            this.litHeadline.Text          = String.Empty;
            this.ucSheetTitleIcon.ImageURL = null;
        }

        updateHeader(filter, txt);
        updateAlert(alert);
    }
    /// <summary>
    /// update header
    /// </summary>
    private void updateHeader(WasteTransferSearchFilter filter, string text)
    {
        Dictionary <string, string> header = SheetHeaderBuilder.GetWasteTransferHazRecieverHeader(filter, false, CountryCode);

        this.ucSheetSubHeader.PopulateHeader(header);
        this.ucSheetSubHeader.Text = text;
    }
Пример #6
0
        public double WasteTransfersTestA()
        {
            DateTime testStartTime;
            DateTime testEndTime;
            TimeSpan testDelta;

            WasteTransferSearchFilter filter = new WasteTransferSearchFilter();

            filter.AreaFilter             = new AreaFilter();
            filter.AreaFilter.AreaGroupID = 1;
            filter.AreaFilter.CountryID   = -1;
            filter.AreaFilter.RegionID    = -1;

            filter.MapFilter          = new MapFilter();
            filter.MapFilter.SqlWhere = "((((ReportingYear) = 2007) And ((((((((((((((((((((((((((((((((LOV_CountryID) = 15) Or ((LOV_CountryID) = 22)) Or ((LOV_CountryID) = 34)) Or ((LOV_CountryID) = 57)) Or ((LOV_CountryID) = 58)) Or ((LOV_CountryID) = 59)) Or ((LOV_CountryID) = 68)) Or ((LOV_CountryID) = 73)) Or ((LOV_CountryID) = 74)) Or ((LOV_CountryID) = 81)) Or ((LOV_CountryID) = 85)) Or ((LOV_CountryID) = 100)) Or ((LOV_CountryID) = 101)) Or ((LOV_CountryID) = 106)) Or ((LOV_CountryID) = 109)) Or ((LOV_CountryID) = 122)) Or ((LOV_CountryID) = 127)) Or ((LOV_CountryID) = 128)) Or ((LOV_CountryID) = 129)) Or ((LOV_CountryID) = 137)) Or ((LOV_CountryID) = 156)) Or ((LOV_CountryID) = 166)) Or ((LOV_CountryID) = 177)) Or ((LOV_CountryID) = 178)) Or ((LOV_CountryID) = 182)) Or ((LOV_CountryID) = 201)) Or ((LOV_CountryID) = 202)) Or ((LOV_CountryID) = 207)) Or ((LOV_CountryID) = 213)) Or ((LOV_CountryID) = 214)) Or ((LOV_CountryID) = 234))) And (((QuantityTotalNONHW IS NOT NULL) Or (QuantityTotalHWIC IS NOT NULL)) Or (QuantityTotalHWOC IS NOT NULL)))";

            filter.WasteTypeFilter = new WasteTypeFilter();
            filter.WasteTypeFilter.HazardousWasteCountry       = true;
            filter.WasteTypeFilter.HazardousWasteTransboundary = true;
            filter.WasteTypeFilter.NonHazardousWaste           = true;

            filter.YearFilter      = new YearFilter();
            filter.YearFilter.Year = 2007;

            testStartTime = DateTime.Now;
            IEnumerable <Summary.WasteTransfersRow> actual = WasteTransfers.GetWasteTransfers(filter);

            testEndTime = DateTime.Now;

            testDelta = testEndTime - testStartTime;

            return(testDelta.TotalSeconds);
        }
    /// <summary>
    /// Search, fill data into summery
    /// </summary>
    public void Populate(WasteTransferSearchFilter filter, string countryCode)
    {
        WasteTransferSearchFilter = filter;
        CountryCode             = countryCode;
        ConfidentialityAffected = WasteTransfers.IsHazardousWasteAffectedByConfidentiality(filter, CountryCode); //Only determine once and store in viewstate

        showContent(Sheets.WasteReceiverDetails.Treaters.ToString());
    }
    /// <summary>
    /// radio buttons selected
    /// </summary>
    protected void OnSelectedWasteTypeChanged(object sender, WasteTypeSelectedEventArgs e)
    {
        WasteTransferSearchFilter filter = ViewState[FILTER] as WasteTransferSearchFilter;

        if (filter != null)
        {
            updateGraph(filter, e.WasteType);
        }
    }
Пример #9
0
    private WasteTransfers.FacilityCountObject getFacilityCounts(WasteTransferSearchFilter filter)
    {
        if (FacilityCounts == null)
        {
            FacilityCounts = WasteTransfers.GetFacilityCounts(filter);
        }

        return(FacilityCounts);
    }
Пример #10
0
    /// <summary>
    /// populate
    /// </summary>
    private void populateList(WasteTransferSearchFilter filter)
    {
        // bind data to list
        this._lvCountryResult.Items.Clear();

        this._lvCountryResult.DataSource = QueryLayer.WasteTransfers.HazardousWasteRecieverList(filter);

        this._lvCountryResult.DataBind();
    }
    /// <summary>
    /// method to populate the listview
    /// </summary>
    public void Populate(WasteTransferSearchFilter filter)
    {
        SearchFilter = filter;
        List <WasteTransfers.ActivityTreeListRow> data = QueryLayer.WasteTransfers.GetSectors(filter).ToList();

        sortResult(data);
        ViewState[RESULT] = data;
        this.lvWasteTransferActivity.DataSource = data;
        this.lvWasteTransferActivity.DataBind();
    }
Пример #12
0
    /// <summary>
    /// Basic populate, order by facility as default
    /// </summary>
    public void Populate(WasteTransferSearchFilter filter)
    {
        Control prop = this.Parent;

        // assign current view states
        SearchFilter = filter;

        // fill listview
        populateList(filter);
    }
Пример #13
0
        // ----------------------------------------------------------------------------------
        // WasteTransfers
        // ----------------------------------------------------------------------------------
        #region WasteTransfers

        /// <summary>
        /// get waste transfers
        /// </summary>
        public static IEnumerable <Summary.WasteSummaryTreeListRow> GetWasteTransfers(IndustrialActivitySearchFilter filter)
        {
            // Result is the same as for wastetransfer, without the filtering on wastetype
            WasteTransferSearchFilter filterWaste = FilterConverter.ConvertToWasteTransferSearchFilter(filter);
            IEnumerable <Summary.WasteSummaryTreeListRow> wastes = WasteTransfers.GetWasteTransfers(filterWaste);

            filter.Count = filterWaste.Count;

            return(wastes);
        }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        if (InvokeSearch != null)
        {
            WasteTransferSearchFilter filter = PopulateFilter();

            // start the search
            InvokeSearch.Invoke(filter, e);
        }
    }
    /// <summary>
    /// Update flash graph
    /// </summary>
    /// <param name="filter"></param>
    /// <param name="value">Chart data</param>
    /// <param name="chartLabel">Passed to flash charts.</param>
    private void updateGraph(WasteTransferSearchFilter filter, WasteTypeFilter.Type wasteType)
    {
        List <WasteTransfers.AreaComparison> result = null;

        string chartLabel = String.Empty;

        if (wasteType.Equals(WasteTypeFilter.Type.NonHazardous)) // Non Hazardous waste
        {
            if (ViewState[DATA_NONHW] != null)
            {
                result = ViewState[DATA_NONHW] as List <WasteTransfers.AreaComparison>;
            }
            else
            {
                result = WasteTransfers.GetAreaComparison(filter, WasteTypeFilter.Type.NonHazardous);
                translateArea(filter.AreaFilter, result);
                ViewState[DATA_NONHW] = result;
            }
            chartLabel = Resources.GetGlobal("Common", "NoHazardouswaste");
        }
        else if (wasteType.Equals(WasteTypeFilter.Type.HazardousCountry)) // hazardous within country (Hazardous waste, domestic)
        {
            if (ViewState[DATA_HWIC] != null)
            {
                result = ViewState[DATA_HWIC] as List <WasteTransfers.AreaComparison>;
            }
            else
            {
                result = WasteTransfers.GetAreaComparison(filter, WasteTypeFilter.Type.HazardousCountry);
                translateArea(filter.AreaFilter, result);
                ViewState[DATA_HWIC] = result;
            }
            chartLabel = Resources.GetGlobal("Common", "HazardouswasteWithinCountry");
        }
        else if (wasteType.Equals(WasteTypeFilter.Type.HazardousTransboundary)) // Hazardous waste, transboundary
        {
            if (ViewState[DATA_HWOC] != null)
            {
                result = ViewState[DATA_HWOC] as List <WasteTransfers.AreaComparison>;
            }
            else
            {
                result = WasteTransfers.GetAreaComparison(filter, WasteTypeFilter.Type.HazardousTransboundary);
                translateArea(filter.AreaFilter, result);
                ViewState[DATA_HWOC] = result;
            }
            chartLabel = Resources.GetGlobal("Common", "HazardouswasteTransboundary");
        }

        //add flash
        AddFlashCharts(result, chartLabel);
    }
Пример #16
0
        /// <summary>
        /// returns a dictionary with sheet headers <key, value> for waste transfer search
        /// </summary>
        public static Dictionary <string, string> GetWasteTransfersSearchHeader(
            WasteTransferSearchFilter filter,
            bool confidentialityAffected)
        {
            Dictionary <string, string> header = makeHeader();

            addYear(header, filter.YearFilter);
            addArea(header, filter.AreaFilter);
            addWasteType(header, filter.WasteTypeFilter);
            addConfidentiality(header, confidentialityAffected);

            return(header);
        }
Пример #17
0
    private void doSearch(object sender, EventArgs e)
    {
        ((MasterSearchPage)this.Master).UpdateMode(true);
        ((MasterSearchPage)this.Master).ShowResultArea();

        WasteTransferSearchFilter filter = sender as WasteTransferSearchFilter;

        if (filter != null)
        {
            updateJavaScriptMap(filter);
            this.ucWasteTransfersSheet.Populate(filter);
        }
    }
Пример #18
0
    /// <summary>
    /// Populate the listview
    /// </summary>
    public void Populate(WasteTransferSearchFilter filter)
    {
        SearchFilter = filter;
        this.lvWasteTransferSummery.Items.Clear();

        // binding
        IEnumerable <Summary.WasteSummaryTreeListRow> data = QueryLayer.WasteTransfers.GetWasteTransfers(filter);

        this.lvWasteTransferSummery.DataSource = data;
        this.lvWasteTransferSummery.DataBind();

        ChartsUtils.ShowWastePieCharts(data, this.upWasteTransferPiePanel, this.UniqueID.ToString());
    }
Пример #19
0
        /// <summary>
        /// returns a dictionary with sheet headers <key, value> for waste transfer search
        /// </summary>
        public static Dictionary <string, string> GetWasteTransferSearchHeader(WasteTransferSearchFilter filter, bool includeFacilityCount)
        {
            Dictionary <string, string> header = new Dictionary <string, string>();

            addYear(header, filter.YearFilter);
            addArea(header, filter.AreaFilter);
            if (includeFacilityCount)
            {
                addCount(header, filter.Count);
            }

            return(header);
        }
    public WasteTransferSearchFilter PopulateFilter()
    {
        WasteTransferSearchFilter filter = new WasteTransferSearchFilter();

        filter.AreaFilter           = this.ucAreaSearchOption.PopulateFilter();
        filter.YearFilter           = this.ucYearSearchOption.PopulateFilter();
        filter.ActivityFilter       = this.ucAdvancedActivitySearchOption.PopulateFilter();
        filter.WasteTypeFilter      = this.ucWasteTypeSearchOption.PopulateFilter();
        filter.WasteTreatmentFilter = this.ucWasteTreatmenSearchOption.PopulateFilter();


        return(filter);
    }
Пример #21
0
    /// <summary>
    /// invoke pollutant search search for this row
    /// </summary>
    protected void onWasteSearchClick(object sender, CommandEventArgs e)
    {
        string code = e.CommandArgument.ToString();

        // create pollutant search filter
        WasteTransferSearchFilter filter = FilterConverter.ConvertToWasteTransferSearchFilter(SearchFilter);

        // create waste type filter according to command argument
        filter.WasteTypeFilter = LinkSearchBuilder.GetWasteTypeFilter(code);

        // go to waste search
        LinkSearchRedirecter.ToWasteTransfers(Response, filter);
    }
Пример #22
0
    /// <summary>
    /// Search, fill data into summery
    /// </summary>
    public void Populate(WasteTransferSearchFilter filter)
    {
        SearchFilter            = filter;
        ConfidentialityAffected = WasteTransfers.IsAffectedByConfidentiality(filter); //Only determine once and store in viewstate

        //default show summary
        showContent(Sheets.WasteTransfers.Summary.ToString());

        // remove these sheet links if Hazardous Transboundary waste is NOT selected by the user
        bool linkVisibility = filter.WasteTypeFilter.HazardousWasteTransboundary;

        this.ucSheetLinks.ToggleLink(Sheets.WasteTransfers.HazReceivers.ToString(), linkVisibility);
        this.ucSheetLinks.ToggleLink(Sheets.WasteTransfers.HazTransboundary.ToString(), linkVisibility);
    }
    /// <summary>
    /// Fill the table with data or provide no data.
    /// </summary>
    public void Populate(WasteTransferSearchFilter filter, string countryCode)
    {
        // assign current view states
        SearchFilter = filter;
        CountryCode  = countryCode;

        ViewState["pageindex"] = 0;

        // reversed order of commands compared to other pages
        this.datapager.SetPageProperties(0, getPageSize(), false);
        PopulateList(filter, "FacilityName", countryCode);
        setArrows("FacilityName", true);

        this.datapager.Visible = (filter.Count > getPageSize());
    }
Пример #24
0
        /// <summary>
        /// returns a dictionary with SUBsheet headers <key, value> for hazardous waste reciever details
        /// </summary>
        public static Dictionary <string, string> GetWasteTransferHazRecieverHeader(WasteTransferSearchFilter filter, bool includeFacilityCount, string countryCode)
        {
            Dictionary <string, string> header = new Dictionary <string, string>();

            addYear(header, filter.YearFilter);
            addArea(header, filter.AreaFilter);

            if (includeFacilityCount)
            {
                addCount(header, filter.Count);
            }
            // A header detail should be added here
            addWasteReceiver(header, countryCode);

            return(header);
        }
    /// <summary>
    /// Fill the table with data or provide no data.
    /// </summary>
    /// <param name="filter"></param>
    public void Populate(
        WasteTransferSearchFilter filter,
        WasteTransfers.FacilityCountObject counts)
    {
        // assign current view states
        SearchFilter = filter;
        PageIndex    = 0;

        SortColumn = "FacilityName";

        // add radio button items to list if empty
        this.ucWasteTypeSelector.PopulateRadioButtonList(filter.WasteTypeFilter, counts);

        this.datapager.SetPageProperties(0, getPageSize(), false);
        this.datapager.Visible = (filter.Count > getPageSize());
    }
    /// <summary>
    /// populate and sort
    /// </summary>
    private void sort(string sortColumn)
    {
        // when sorting according to column, jump to pageindex 0 (requirement)
        ViewState["pageindex"] = 0;

        ViewState["sortcolumn"] = sortColumn;

        this.datapager.SetPageProperties(0, getPageSize(), false);

        bool descending = ViewState[sortColumn] != null && (bool)ViewState[sortColumn];

        ViewState[sortColumn] = !descending;

        WasteTransferSearchFilter currentFilter = ViewState[FILTER] as WasteTransferSearchFilter;

        PopulateList(currentFilter, sortColumn, CountryCode);
    }
Пример #27
0
    public void Populate(WasteTransferSearchFilter filter)
    {
        SearchFilter = filter;

        List <WasteTransfers.TransboundaryHazardousWasteData> data = WasteTransfers.GetTransboundaryHazardousWasteData(filter, true).ToList();

        if (data.Count() != 0)
        {
            //add flex control
            string swfFile = EPRTR.Charts.ChartsUtils.WasteTransferBubbleChart;
            EPRTR.Charts.ChartsUtils.ChartClientScript(swfFile, data, this.wasteTransferTransboundHazardousPanel, this.UniqueID.ToString());
        }
        else
        {
            this.NoDataReturned.Visible = true;
        }
    }
Пример #28
0
    /// <summary>
    /// load completed, perserve scroll
    /// </summary>
    protected override void OnLoadComplete(EventArgs e)
    {
        base.OnLoadComplete(e);

        if (!IsPostBack)
        {
            //if filter is in request, search will be invoked from the start
            if (LinkSearchBuilder.HasWasteTransferSearchFilter(Request))
            {
                WasteTransferSearchFilter filter = this.ucSearchOptions.PopulateFilter();
                doSearch(filter, EventArgs.Empty);
            }
        }

        // When load completed, perserve scroll position
        ScriptManager.RegisterStartupScript(Page, typeof(string), this.UniqueID, "Sys.WebForms.PageRequestManager.getInstance().add_endRequest(SetScroll);", true);
    }
Пример #29
0
    /// <summary>
    /// Fill tables with data
    /// </summary>
    public void Populate(WasteTransferSearchFilter filter,
                         bool hasConfidentialInformation)
    {
        SearchFilter = filter;

        if (hasConfidentialInformation)
        {
            this.litConfidentialityExplanation1.Text = CMSTextCache.CMSText("Common", "ConfidentialityExplanationWT1");
            this.litConfidentialityExplanation2.Text = CMSTextCache.CMSText("Common", "ConfidentialityExplanationWT2");

            this.lvWasteConfidentialityFacilities.DataSource = WasteTransfers.GetCountConfidentialFacilities(filter);;
            this.lvWasteConfidentialityFacilities.DataBind();

            this.lvWasteConfidentialityReason.DataSource = WasteTransfers.GetWasteConfidentialReason(filter).OrderBy(w => w.WasteTypeCode, new WasteTypeComparer()).ThenBy(w => w.ReasonCode);
            this.lvWasteConfidentialityReason.DataBind();
        }

        divConfidentialityInformation.Visible   = hasConfidentialInformation;
        divNoConfidentialityInformation.Visible = !hasConfidentialInformation;
    }
    /// <summary>
    /// populate and sort
    /// </summary>
    private void PopulateList(WasteTransferSearchFilter filter, string sortColumn, string countryCode)
    {
        int startRowIndex = (int)ViewState["pageindex"];

        bool descending = ViewState[sortColumn] != null && (bool)ViewState[sortColumn];

        this._lvTreaterResult.DataSource = QueryLayer.WasteTransfers.HazardousWasteTreaterList(
            filter,
            sortColumn,
            descending,
            startRowIndex,
            getPageSize(),
            countryCode);

        this._lvTreaterResult.DataBind();

        // save current sort column (to be used in pageing)
        ViewState["sortcolumn"] = sortColumn;
        CountryCode             = countryCode;
    }