예제 #1
0
        public ReportingUnit GetReportingUnitByID(string reportingUnitID, string language)
        {
            if (string.IsNullOrEmpty(reportingUnitID))
            {
                throw new ArgumentException("El ID no puede ser <= 0.");
            }

            if (string.IsNullOrEmpty(language))
            {
                language = Artexacta.App.Utilities.LanguageUtilities.GetLanguageFromContext();
            }

            ReportingUnit theData = null;

            try
            {
                ReportingUnitDS.ReportingUnitsDataTable theTable = theAdapter.GetReportingUnitById(reportingUnitID, language);

                if (theTable != null && theTable.Rows.Count > 0)
                {
                    ReportingUnitDS.ReportingUnitsRow theRow = theTable[0];
                    theData = FillRecord(theRow);
                }
            }
            catch (Exception exc)
            {
                log.Error("Error en GetReportingUnitByID para reportingUnitID: " + reportingUnitID + " y language: " + language, exc);
                throw exc;
            }

            return(theData);
        }
예제 #2
0
        public List <ReportingUnit> GetReportingUnit(string language)
        {
            List <ReportingUnit> theList = new List <ReportingUnit>();
            ReportingUnit        theData = null;

            try
            {
                ReportingUnitDS.ReportingUnitsDataTable theTable = theAdapter.GetReportingUnits(language);

                if (theTable != null && theTable.Rows.Count > 0)
                {
                    foreach (ReportingUnitDS.ReportingUnitsRow theRow in theTable.Rows)
                    {
                        theData = FillRecord(theRow);
                        theList.Add(theData);
                    }
                }
            }
            catch (Exception exc)
            {
                log.Error("Ocurrió un error al obtener la lista de ReportingUnits de la Base de Datos", exc);
                throw exc;
            }

            return(theList);
        }