示例#1
0
    /// <summary>
    /// This is a dirty hack -
    /// done properly the interface from DB should be changed as to keep wastetransfers distinct
    /// compared to the method used field (waste transferid)
    /// </summary>
    private List <FACILITYDETAIL_WASTETRANSFER> methodPrep(IEnumerable <FACILITYDETAIL_WASTETRANSFER> data)
    {
        List <FACILITYDETAIL_WASTETRANSFER> fdptResult = new List <FACILITYDETAIL_WASTETRANSFER>();

        bool wasAdded = false;

        foreach (FACILITYDETAIL_WASTETRANSFER fdpt in data)
        {
            foreach (FACILITYDETAIL_WASTETRANSFER resultfdpt in fdptResult)
            {
                if (resultfdpt.WasteTransferID.Equals(fdpt.WasteTransferID))
                {
                    resultfdpt.MethodTypeCode    = MethodUsedFormat.AddMethodType(resultfdpt.MethodTypeCode, fdpt.MethodTypeCode);
                    resultfdpt.MethodDesignation = MethodUsedFormat.AddMethodDesignation(resultfdpt.MethodDesignation, fdpt.MethodDesignation);
                    wasAdded = true;
                }
            }
            if (!wasAdded)
            {
                fdptResult.Add(fdpt);
            }
            wasAdded = false;
        }
        return(fdptResult);
    }
    /// <summary>
    /// This method handles the conversion from multiple lines with method used to single pollutants with multiple rows of method used.
    /// </summary>
    /// <param name="data"></param>
    /// <returns></returns>
    private List <FACILITYDETAIL_POLLUTANTRELEASE> methodPrep(IEnumerable <FACILITYDETAIL_POLLUTANTRELEASE> data)
    {
        List <FACILITYDETAIL_POLLUTANTRELEASE> fdprResult = new List <FACILITYDETAIL_POLLUTANTRELEASE>();
        bool wasAdded = false;

        foreach (FACILITYDETAIL_POLLUTANTRELEASE fdpr in data)
        {
            foreach (FACILITYDETAIL_POLLUTANTRELEASE resultfdpr in fdprResult)
            {
                if (resultfdpr.PollutantCode.Equals(fdpr.PollutantCode))
                {
                    resultfdpr.MethodTypeCode    = MethodUsedFormat.AddMethodType(resultfdpr.MethodTypeCode, fdpr.MethodTypeCode);
                    resultfdpr.MethodDesignation = MethodUsedFormat.AddMethodDesignation(resultfdpr.MethodDesignation, fdpr.MethodDesignation);
                    wasAdded = true;
                }
            }
            if (!wasAdded)
            {
                fdprResult.Add(fdpr);
            }
            wasAdded = false;
        }
        return(fdprResult);
    }
    protected string GetMethodUsed(object obj)
    {
        FACILITYDETAIL_POLLUTANTRELEASE row = (FACILITYDETAIL_POLLUTANTRELEASE)obj;

        return(MethodUsedFormat.MethodFormat(row.MethodTypeCode, row.MethodDesignation, row.ConfidentialIndicator));
    }
示例#4
0
    protected string GetMethodUsed(object obj)
    {
        FACILITYDETAIL_WASTETRANSFER row = (FACILITYDETAIL_WASTETRANSFER)obj;

        return(MethodUsedFormat.MethodFormat(row.MethodTypeCode, row.MethodDesignation, row.ConfidentialIndicator));
    }