コード例 #1
0
        public Core.LogicaNegocio.Entidades.Propuesta AgregarVersionPropuesta(Core.LogicaNegocio.Entidades.Propuesta propuesta)
        {
            Core.LogicaNegocio.Comandos.ComandoPropuesta.ModificarPropuesta ModificarP;

            ModificarP = Core.LogicaNegocio.Fabricas.FabricaComandosPropuesta.CrearComandoModificarPropuesta(propuesta);

            return(ModificarP.Ejecutar());
        }
コード例 #2
0
        /// <summary>
        /// Comando que se encarga de Crear el Comando Ingresar Propuesta
        /// </summary>
        /// <param name="propuesta">Entidad de tipo Propuesta</param>
        /// <returns></returns>

        public Core.LogicaNegocio.Entidades.Propuesta Agregar(Core.LogicaNegocio.Entidades.Propuesta propuesta, IList <string[]> equipo)
        {
            Core.LogicaNegocio.Comandos.ComandoPropuesta.Ingresar ingresar;

            ingresar = Core.LogicaNegocio.Fabricas.FabricaComandosPropuesta.CrearComandoIngresar(propuesta, equipo);

            return(ingresar.Ejecutar());
        }
コード例 #3
0
        public void CargarTabla()
        {
            try
            {
                _propuesta        = new Core.LogicaNegocio.Entidades.Propuesta();
                _propuesta.Titulo = _vista.ParametroTexto.Text;


                IList <Core.LogicaNegocio.Entidades.Propuesta>         listaPropuesta;
                Core.LogicaNegocio.Comandos.ComandoPropuesta.Consultar consultaPropuesta;
                consultaPropuesta = Core.LogicaNegocio.Fabricas.FabricaComandosPropuesta.CrearComandoConsultar(1, _propuesta.Titulo);
                listaPropuesta    = consultaPropuesta.Ejecutar();

                if (listaPropuesta.Count == 0)
                {
                    throw new ConsultarException("No existe la propuesta");
                }


                _propuesta = listaPropuesta.ElementAt(0);

                _vista.TituloPropuesta.Text = listaPropuesta.ElementAt(0).Titulo.ToString();
                _vista.MontoTotal.Text      = listaPropuesta.ElementAt(0).MontoTotal.ToString();



                Core.LogicaNegocio.Comandos.ComandoFactura.ConsultarxNomPro ComandoConsultarTabla;
                ComandoConsultarTabla = Core.LogicaNegocio.Fabricas.FabricaComandosFactura.CrearComandoConsultarxNomPro(_propuesta);
                IList <Core.LogicaNegocio.Entidades.Factura> listaFacturas = ComandoConsultarTabla.Ejecutar();

                if (listaFacturas.Count == 0)
                {
                    throw new ConsultarException("La propuesta no tiene facturas asociadas");
                }

                _vista.TablaFacturas.DataSource = listaFacturas;
                _vista.TablaFacturas.DataBind();

                _vista.MultiViewFacturas.Visible         = true;
                _vista.MultiViewFacturas.ActiveViewIndex = 0;
            }
            catch (WebException e)
            {
                _vista.Pintar("Error WEB consultando");
                _vista.MensajeVisible = true;
            }
            catch (ConsultarException e)
            {
                _vista.Pintar(e.Message);
                _vista.MensajeVisible = true;
            }
            catch (Exception e)
            {
                _vista.Pintar(e.Message);
                _vista.MensajeVisible = true;
            }
        }
コード例 #4
0
        public IList <Core.LogicaNegocio.Entidades.Gasto> ConsultarPorPropuesta(Core.LogicaNegocio.Entidades.Propuesta _propuesta)
        {
            Core.LogicaNegocio.Comandos.ComandoGasto.ConsultarGastoPorPropuesta _ConsultaPorPropuesta;

            _ConsultaPorPropuesta = Core.LogicaNegocio.Fabricas.FabricaComandoGasto.CrearComandoConsultarPorPropuesta(_propuesta);

            listaGasto = _ConsultaPorPropuesta.Ejecutar();

            return(listaGasto);
        }
コード例 #5
0
        /// <summary>
        /// Metodo Anterior de Consulta de Propuesta Usado Por Factura y Gasto
        /// </summary>
        /// <param name="estado">Estado Aprobada de La Version</param>
        /// <returns>Lista de Propeusta con version Aprobada</returns>
        public IList<Propuesta> ConsultarPropuesta(int estado)
        {
            try
            {
                SqlParameter EstadoP = new SqlParameter();

                EstadoP = new SqlParameter("@Estado", SqlDbType.Int);

                EstadoP.Value = estado;

                DbDataReader conexion = SqlHelper.ExecuteReader(_conexion.GetConnection(), "ConsultarPropuesta", EstadoP);
                int i = 0;

                while (conexion.Read())
                {

                    Propuesta _Propuesta = new Propuesta();
                    Propuesta _PropuestaEquipo = new Propuesta();
                    _Propuesta.Titulo = (string)conexion["Titulo"];
                    _Propuesta.Version = (string)conexion["NumeroVersion"].ToString();
                    _Propuesta.FechaFirma = (DateTime)conexion["FechaFirma"];
                    _Propuesta.FechaInicio = (DateTime)conexion["FechaInicio"];
                    _Propuesta.FechaFin = (DateTime)conexion["FechaFin"];
                    _Propuesta.MontoTotal = float.Parse(conexion["Monto"].ToString());
                    _Propuesta.Id = (int)conexion["IdPropuesta"];
                    _PropuestaEquipo = BuscarEmpleado(_Propuesta.Id);
                    _Propuesta.EquipoTrabajo = _PropuestaEquipo.EquipoTrabajo;

                    #region Busqueda del Receptor
                    int j = 0;
                    List<string> ListR = new List<string>();
                    ListR = BuscarReceptor(_Propuesta.Id);
                    for (j = 0; j < ListR.Count; j++)
                    {
                        _Propuesta.NombreReceptor = ListR.ElementAt(j);
                        j++;
                        _Propuesta.ApellidoReceptor = ListR.ElementAt(j);
                        j++;
                        _Propuesta.CargoReceptor = ListR.ElementAt(j);
                    }

                    #endregion
                    ListaPropuesta.Insert(i, _Propuesta);
                    i++;

                }

                return ListaPropuesta;

            }
            catch (SqlException e)
            {
                throw new ConsultarPropuestaBDException("Error En acceso a Base de Datos", e);
            }
        }
コード例 #6
0
        public void CargarTabla()
        {
            try
            {
                _propuesta = new Core.LogicaNegocio.Entidades.Propuesta();
                _propuesta.Titulo = _vista.ParametroTexto.Text;

                IList<Core.LogicaNegocio.Entidades.Propuesta> listaPropuesta;
                Core.LogicaNegocio.Comandos.ComandoPropuesta.Consultar consultaPropuesta;
                consultaPropuesta = Core.LogicaNegocio.Fabricas.FabricaComandosPropuesta.CrearComandoConsultar(1, _propuesta.Titulo);
                listaPropuesta = consultaPropuesta.Ejecutar();

                if (listaPropuesta.Count == 0)
                    throw new ConsultarException("No existe la propuesta");

                _propuesta = listaPropuesta.ElementAt(0);

                _vista.TituloPropuesta.Text = listaPropuesta.ElementAt(0).Titulo.ToString();
                _vista.MontoTotal.Text = listaPropuesta.ElementAt(0).MontoTotal.ToString();

                Core.LogicaNegocio.Comandos.ComandoFactura.ConsultarxNomPro ComandoConsultarTabla;
                ComandoConsultarTabla = Core.LogicaNegocio.Fabricas.FabricaComandosFactura.CrearComandoConsultarxNomPro(_propuesta);
                IList<Core.LogicaNegocio.Entidades.Factura> listaFacturas = ComandoConsultarTabla.Ejecutar();

                if (listaFacturas.Count == 0)
                    throw new ConsultarException("La propuesta no tiene facturas asociadas");

                _vista.TablaFacturas.DataSource = listaFacturas;
                _vista.TablaFacturas.DataBind();

                _vista.MultiViewFacturas.Visible = true;
                _vista.MultiViewFacturas.ActiveViewIndex = 0;

            }
            catch (WebException e)
            {
                _vista.Pintar("Error WEB consultando");
                _vista.MensajeVisible = true;
            }
            catch (ConsultarException e)
            {
                _vista.Pintar(e.Message);
                _vista.MensajeVisible = true;
            }
            catch (Exception e)
            {
                _vista.Pintar(e.Message);
                _vista.MensajeVisible = true;
            }
        }
コード例 #7
0
        /// <summary>
        /// Metodo que se encarga de Invocar al comando Ingresar para asi poder ingresar
        /// la entidad de tipo propuesta
        /// </summary>
        public void AgregarPropuesta()
        {
            Core.LogicaNegocio.Entidades.Propuesta propuesta = new Core.LogicaNegocio.Entidades.Propuesta();

            try
            {
                propuesta.Titulo = _vista.Titulo.Text;

                propuesta.Version = _vista.Version.Text;

                propuesta.FechaFirma = Convert.ToDateTime(_vista.FechaFirma.Text);

                propuesta.NombreReceptor = _vista.NombreReceptor.Text;

                propuesta.ApellidoReceptor = _vista.ApellidoReceptor.Text;

                propuesta.CargoReceptor = _vista.CargoReceptor.Text;

                propuesta.FechaInicio = Convert.ToDateTime(_vista.FechaInicio.Text);

                propuesta.FechaFin = Convert.ToDateTime(_vista.FechaFin.Text);

                propuesta.MontoTotal = float.Parse(_vista.MontoTotal.Text);



                propuesta.Rol1 = _vista.RolEquipo1.Text;


                propuesta.TotalHoras = int.Parse(_vista.TotalHoras.Text);

                // propuesta.Equipo = _vista.TrabajoEquipo.SelectedItem;

                //string[] nombre = propuesta.Equipo.Split(' ');

                lista2 = SeleccionEquipo(lista);

                propuesta = Agregar(propuesta, lista2);

                _vista.LabelExitoA.Text    = "La propuesta se agrego con exito";
                _vista.LabelExitoA.Visible = true;

                LimpiarRegistros();
            }
            catch (Exception e)
            {
                _vista.Mensaje(e.Message);
            }
        }
コード例 #8
0
        /// <summary>
        /// Metodo que se encarga de Invocar al comando Ingresar para asi poder ingresar 
        /// la entidad de tipo propuesta
        /// </summary>
        public void AgregarPropuesta()
        {
            Core.LogicaNegocio.Entidades.Propuesta propuesta = new Core.LogicaNegocio.Entidades.Propuesta();

            try
            {
                propuesta.Titulo = _vista.Titulo.Text;

                propuesta.Version = _vista.Version.Text;

                propuesta.FechaFirma = Convert.ToDateTime(_vista.FechaFirma.Text);

                propuesta.NombreReceptor = _vista.NombreReceptor.Text;

                propuesta.ApellidoReceptor = _vista.ApellidoReceptor.Text;

                propuesta.CargoReceptor = _vista.CargoReceptor.Text;

                propuesta.FechaInicio = Convert.ToDateTime(_vista.FechaInicio.Text);

                propuesta.FechaFin = Convert.ToDateTime(_vista.FechaFin.Text);

                propuesta.MontoTotal = float.Parse(_vista.MontoTotal.Text);

                propuesta.Rol1 = _vista.RolEquipo1.Text;

                propuesta.TotalHoras = int.Parse(_vista.TotalHoras.Text);

                // propuesta.Equipo = _vista.TrabajoEquipo.SelectedItem;

                //string[] nombre = propuesta.Equipo.Split(' ');

                lista2 = SeleccionEquipo(lista);

                propuesta = Agregar(propuesta, lista2);

                _vista.LabelExitoA.Text = "La propuesta se agrego con exito";
                _vista.LabelExitoA.Visible = true;

                LimpiarRegistros();
            }
            catch (Exception e)
            {
                _vista.Mensaje(e.Message);
            }
        }
コード例 #9
0
        public IList <Gasto> ConsultarGastoPorPropuesta(Core.LogicaNegocio.Entidades.Propuesta propuesta)
        {
            IList <Core.LogicaNegocio.Entidades.Gasto> gastos = new List <Core.LogicaNegocio.Entidades.Gasto>();

            try
            {
                SqlParameter[] parametro = new SqlParameter[1];

                parametro[0]       = new SqlParameter("@Titulo", SqlDbType.VarChar);
                parametro[0].Value = propuesta.Titulo;

                DbDataReader reader = SqlHelper.ExecuteReader(_conexion.GetConnection(), "ConsultarGastoPorPropuesta", parametro);

                while (reader.Read())
                {
                    Gasto _gasto = new Gasto();

                    _gasto.Codigo       = (int)reader["IdGasto"];
                    _gasto.Estado       = (string)reader["Estado"];
                    _gasto.Monto        = float.Parse(reader["Monto"].ToString());
                    _gasto.FechaGasto   = (DateTime)reader["Fecha"];
                    _gasto.FechaIngreso = (DateTime)reader["FechaIngreso"];
                    _gasto.Tipo         = (string)reader["Tipo"];
                    _gasto.Descripcion  = (string)reader["Descripcion"];

                    gastos.Add(_gasto);
                }
            }
            catch (SqlException e)
            {
                throw new ConsultarGastoBDExceptions
                          ("Error de Consulta en Base de DAtos", e);
            }

            catch (Exception e)
            {
                throw new ConsultarGastoBDExceptions
                          ("Error de Consulta en Base de DAtos", e);
            }


            return(gastos);
        }
