示例#1
0
        public List <BE.Record> ListarDistritos(int departamento, int provincia)
        {
            List <BE.Record> lst = new List <BE.Record>();

            try
            {
                var daUbigeo = new DA.Ubigeo();

                DataTable dt = daUbigeo.ListarDistritos(new BE.Ubigeo()
                {
                    Departamento = departamento, Provincia = provincia
                });

                foreach (DataRow dr in dt.Rows)
                {
                    var beRecord = new BE.Record()
                    {
                        Codigo = dr["Distrito"].ToString(),
                        Nombre = dr["Nombre"].ToString()
                    };

                    lst.Add(beRecord);
                }

                return(lst);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#2
0
        public BE.Sala Obtener(int idSala)
        {
            try
            {
                var beSala = new BE.Sala()
                {
                    IdSala = idSala
                };

                bool exists = new DA.Sala().Obtener(ref beSala);
                if (exists == true)
                {
                    var beUbigeo = new BE.Ubigeo()
                    {
                        Codigo = beSala.Ubigeo.Codigo
                    };
                    exists = new DA.Ubigeo().Obtener(ref beUbigeo);
                    if (exists == true)
                    {
                        beSala.Ubigeo = beUbigeo;
                    }
                }
                else
                {
                    beSala = null;
                }

                return(beSala);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#3
0
        public bool Obtener(ref BE.Ubigeo oBeTbUbigeo)
        {
            bool exists = false;

            try
            {
                if (oBeTbUbigeo.Codigo == null || oBeTbUbigeo.Codigo == "")
                {
                    exists = new DA.Ubigeo().ObtenerDetalle(ref oBeTbUbigeo);
                }
                else
                {
                    exists = new DA.Ubigeo().Obtener(ref oBeTbUbigeo);
                }

                return(exists);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }