Пример #1
0
        public static List <Dosificacion> GetCarritoListForSearch(string whereSql)
        {
            if (string.IsNullOrEmpty(whereSql))
            {
                whereSql = "1 = 1";
            }

            List <Dosificacion>      theList    = new List <Dosificacion>();
            Dosificacion             theUser    = null;
            DosificacionTableAdapter theAdapter = new DosificacionTableAdapter();

            try
            {
                DosificacioDS.DosificacionDataTable table = theAdapter.GetDosificacionForSearch(whereSql);

                if (table != null && table.Rows.Count > 0)
                {
                    foreach (DosificacioDS.DosificacionRow row in table.Rows)
                    {
                        theUser = FillCarritoRecord(row);
                        theList.Add(theUser);
                    }
                }
            }
            catch (Exception q)
            {
                log.Error("el error ocurrio mientras obtenia la lista del Carrito de la base de datos", q);
                //return null;
            }
            return(theList);
        }
Пример #2
0
        //public static Area GetArea()
        //{
        //    AreaTableAdapter localAdapter = new AreaTableAdapter();

        //    Area theUser = null;
        //    try
        //    {
        //        AreaDS.AreaDataTable table = localAdapter.GetArea();

        //        if (table != null && table.Rows.Count > 0)
        //        {
        //            AreaDS.AreaRow row = table[0];
        //            theUser = FillUserRecord(row);
        //        }
        //    }
        //    catch (Exception q)
        //    {
        //        log.Error("Un error ocurrio mientras obtenia el Area de la base de dato", q);
        //        return null;
        //    }
        //    return theUser;
        //}
        public static Dosificacion GetCarritoById(int dosificacionId)
        {
            DosificacionTableAdapter localAdapter = new DosificacionTableAdapter();

            if (dosificacionId <= 0)
            {
                return(null);
            }

            Dosificacion theUser = null;

            try
            {
                DosificacioDS.DosificacionDataTable table = localAdapter.GetDosificacionById(dosificacionId);

                if (table != null && table.Rows.Count > 0)
                {
                    DosificacioDS.DosificacionRow row = table[0];
                    theUser = FillCarritoRecord(row);
                }
            }
            catch (Exception q)
            {
                log.Error("Un error ocurrio mientras obtenia el Area de la base de dato", q);
                return(null);
            }
            return(theUser);
        }