コード例 #10
0
        public void Test2Anular()
        {
            Propuesta propuesta = new Propuesta();

            propuesta.Titulo = "Automatizacion de la Certificacion de Empleados";

            Core.LogicaNegocio.Comandos.ComandoFactura.ConsultarxNomPro ComandoConsulta;
            ComandoConsulta = Core.LogicaNegocio.Fabricas.FabricaComandosFactura.CrearComandoConsultarxNomPro(propuesta);
            IList<Factura> listaFactura = ComandoConsulta.Ejecutar();

            Core.LogicaNegocio.Comandos.ComandoFactura.Anular ComandoAnular;
            ComandoAnular = Core.LogicaNegocio.Fabricas.FabricaComandosFactura.CrearComandoAnular(listaFactura.ElementAt(listaFactura.Count - 1).Numero);
            ComandoAnular.Ejecutar();

            listaFactura = ComandoConsulta.Ejecutar();
            Assert.AreEqual(listaFactura.ElementAt(listaFactura.Count - 1).Estado, "Anulada");

            new DAOFacturaSQLServer().ModificarEstadoFactura(listaFactura.ElementAt(listaFactura.Count - 1).Numero, "Por Cobrar");
        }
コード例 #11
0
        public void AgregarVersion()
        {
            Core.LogicaNegocio.Entidades.Propuesta propuesta = new Core.LogicaNegocio.Entidades.Propuesta();

            propuesta.Version = _vista.TextBoxVP.Text;

            propuesta.FechaFirma = Convert.ToDateTime(_vista.TextBoxFFirmP.Text);

            propuesta.FechaInicio = Convert.ToDateTime(_vista.TextBoxFechaIP.Text);

            propuesta.FechaFin = Convert.ToDateTime(_vista.TextBoxFechaFiP.Text);

            propuesta.MontoTotal = float.Parse(_vista.TextBoxMontP.Text);

            propuesta.TotalHoras = int.Parse(_vista.TextBoxTotalHorasP.Text);

            propuesta = AgregarVersionPropuesta(propuesta);

            LimpiarRegistros();
        }
コード例 #12
0
        public void Test3Saldar()
        {
            Propuesta propuesta = new Propuesta();
            propuesta.Titulo = "Automatizacion de la Certificacion de Empleados";

            Core.LogicaNegocio.Comandos.ComandoFactura.ConsultarxNomPro ComandoConsulta;
            ComandoConsulta = Core.LogicaNegocio.Fabricas.FabricaComandosFactura.CrearComandoConsultarxNomPro(propuesta);
            IList<Factura> listaFactura = ComandoConsulta.Ejecutar();

            listaFactura.ElementAt(listaFactura.Count - 1).Estado = "Cobrada";

            Core.LogicaNegocio.Comandos.ComandoFactura.Saldar ComandoSaldar;
            ComandoSaldar = Core.LogicaNegocio.Fabricas.FabricaComandosFactura.CrearComandoSaldar
                (listaFactura.ElementAt(listaFactura.Count -1).Numero,listaFactura.ElementAt(listaFactura.Count-1).Estado);
            ComandoSaldar.Ejecutar();

            listaFactura = null;
            listaFactura = ComandoConsulta.Ejecutar();

            Assert.AreEqual(listaFactura.ElementAt(listaFactura.Count - 1).Estado, "Cobrada");
        }
コード例 #13
0
        public void CargarDatosPropuesta()
        {
            try
            {
                float MontoPagado;
                float MontoRestante;
                float PorcentajePagado = 0;
                float PorcentajeRestante;

                IList<Core.LogicaNegocio.Entidades.Propuesta> listaPropuesta;
                Core.LogicaNegocio.Comandos.ComandoPropuesta.Consultar consultaPropuesta;
                consultaPropuesta = Core.LogicaNegocio.Fabricas.FabricaComandosPropuesta.CrearComandoConsultar(1, _vista.NombrePropuesta.Text);
                listaPropuesta = consultaPropuesta.Ejecutar();

                if (listaPropuesta.Count == 0)
                    throw new ConsultarException("La propuesta solicitada no existe");

                _propuesta = listaPropuesta.ElementAt(0);

                _vista.LabelNombrePropuesta.Text = listaPropuesta.ElementAt(0).Titulo.ToString();
                _vista.MontoTotal.Text = listaPropuesta.ElementAt(0).MontoTotal.ToString();

                IList<Core.LogicaNegocio.Entidades.Factura> listaFacturasPropuesta;
                Core.LogicaNegocio.Comandos.ComandoFactura.ConsultarxNomPro consultaFacturas;
                consultaFacturas = Core.LogicaNegocio.Fabricas.FabricaComandosFactura.CrearComandoConsultarxNomPro(listaPropuesta.ElementAt(0));
                listaFacturasPropuesta = consultaFacturas.Ejecutar();

                foreach (Core.LogicaNegocio.Entidades.Factura Factura in listaFacturasPropuesta)
                {
                    if (Factura.Estado.Equals("Por Cobrar") || Factura.Estado.Equals("Cobrada"))
                        PorcentajePagado += Factura.Procentajepagado;
                }
                MontoPagado = (PorcentajePagado / 100) * listaPropuesta.ElementAt(0).MontoTotal;
                PorcentajeRestante = 100 - PorcentajePagado;
                MontoRestante = listaPropuesta.ElementAt(0).MontoTotal - MontoPagado;

                _vista.PorcentajePagado.Text = PorcentajePagado.ToString() + " %";
                _vista.PorcentajeRestante.Text = PorcentajeRestante.ToString();
                _vista.MontoPagado.Text = MontoPagado.ToString();
                _vista.MontoRestante.Text = MontoRestante.ToString();

                if (_vista.PorcentajePagado.Text == "100 %")
                    throw new ConsultarException("La factura esta 100% pagada");

            }
            catch (WebException e)
            {
                _vista.Pintar("Error WEB al ingresar la factura");
                _vista.MensajeVisible = true;
            }
            catch (ConsultarException e)
            {
                _vista.Pintar(e.Message);
                _vista.MensajeVisible = true;
            }
            catch (Exception e)
            {
                _vista.Pintar(e.Message);
                _vista.MensajeVisible = true;
            }
        }
コード例 #14
0
        /// <summary>
        /// Metodo que consulta las propuestas activas que tienen versiones en espera
        /// se trae la ultima version en espera
        /// </summary>
        /// <returns></returns>
        public IList<Propuesta> ConsultarPropuestaAModificar()
        {
            try
            {
                DbDataReader conexion = SqlHelper.ExecuteReader
                    (GetConnection(), "ConsultarPropuestasVersiones");

                int i = 0;

                while (conexion.Read())
                {

                    Propuesta _Propuesta = new Propuesta();
                    _Propuesta.Titulo = (string)conexion["Titulo"];
                    _Propuesta.Version = (string)conexion["NumeroVersion"].ToString();
                    _Propuesta.FechaFirma = (DateTime)conexion["FechaFirma"];
                    _Propuesta.FechaInicio = (DateTime)conexion["FechaInicio"];
                    _Propuesta.FechaFin = (DateTime)conexion["FechaFin"];
                    _Propuesta.MontoTotal = float.Parse(conexion["Monto"].ToString());
                    _Propuesta.Id = (int)conexion["IdPropuesta"];
                    _Propuesta.EquipoTrabajo = BuscarEmpleado(_Propuesta.Id);

                    #region Busqueda del Receptor

                    int j = 0;
                    List<string> ListR = new List<string>();

                    ListR = BuscarReceptor(_Propuesta.Id);

                    for (j = 0; j < ListR.Count; j++)
                    {
                        _Propuesta.NombreReceptor = ListR.ElementAt(j);
                        j++;
                        _Propuesta.ApellidoReceptor = ListR.ElementAt(j);
                        j++;
                        _Propuesta.CargoReceptor = ListR.ElementAt(j);
                    }

                    #endregion

                    ListaPropuesta.Insert(i, _Propuesta);
                    i++;

                }

                return ListaPropuesta;
            }
            catch (SqlException e)
            {
                throw new Exception(e.ToString());
            }
        }
コード例 #15
0
        public void CargarDatosPropuesta()
        {
            try
            {
                float MontoPagado;
                float MontoRestante;
                float PorcentajePagado = 0;
                float PorcentajeRestante;

                IList <Core.LogicaNegocio.Entidades.Propuesta>         listaPropuesta;
                Core.LogicaNegocio.Comandos.ComandoPropuesta.Consultar consultaPropuesta;
                consultaPropuesta = Core.LogicaNegocio.Fabricas.FabricaComandosPropuesta.CrearComandoConsultar(1, _vista.NombrePropuesta.Text);
                listaPropuesta    = consultaPropuesta.Ejecutar();

                if (listaPropuesta.Count == 0)
                {
                    throw new ConsultarException("La propuesta solicitada no existe");
                }

                _propuesta = listaPropuesta.ElementAt(0);

                _vista.LabelNombrePropuesta.Text = listaPropuesta.ElementAt(0).Titulo.ToString();
                _vista.MontoTotal.Text           = listaPropuesta.ElementAt(0).MontoTotal.ToString();

                IList <Core.LogicaNegocio.Entidades.Factura> listaFacturasPropuesta;
                Core.LogicaNegocio.Comandos.ComandoFactura.ConsultarxNomPro consultaFacturas;
                consultaFacturas       = Core.LogicaNegocio.Fabricas.FabricaComandosFactura.CrearComandoConsultarxNomPro(listaPropuesta.ElementAt(0));
                listaFacturasPropuesta = consultaFacturas.Ejecutar();

                foreach (Core.LogicaNegocio.Entidades.Factura Factura in listaFacturasPropuesta)
                {
                    if (Factura.Estado.Equals("Por Cobrar") || Factura.Estado.Equals("Cobrada"))
                    {
                        PorcentajePagado += Factura.Procentajepagado;
                    }
                }
                MontoPagado        = (PorcentajePagado / 100) * listaPropuesta.ElementAt(0).MontoTotal;
                PorcentajeRestante = 100 - PorcentajePagado;
                MontoRestante      = listaPropuesta.ElementAt(0).MontoTotal - MontoPagado;

                _vista.PorcentajePagado.Text   = PorcentajePagado.ToString() + " %";
                _vista.PorcentajeRestante.Text = PorcentajeRestante.ToString();
                _vista.MontoPagado.Text        = MontoPagado.ToString();
                _vista.MontoRestante.Text      = MontoRestante.ToString();

                if (_vista.PorcentajePagado.Text == "100 %")
                {
                    throw new ConsultarException("La factura esta 100% pagada");
                }
            }
            catch (WebException e)
            {
                _vista.Pintar("Error WEB al ingresar la factura");
                _vista.MensajeVisible = true;
            }
            catch (ConsultarException e)
            {
                _vista.Pintar(e.Message);
                _vista.MensajeVisible = true;
            }
            catch (Exception e)
            {
                _vista.Pintar(e.Message);
                _vista.MensajeVisible = true;
            }
        }
コード例 #16
0
        /// <summary>
        /// Metodo para el reporte de facturas por cobrar en un año especifico
        /// </summary>
        /// <param name="entidad">Entidad Factura</param>
        /// <returns>Objeto Factura</returns>
        /// 
        public IList<Core.LogicaNegocio.Entidades.Factura> ObtenerFacturasPorCobrar(Factura facturas)
        {
            IList<Core.LogicaNegocio.Entidades.Factura> factura =
                                                new List<Core.LogicaNegocio.Entidades.Factura>();
            try
            {

            SqlParameter[] parametro = new SqlParameter[1];

            parametro[0] = new SqlParameter("@yearFecha", SqlDbType.DateTime);

            parametro[0].Value = facturas.Fechapago;

            DbDataReader reader = SqlHelper.ExecuteReader(_conexion.GetConnection(), "FacturasPorCobrarAnuales", parametro);

            int i = 0;

            while (reader.Read())
            {

                Factura _factura = new Factura();

                Propuesta _propuesta = new Propuesta();

                _factura.Numero = (int)reader["IdFactura"];

                _factura.Titulo = (string)reader["Titulo"];

                _factura.Descripcion = (string)reader["Descripcion"];

                _factura.Fechaingreso = (DateTime)reader["FechaIngreso"];

                _factura.Estado = (string)reader["Nombre"];

                _factura.Fechapago = (DateTime)reader["Fecha"];

                _factura.Procentajepagado = float.Parse(reader["Porcentaje"].ToString());

                factura.Add(_factura);
            }
            }
            catch (ConsultarException e)
            {
                throw new ConsultarException("Error al consultar",e);
            }
            catch (Exception e)
            {
                throw new ConsultarException("error", e);
            }
            return factura;
        }
コード例 #17
0
 /// <summary> Conructor de la Clase 'ConsultarGasto' </summary>
 public ConsultarGastoPorPropuesta(Propuesta _propuesta)
 {
     propuesta = _propuesta;
 }
コード例 #18
0
 public static ModificarPropuesta CrearComandoModificarPropuesta(Propuesta entidad)
 {
     return new ModificarPropuesta(entidad);
 }
コード例 #19
0
        /// <summary>
        /// Metodo utilizado para generar una lista de facturas parametrizada por un rango de fechas
        /// y por el tipo de factura
        /// </summary>
        /// <param name="desde">Fecha Inicial(DateTime)</param>
        /// <param name="hasta">Fecha fin(DateTime)</param>
        /// <param name="cobradas">Si la factura es de tipo "cobrada" true;
        /// Si es de tipo "por cobrar" false</param>
        /// <returns>Una lista de facturas</returns>
        public IList<Factura> ConsultarFacturasPorEstado(DateTime desde, DateTime hasta, Boolean cobradas)
        {
            try
            {
                DbDataReader reader;

                SqlParameter[] arParms = new SqlParameter[2];

                arParms[0] = new SqlParameter("@Fecha1", SqlDbType.SmallDateTime);
                arParms[0].Value = desde;
                arParms[1] = new SqlParameter("@Fecha2", SqlDbType.SmallDateTime);
                arParms[1].Value = hasta;

                if (cobradas)
                    reader = SqlHelper.ExecuteReader(GetConnection(), "ConsultarFacturasCobradas", arParms);
                else
                    reader = SqlHelper.ExecuteReader(GetConnection(), "ConsultarFacturasPorCobrar", arParms);

                Factura factura;
                Propuesta propuesta;
                IList<Factura> listaFacturas = new List<Factura>();
                DateTime fecha;

                while (reader.Read())
                {
                    factura = new Factura();

                    factura.Numero = int.Parse(reader["IdFactura"].ToString());
                    factura.Titulo = reader["Titulo"].ToString();
                    factura.Descripcion = reader["Descripcion"].ToString();
                    factura.Procentajepagado = float.Parse(reader["Porcentaje"].ToString());
                    fecha = DateTime.Parse(reader["Fecha"].ToString());
                    factura.Fechapago = DateTime.Parse(fecha.ToShortTimeString());
                    fecha = DateTime.Parse(reader["FechaIngreso"].ToString());
                    factura.Fechaingreso = DateTime.Parse(reader["FechaIngreso"].ToString());
                    factura.Estado = reader["Estado"].ToString();
                    propuesta = new Propuesta();
                    propuesta.Titulo = reader["NombrePropuesta"].ToString();
                    propuesta.MontoTotal = float.Parse(reader["Monto"].ToString());
                    factura.Prop = propuesta;

                    listaFacturas.Add(factura);
                }
                return listaFacturas;
            }
            catch (SqlException e)
            {
                throw new Core.LogicaNegocio.Excepciones.Facturas.AccesoDatos.ConsultarFacturaADException("Error de SQL consultando las facturas por estado en la Base de Datos", e);
            }
            catch (Exception e)
            {
                throw new ConsultarFacturaADException("Error consultando las facturas por estado en la Base de Datos", e);
            }
        }
コード例 #20
0
        /// <summary>
        /// Metodo para Ingresar Propuesta a la base de datos
        /// </summary>
        /// <param name="propuesta">Entidad Propuesta</param>
        /// <returns></returns>
        public Propuesta IngresarPropuesta(Propuesta propuesta,IList<string[]> listaequipo)
        {
            try
              {
            SqlParameter[] arparmsP = new SqlParameter[2];

            SqlParameter[] ParamV = new SqlParameter[6];

            SqlParameter[] ParamR = new SqlParameter[3];

            SqlParameter[] Parametros = new SqlParameter[1];

            //Ingresar Propuesta

            DateTime fechaingreso = DateTime.Now;

            //Se definen los parametros

            arparmsP[0] = new SqlParameter("@Titulo", SqlDbType.VarChar);

            arparmsP[0].Value = propuesta.Titulo;

            arparmsP[1] = new SqlParameter("@MontoTotal", SqlDbType.Float);

            arparmsP[1].Value = propuesta.MontoTotal;

            int result = SqlHelper.ExecuteNonQuery(GetConnection(), "IngresarPropuesta", arparmsP);

            // Consulta IdPropuesta

            DbDataReader conexion = SqlHelper.ExecuteReader(GetConnection(), "ConsultarIdPropuesta");

            if (conexion.Read())
            {

                int IdPropuesta;

                IdPropuesta = (int)conexion["maximo"];

                //Insert Version

                ParamV[0] = new SqlParameter("@Version", SqlDbType.Int);

                ParamV[0].Value = propuesta.Version;

                ParamV[1] = new SqlParameter("@FechaFirma", SqlDbType.DateTime);

                ParamV[1].Value = propuesta.FechaFirma;

                ParamV[2] = new SqlParameter("@FechaIngreso", SqlDbType.DateTime);

                ParamV[2].Value = fechaingreso;

                ParamV[3] = new SqlParameter("@FechaInicio", SqlDbType.DateTime);

                ParamV[3].Value = propuesta.FechaInicio;

                ParamV[4] = new SqlParameter("@FechaFin", SqlDbType.DateTime);

                ParamV[4].Value = propuesta.FechaFin;

                ParamV[5] = new SqlParameter("@IdPropuesta", SqlDbType.DateTime);

                ParamV[5].Value = IdPropuesta;

                int result2 = SqlHelper.ExecuteNonQuery(GetConnection(), "IngresarVersion", ParamV);

            }
              else
                 throw new IngresarPropuestaBDException();

            //Consultar el Id del Cargo

            Parametros[0] = new SqlParameter("@Nombre", SqlDbType.VarChar);

            Parametros[0].Value = propuesta.CargoReceptor;

            DbDataReader conex2 = SqlHelper.ExecuteReader(GetConnection(), "ConsultarIdCargo",
                Parametros);

            if (conex2.Read())
            {
                int IdCargo;

                IdCargo = (int)conex2["IdCargo"];

                // Ingresar Receptor

                ParamR[0] = new SqlParameter("@NombreReceptor", SqlDbType.VarChar);

                ParamR[0].Value = propuesta.NombreReceptor;

                ParamR[1] = new SqlParameter("@ApellidoReceptor", SqlDbType.VarChar);

                ParamR[1].Value = propuesta.ApellidoReceptor;

                ParamR[2] = new SqlParameter("@IdCargo", SqlDbType.Int);

                ParamR[2].Value = IdCargo;

                int result3 = SqlHelper.ExecuteNonQuery(GetConnection(), "IngresarReceptor", ParamR);
            }

             else
               throw new IngresarPropuestaBDException();

            //Ingresar Equipo
            foreach (string[] nombre in listaequipo)
            {
                for (int i = 0; i < listaequipo.Count; i++)
                {
                    string Nombre = nombre.ElementAt(i);
                    string Apellido = nombre.ElementAt(i + 1);
                    SqlParameter[] Param = new SqlParameter[2];
                    Param[0] = new SqlParameter("@Nombre", SqlDbType.VarChar);

                    Param[0].Value = Nombre;

                    Param[1] = new SqlParameter("@Apellido", SqlDbType.VarChar);

                    Param[1].Value = Apellido;

                    DbDataReader conex3 = SqlHelper.ExecuteReader(GetConnection(),
                        "ConsultarIdEmpleado", Param);

                    if (conex3.Read())
                    {
                        int IdEmpleado;

                        IdEmpleado = (int)conex3["IdEmpleado"];

                        DbDataReader conex4 = SqlHelper.ExecuteReader(GetConnection(),
                            "ConsultarIdVersion");

                        if (conex4.Read())
                        {

                            int IdVersion;

                            IdVersion = (int)conex4["maximo"];

                            SqlParameter[] Param2 = new SqlParameter[4];

                            Param2[0] = new SqlParameter("@IdEmpleado", SqlDbType.Int);

                            Param2[0].Value = IdEmpleado;

                            Param2[1] = new SqlParameter("@IdVersion", SqlDbType.Int);

                            Param2[1].Value = IdVersion;

                            Param2[2] = new SqlParameter("@Rol", SqlDbType.VarChar);

                            Param2[2].Value = propuesta.Rol1;

                            Param2[3] = new SqlParameter("@HorasParticipadas", SqlDbType.Int);

                            Param2[3].Value = propuesta.TotalHoras;

                            int result3 = SqlHelper.ExecuteNonQuery(GetConnection(),
                                "IngresarEquipo", Param2);
                            i++;

                        }
                        else
                            throw new IngresarPropuestaBDException();

                    }
                    else
                        throw new IngresarPropuestaBDException();
                }
            }

               }

              catch (SqlException e)
              {
              throw new IngresarPropuestaBDException("Error Ingresando en la Base de datos",e);
              }
              catch (Exception e)
              {
              throw new IngresarPropuestaBDException("Error ingresando Propuesta", e);
              }
            return propuesta;
        }
