Beispiel #1
0
        public List <clsDetalleFactura> ConsultarDetalleFactura(int idFactura)
        {
            List <clsDetalleFactura> lstDetalleFacturas = new List <clsDetalleFactura>();
            DataTable dtRespuesta = null;
            clsPersistenciaFactura objPersistenciaFactura = new clsPersistenciaFactura();

            try
            {
                dtRespuesta = objPersistenciaFactura.ConsultarDetalleFactura("ServiciosBasicos", idFactura);
                if (dtRespuesta != null)
                {
                    foreach (DataRow dr in dtRespuesta.Rows)
                    {
                        clsDetalleFactura objDetalleFactura = new clsDetalleFactura();
                        objDetalleFactura.idDetalleFactura          = int.Parse(dr[0].ToString());
                        objDetalleFactura.idFactura                 = int.Parse(dr[1].ToString());
                        objDetalleFactura.descripcionDetalleFactura = dr[2].ToString();
                        objDetalleFactura.valorDetalleFactura       = double.Parse(dr[3].ToString());
                        lstDetalleFacturas.Add(objDetalleFactura);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(lstDetalleFacturas);
        }
Beispiel #2
0
        public List <clsFactura> ConsultarFactura()
        {
            List <clsFactura>      lstFacturas            = new List <clsFactura>();
            DataTable              dtRespuesta            = null;
            clsPersistenciaFactura objPersistenciaFactura = new clsPersistenciaFactura();

            try
            {
                dtRespuesta = objPersistenciaFactura.ConsultarFactura("ServiciosBasicos");
                if (dtRespuesta != null)
                {
                    foreach (DataRow dr in dtRespuesta.Rows)
                    {
                        clsFactura objFactura = new clsFactura();
                        objFactura.idFactura        = int.Parse(dr[0].ToString());
                        objFactura.numeroSuministro = dr[1].ToString();
                        objFactura.valorFactura     = double.Parse(dr[2].ToString());
                        DateTime fecha = DateTime.Parse(dr[3].ToString());
                        objFactura.fechaEmision = fecha.ToString("yyyy-MM-dd");
                        fecha = DateTime.Parse(dr[4].ToString());
                        objFactura.fechaVencimiento = fecha.ToString("yyyy-MM-dd");
                        objFactura.valorPendiente   = double.Parse(dr[5].ToString());
                        objFactura.valorPagado      = bool.Parse(dr[6].ToString());
                        lstFacturas.Add(objFactura);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(lstFacturas);
        }
Beispiel #3
0
        internal bool EliminarDetalleFactura(int idDetalleFactura)
        {
            clsPersistenciaFactura objPersistenciaFactura = new clsPersistenciaFactura();
            bool retorno = false;

            try
            {
                retorno = objPersistenciaFactura.EliminarFactura("ServiciosBasicos", idDetalleFactura);
            }
            catch (Exception)
            {
                throw;
            }
            return(retorno);
        }
Beispiel #4
0
        internal bool AgregarDetalleFactura(int idFactura, string strDescripcion, double valorDetalle)
        {
            clsPersistenciaFactura objPersistenciaFactura = new clsPersistenciaFactura();
            bool retorno = false;

            try
            {
                retorno = objPersistenciaFactura.AgregarDetalleFactura("ServiciosBasicos",
                                                                       idFactura, strDescripcion, valorDetalle);
            }
            catch (Exception)
            {
                throw;
            }
            return(retorno);
        }
Beispiel #5
0
        internal bool ModificarFactura(int idSuministro, int idFactura, double valorFactura,
                                       string strFechaEmision, string strFechaVencimiento, double dblValorPendiente,
                                       bool blValorPagado)
        {
            clsPersistenciaFactura objPersistenciaFactura = new clsPersistenciaFactura();
            bool retorno = false;

            try
            {
                retorno = objPersistenciaFactura.ModificarFactura("ServiciosBasicos", idFactura,
                                                                  idSuministro, valorFactura, strFechaEmision, strFechaVencimiento,
                                                                  dblValorPendiente, blValorPagado);
            }
            catch (Exception)
            {
                throw;
            }
            return(retorno);
        }