コード例 #21
0
 public ConsultarGastoPorTipo(Propuesta propuesta)
 {
     _propuesta = propuesta;
 }
コード例 #22
0
 /// <summary>
 /// Método que fabrica el comando Ingresar de la entidad Propuesta
 /// </summary>
 /// <param name="entidad">Entidad propuesta con los datos de ingreso</param>
 /// <returns>Comando ingresar de la entidad propuesta</returns>
 public static Ingresar CrearComandoIngresar(Propuesta entidad,IList<string[]> equipo)
 {
     return new Ingresar(entidad,equipo);
 }
コード例 #23
0
 public ConsultarEnEspera(Propuesta entidad)
 {
     _propuesta = entidad;
 }
コード例 #24
0
        /// <summary>
        /// Metodo que se encarga de buscar Los empleados de una propuesta en específico
        /// </summary>
        /// <returns></returns>
        private Propuesta BuscarEmpleado(int IdPropuesta)
        {
            int horas = 0;
            List<Empleado> ListaEmpleado = new List<Empleado>();
            Propuesta _propuesta = new Propuesta();

            try
            {
                SqlParameter ParamIdPropuesta = new SqlParameter();
                ParamIdPropuesta = new SqlParameter("@IdPropuesta", SqlDbType.Int);
                ParamIdPropuesta.Value = IdPropuesta;

                DbDataReader conexionempleado =
                    SqlHelper.ExecuteReader
                    (_conexion.GetConnection(), "ConsultarEmpleadoVersion", ParamIdPropuesta);

                int j = 0;
                while (conexionempleado.Read())
                {
                    Empleado empleado = new Empleado();
                    empleado.Nombre = (string)conexionempleado["Nombre"];
                    horas = (int)conexionempleado["HorasParticipadas"];

                    ListaEmpleado.Insert(j, empleado);
                    j++;
                }

                _propuesta.EquipoTrabajo = ListaEmpleado;
                _propuesta.TotalHoras = horas;

                return _propuesta;

            }
            catch (SqlException e)
            {
                throw new ConsultarPropuestaBDException("Erron en Acceso a Bd", e);
            }
            catch (Exception e)
            {
                throw new ConsultarPropuestaBDException
                    ("Error En Consulta de Empleado En Propuesta", e);
            }
        }
コード例 #25
0
 public static ConsultarxNomPro CrearComandoConsultarxNomPro(Propuesta propuesta)
 {
     return new ConsultarxNomPro(propuesta);
 }
コード例 #26
0
        /// <summary>
        /// Metodo para consultar las propuestas
        /// </summary>
        /// <param name="propuesta"></param>
        /// <returns>Lista de Propuesta</returns>
        public IList<Propuesta> ConsultarPropuestaNueva(int Opcion, string parametro)
        {
            try
            {
                SqlParameter ParametroBusqueda = new SqlParameter();

                ParametroBusqueda = new SqlParameter("@Parametro", SqlDbType.VarChar);

                ParametroBusqueda.Value = parametro;
                DbDataReader conexion = null;

                if (Opcion == 1) // Nombre de la Propuesta
                {
                     conexion = SqlHelper.ExecuteReader
                        (GetConnection(), "CPNombre", ParametroBusqueda);
                }
                if (Opcion == 2) // Id de la Propuesta
                {
                     conexion = SqlHelper.ExecuteReader
                        (GetConnection(), "CpIdProp", ParametroBusqueda);
                }
                if (Opcion == 3)// Rif Cliente
                {
                     conexion = SqlHelper.ExecuteReader
                        (GetConnection(), "CPCliente", ParametroBusqueda);
                }
                if (Opcion == 4)// Id Cliente
                {
                     conexion = SqlHelper.ExecuteReader
                        (GetConnection(), "CpNomCli", ParametroBusqueda);
                }
                int i = 0;
                    while (conexion.Read())
                    {

                        Propuesta _Propuesta = new Propuesta();
                        _Propuesta.Titulo = (string)conexion["Titulo"];
                        _Propuesta.Version = (string)conexion["NumeroVersion"].ToString();
                        _Propuesta.FechaFirma = (DateTime)conexion["FechaFirma"];
                        _Propuesta.FechaInicio = (DateTime)conexion["FechaInicio"];
                        _Propuesta.FechaFin = (DateTime)conexion["FechaFin"];
                        _Propuesta.MontoTotal = float.Parse(conexion["Monto"].ToString());
                        _Propuesta.Id = (int)conexion["IdPropuesta"];
                        _Propuesta.EquipoTrabajo = BuscarEmpleado(_Propuesta.Id);

                        #region Busqueda del Receptor
                        int j = 0;
                        List<string> ListR = new List<string>();
                        ListR = BuscarReceptor(_Propuesta.Id);
                        for (j = 0; j < ListR.Count; j++)
                        {
                            _Propuesta.NombreReceptor = ListR.ElementAt(j);
                            j++;
                            _Propuesta.ApellidoReceptor = ListR.ElementAt(j);
                            j++;
                            _Propuesta.CargoReceptor = ListR.ElementAt(j);
                        }

                        #endregion
                        ListaPropuesta.Insert(i, _Propuesta);
                        i++;

                    }

                    return ListaPropuesta;

            }
            catch (SqlException e)
            {
                throw new ConsultarPropuestaBDException("Error En acceso a Base de Datos", e);
            }
        }
コード例 #27
0
    public string[] GetSuggestionsFacturaPropuesta(string prefixText, int count)
    {
        List<string> responses = new List<string>();

        Propuesta propuesta = new Propuesta();

        propuesta.Titulo = prefixText;

        Core.LogicaNegocio.Comandos.ComandoPropuesta.Consultar comando =
            FabricaComandosPropuesta.CrearComandoConsultar(1, propuesta.Titulo);

        IList<Propuesta> propuestas = comando.Ejecutar();

        foreach (Propuesta prop in propuestas)
        {
            responses.Add(prop.Titulo);
        }
        return responses.ToArray();
    }
コード例 #28
0
        /// <summary>
        /// Metodo para consultar las propuestas ordenadas por fecha de inicio
        /// </summary>
        /// <param name="propuesta"></param>
        /// <returns></returns>
        public IList<Propuesta> ConsultarPropuestaOrdenadoPorEmision()
        {
            DbDataReader conexion = SqlHelper.ExecuteReader(GetConnection(), "ConsultarPropuesta");
            int i = 0;

            while (conexion.Read())
            {

                Propuesta _Propuesta = new Propuesta();
                _Propuesta.Titulo = (string)conexion["Titulo"];
                _Propuesta.Version = (string)conexion["NumeroVersion"].ToString();
                _Propuesta.FechaFirma = (DateTime)conexion["FechaFirma"];
                _Propuesta.FechaInicio = (DateTime)conexion["FechaInicio"];
                _Propuesta.FechaFin = (DateTime)conexion["FechaFin"];
                _Propuesta.MontoTotal = float.Parse(conexion["Monto"].ToString());
                _Propuesta.Id = (int)conexion["IdPropuesta"];

                ListaPropuesta.Insert(i, _Propuesta);
                i++;

            }

            return ListaPropuesta;
        }
コード例 #29
0
        /// <summary>
        /// Metodo que recibe una propuesta y se encarga de buscar las facturas de esa
        /// propuesta por su nombre
        /// </summary>
        /// <param name="propuesta">Propuesta con el nombre </param>
        /// <returns>Lista con las facturas correspondientes a la propuesta</returns>
        public IList<Factura> ConsultarFacturasNomPro(Propuesta propuesta)
        {
            List<Factura> facturas = new List<Factura>();

            try
            {

                int i = 0;

                SqlParameter[] arParms = new SqlParameter[1];

                arParms[0] = new SqlParameter("@Titulo", SqlDbType.VarChar);

                arParms[0].Value = propuesta.Titulo;

                DbDataReader reader = SqlHelper.ExecuteReader(GetConnection(),
                                        "ConsultarFacturaNomPro", arParms);

                while (reader.Read())
                {
                    Factura factura = new Factura();

                    factura.Prop = new Propuesta();

                    factura.Numero = int.Parse(reader["IdFactura"].ToString());

                    factura.Titulo = reader["Titulo"].ToString();

                    factura.Descripcion = reader["Descripcion"].ToString();

                    factura.Procentajepagado = float.Parse(reader["Porcentaje"].ToString());

                    factura.Fechapago = DateTime.Parse(reader["Fecha"].ToString());

                    factura.Fechaingreso = DateTime.Parse(reader["FechaIngreso"].ToString());

                    factura.Estado = reader["EstadoFactura"].ToString();

                    factura.Prop.Titulo = reader["Titulopropuesta"].ToString();

                    factura.Prop.MontoTotal = float.Parse(reader["Monto"].ToString());

                    facturas.Add(factura);

                    //reader.NextResult();

                    i++;

                }

                //if (facturas.Count == 0)
                //    throw new ConsultarFacturaADException();

            }
            catch (SqlException e)
            {
                throw new Core.LogicaNegocio.Excepciones.Facturas.AccesoDatos.ConsultarFacturaADException("Error SQL consultando factura por el nombre de la propuesta en la Base de Datos", e);
            }
            catch (Exception e)
            {
                throw new ConsultarException("Error consultando la factura por el nombre de la propuesta en la Base de Datos", e);
            }

            return facturas;
        }
コード例 #30
0
        /// <summary>
        /// Metodo para modificar propuesta
        /// </summary>
        /// <param name="propuesta"></param>
        /// <returns></returns>
        /// 
        public Propuesta ModificarPropuesta(Propuesta PropuestaRecibida)
        {
            SqlParameter[] arparmsP = new SqlParameter[2];

            SqlParameter[] ParamV = new SqlParameter[6];

            DateTime fechaingreso = DateTime.Now;

            //Se definen los parametros
            arparmsP[0] = new SqlParameter("@Titulo", SqlDbType.VarChar);

            arparmsP[0].Value = PropuestaRecibida.Titulo;

            arparmsP[1] = new SqlParameter("@MontoTotal", SqlDbType.Float);

            arparmsP[1].Value = PropuestaRecibida.MontoTotal;

            int result = SqlHelper.ExecuteNonQuery(GetConnection(), "UpdatePropuesta", arparmsP);

            ParamV[0] = new SqlParameter("@Version", SqlDbType.Int);

            ParamV[0].Value = PropuestaRecibida.Version;

            ParamV[1] = new SqlParameter("@FechaFirma", SqlDbType.DateTime);

            ParamV[1].Value = PropuestaRecibida.FechaFirma;

            ParamV[2] = new SqlParameter("@FechaIngreso", SqlDbType.DateTime);

            ParamV[2].Value = fechaingreso;

            ParamV[3] = new SqlParameter("@FechaInicio", SqlDbType.DateTime);

            ParamV[3].Value = PropuestaRecibida.FechaInicio;

            ParamV[4] = new SqlParameter("@FechaFin", SqlDbType.DateTime);

            ParamV[4].Value = PropuestaRecibida.FechaFin;

            int result2 = SqlHelper.ExecuteNonQuery(GetConnection(), "ModificarPropuesta", ParamV);

            return PropuestaRecibida;
        }
コード例 #31
0
        /// <summary>
        /// Metodo que recibe una propuesta y se encarga de buscar las facturas de esa
        /// propuesta por su ID
        /// </summary>
        /// <param name="propuesta">Propuesta con el ID </param>
        /// <returns>Lista con las facturas correspondientes a la propuesta</returns>
        public IList<Factura> ConsultarFacturasIDPro(Propuesta propuesta)
        {
            IList<Propuesta> propuestas = ConsultarPropuesta();

            List<Factura> facturas = new List<Factura>();

            try
            {
                foreach (Propuesta propuestaAux in propuestas)
                {

                    if (propuesta.Id == propuestaAux.Id)
                    {
                        int i = 0;

                        SqlParameter[] arParms = new SqlParameter[1];

                        arParms[0] = new SqlParameter("@idpropuesta", SqlDbType.Int);

                        arParms[0].Value = propuesta.Id;

                        DbDataReader reader = SqlHelper.ExecuteReader(GetConnection(),
                                                "ConsultarFacturaIDPro", arParms);

                        while (reader.Read())
                        {
                            Factura factura = new Factura();

                            factura.Numero = (int)reader["IdFactura"];

                            factura.Titulo = (string)reader["Titulo"];

                            factura.Descripcion = (string)reader["Descripcion"];

                            factura.Procentajepagado = float.Parse(reader["Porcentaje"].ToString());

                            factura.Fechapago = (DateTime)reader["Fecha"];

                            factura.Fechaingreso = (DateTime)reader["FechaIngreso"];

                            factura.Estado = (string)reader["Estado"];

                            factura.Prop = propuesta;

                            facturas.Insert(i, factura);
                            i++;

                        }
                        //if (facturas.Count == 0)
                        //    throw new ConsultarFacturaADException();
                    }
                }
            }
            catch (SqlException e)
            {
                throw new Core.LogicaNegocio.Excepciones.Facturas.AccesoDatos.ConsultarFacturaADException("Error de SQL consultando la factura por el ID de la propuesta  en la Base de Datos", e);
            }
            catch (ConsultarFacturaADException e)
            {
                throw new ConsultarFacturaADException("No se pudo realizar la consulta, se recibio un parametro de busqueda vacio, en este caso, el ID la propuesta", e);
            }
            catch (Exception e)
            {
                throw new ConsultarFacturaADException("Error consultando la factura por el ID de la propuesta  en la Base de Datos", e);
            }

            return facturas;
        }
コード例 #32
0
        public void TestConsultarFacturasNomPro()
        {
            Propuesta propuesta = new Propuesta();
            propuesta.Titulo = "Automatizacion de la Certificacion de Empleados";

            Core.LogicaNegocio.Comandos.ComandoFactura.ConsultarxNomPro ComandoConsulta;
            ComandoConsulta = Core.LogicaNegocio.Fabricas.FabricaComandosFactura.CrearComandoConsultarxNomPro(propuesta);

            IList<Factura> facturas = ComandoConsulta.Ejecutar();
            Assert.AreNotEqual(facturas.ElementAt(0), new Factura());
        }
コード例 #33
0
        /// <summary>
        /// Metodo para el reporte de facturas emitidas en un rango de fechas
        /// </summary>
        /// <param name="entidad">fechas de entidad Factura</param>
        /// <returns>Objeto Factura</returns>
        public IList<Core.LogicaNegocio.Entidades.Factura> FacturasEmitidas(Factura entidad)
        {
            IList<Core.LogicaNegocio.Entidades.Factura> factura =
                                                new List<Core.LogicaNegocio.Entidades.Factura>();

            try
            {
                SqlParameter[] arParms = new SqlParameter[2];

                arParms[0] = new SqlParameter("@FechaIngreso1", SqlDbType.SmallDateTime);

                arParms[0].Value = entidad.Fechaingreso.ToShortDateString();

                arParms[1] = new SqlParameter("@FechaIngreso2", SqlDbType.SmallDateTime);

                arParms[1].Value = entidad.Fechapago.ToShortDateString();

                DbDataReader reader = SqlHelper.ExecuteReader(_conexion.GetConnection(),
                                        "FacturasEmitidas", arParms);

                while (reader.Read())
                {
                    Factura _factura = new Factura();

                    Propuesta _propuesta = new Propuesta();

                    _factura.Prop = new Propuesta();

                    _factura.Numero = (int)reader.GetValue(0);

                    _factura.Titulo = (string)reader.GetValue(1);

                    _factura.Descripcion = (string)reader.GetValue(2);

                    _factura.Fechaingreso = (DateTime)reader.GetValue(3);

                    _factura.Estado = (string)reader.GetValue(4);

                    _propuesta.Titulo = (string)reader.GetValue(5);

                    _factura.Prop.Titulo = _propuesta.Titulo;

                    factura.Add(_factura);
                }

                return factura;

            }

            catch (SqlException e)
            {
                throw new ReportesException("Error al consultar en la base de datos", e);
            }
            catch (Exception e)
            {
                throw new ReportesException("Error en consultar facturas emitidas", e);
            }

            return factura;
        }
コード例 #34
0
        public void AgregarVersion()
        {
            Core.LogicaNegocio.Entidades.Propuesta propuesta = new Core.LogicaNegocio.Entidades.Propuesta();

            propuesta.Version = _vista.TextBoxVP.Text;

            propuesta.FechaFirma = Convert.ToDateTime(_vista.TextBoxFFirmP.Text);

            propuesta.FechaInicio = Convert.ToDateTime(_vista.TextBoxFechaIP.Text);

            propuesta.FechaFin = Convert.ToDateTime(_vista.TextBoxFechaFiP.Text);

            propuesta.MontoTotal = float.Parse(_vista.TextBoxMontP.Text);

            propuesta.TotalHoras = int.Parse(_vista.TextBoxTotalHorasP.Text);

            propuesta = AgregarVersionPropuesta(propuesta);

            LimpiarRegistros();
        }
コード例 #35
0
 public ConsultarPropuestasModificar(Propuesta entidad)
 {
     _propuesta = entidad;
 }
コード例 #36
0
 public static ConsultarGastoPorPropuesta CrearComandoConsultarPorPropuesta(Propuesta propuesta)
 {
     return new ConsultarGastoPorPropuesta(propuesta);
 }
コード例 #37
0
        /// <summary>
        /// Metodo para el reporte de facturas emitidas en un año especifico
        /// </summary>
        /// <param name="entidad">Entidad Factura</param>
        /// <returns>Objeto Factura</returns>
        /// 
        public IList<Core.LogicaNegocio.Entidades.Factura> ObtenerFacturasEmitidas(Factura factura)
        {
            IList<Core.LogicaNegocio.Entidades.Factura> facturas =
                                                new List<Core.LogicaNegocio.Entidades.Factura>();

            SqlParameter[] parametro = new SqlParameter[1];

            parametro[0] = new SqlParameter("@yearFecha", SqlDbType.DateTime);

            parametro[0].Value = factura.Fechapago;

            DbDataReader reader = SqlHelper.ExecuteReader(_conexion.GetConnection(), "FacturasEmitidasAnuales", parametro);

            int i = 0;

            while (reader.Read())
            {

                Factura _factura = new Factura();

                Propuesta _propuesta = new Propuesta();

                _factura.Numero = (int)reader["IdFactura"];

                _factura.Titulo = (string)reader["Titulo"];

                _factura.Descripcion = (string)reader["Descripcion"];

                _factura.Fechaingreso = (DateTime)reader["FechaIngreso"];

             //               _factura.Estado = (int)reader["Estado"];

                _factura.Fechapago = (DateTime)reader["Fecha"];

                _factura.Procentajepagado = float.Parse(reader["Porcentaje"].ToString());

                facturas.Add(_factura);
            }

            return facturas;
        }