コード例 #1
0
        public void BoletaBL_Create()
        {
            var LisCliente          = ClienteBL.GetList(false);
            var ListUsuario         = UsuarioBL.GetList(false);
            var ListProyecto        = ProyectoBL.GetList(false);
            var ListDepartamento    = CatalogoBL.GetList(CatalogoEnum.Departamento, false);
            var ListTiempoInvertido = CatalogoBL.GetList(CatalogoEnum.TiempoInvertido, false);

            Boleta _Boleta = new Boleta()
            {
                Id                = 0,
                ClienteId         = LisCliente.First().Id,
                DepartamentoId    = ListDepartamento.First().Id,
                FechaEntrada      = DateTime.Now,
                FechaSalida       = DateTime.Now,
                NumeroBoleta      = "PRUEBA",
                ProyectoId        = ListProyecto.First().Id,
                TiempoEfectivo    = 0,
                TiempoInvertidoEn = ListTiempoInvertido.First().Id,
                UsuarioId         = ListUsuario.First().Id,
                EsActivo          = false,
                FechaRegistro     = DateTime.Now,
            };

            var Boleta = BoletaBL.Create(_Boleta);

            Assert.IsTrue(Boleta.Id > 0);
        }
コード例 #2
0
        public ActionResult Edit(int id)
        {
            Boleta Boleta = BoletaBL.GetById(id);

            if (Boleta != null)
            {
                var ListCliente = ClienteBL.GetList();
                ViewBag.ListCliente = Catalogo.GetSelectListFromCatalog(ListCliente.Select(x => new Catalogo()
                {
                    Id = x.Id, Nombre = x.Nombre
                }).ToList());

                var ListProyecto = ProyectoBL.GetList();
                ViewBag.ListProyecto = Catalogo.GetSelectListFromCatalog(ListProyecto.Select(x => new Catalogo()
                {
                    Id = x.Id, Nombre = x.Nombre
                }).ToList());

                var ListTiempoInvertido = CatalogoBL.GetList(CatalogoEnum.TiempoInvertido);
                ViewBag.ListTiempoInvertido = Catalogo.GetSelectListFromCatalog(ListTiempoInvertido);

                var ListDepartamento = CatalogoBL.GetList(CatalogoEnum.Departamento);
                ViewBag.Departamento = Catalogo.GetSelectListFromCatalog(ListDepartamento);

                return(View(Boleta));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
コード例 #3
0
        public string[] AgregarBoleta(string nroBoleta, string codProducto, string cantidad, string codCliente, string CodVendedor)
        {
            Boleta boleta = new Boleta();

            boleta.NroBoleta   = nroBoleta;
            boleta.CodProducto = codProducto;
            boleta.Cantidad    = cantidad;
            boleta.CodCliente  = codCliente;
            boleta.CodVendedor = CodVendedor;
            BoletaBL boletaBL = new BoletaBL();

            string[] respuesta = new string[2];
            bool     CodError  = boletaBL.AgregarBoleta(boleta);

            if (CodError == true)
            {
                respuesta[0] = "true";
            }
            else
            {
                respuesta[0] = "false";
            }
            respuesta[1] = boletaBL.Mensaje;
            return(respuesta);
        }
コード例 #4
0
        public void BoletaBL_GetById()
        {
            var ListBoleta = BoletaBL.GetList(false);

            var Boleta = BoletaBL.GetById(ListBoleta.First().Id, false);

            Assert.IsNotNull(Boleta);
        }
コード例 #5
0
        public DataSet ListarBoletaAnuladaCliente(string CodCLiente)
        {
            Boleta boleta = new Boleta();

            boleta.CodCliente = CodCLiente;
            BoletaBL boletaBL = new BoletaBL();

            return(boletaBL.ListarBoletaClienteAnulada(boleta));
        }
コード例 #6
0
        public void BoletaBL_Delete()
        {
            var ListBoleta = BoletaBL.GetList(false);

            var _Boleta = ListBoleta.First();

            bool Result = BoletaBL.Delete(_Boleta.Id);

            Assert.IsTrue(Result);
        }
コード例 #7
0
        public ActionResult Delete(int id)
        {
            bool IsDelete = BoletaBL.Delete(id);

            JsonResponse JsonResponse = new JsonResponse()
            {
                IsSuccess = IsDelete
            };

            return(Json(JsonResponse));
        }
コード例 #8
0
        public void BoletaBL_Update()
        {
            var ListBoleta = BoletaBL.GetList(false);

            var _Boleta = ListBoleta.First();

            _Boleta.NumeroBoleta = "PRUEBA MODIFICADA";

            bool Result = BoletaBL.Update(_Boleta);

            Assert.IsTrue(Result);
        }
コード例 #9
0
        public ActionResult Boletas(DateTime?del = null, DateTime?hasta = null)
        {
            IEnumerable <Boleta> ListBoleta = null;

            if (del.HasValue && hasta.HasValue)
            {
                ListBoleta = BoletaBL.GetReporteFechas(Converting.DateTimeToSqlString(del.Value), Converting.DateTimeToSqlString(hasta.Value, 1));
            }
            else
            {
                ListBoleta = BoletaBL.GetReporteFechas(Formatting.SqlStringDateFirstDayCurrentMonth(), Formatting.SqlStringDateLastDayCurrentMonth(1));
            }
            return(View(ListBoleta));
        }
コード例 #10
0
        public ActionResult Create(Boleta boleta)
        {
            boleta.FechaRegistro = DateTime.Now;
            boleta.EsActivo      = true;
            boleta.UsuarioId     = 1; // Usuario en sesion

            boleta = BoletaBL.Create(boleta);
            if (boleta.Id > 0)
            {
                return(RedirectToAction("Create", "Actividad", new { id = boleta.Id }));
            }
            else
            {
                ModelState.AddModelError(string.Empty, "Ocurrió un error al ingresar la boleta");
                return(View(boleta));
            }
        }
コード例 #11
0
        public string[] AgregarDetallesBoleta(string nroBoleta, string codProducto, string cantidad)
        {
            BoletaBL boletaBL = new BoletaBL();

            string[] respuesta = new string[2];
            bool     CodError  = boletaBL.AgregarDeBoleta(nroBoleta, codProducto, cantidad);

            if (CodError == true)
            {
                respuesta[0] = "true";
            }
            else
            {
                respuesta[0] = "false";
            }
            respuesta[1] = boletaBL.Mensaje;
            return(respuesta);
        }
コード例 #12
0
        public string[] Agregar(string codCliente, string codVendedor)
        {
            Boleta boleta = new Boleta();

            boleta.CodCliente  = codCliente;
            boleta.CodVendedor = codVendedor;
            BoletaBL boletaBL = new BoletaBL();

            string[] respuesta = new string[2];
            bool     CodError  = boletaBL.Agregar(boleta);

            if (CodError == true)
            {
                respuesta[0] = "true";
            }
            else
            {
                respuesta[0] = "false";
            }
            respuesta[1] = boletaBL.Mensaje;
            return(respuesta);
        }
コード例 #13
0
        public ActionResult Index()
        {
            var ListBoleta = BoletaBL.GetList(false);

            return(View(ListBoleta));
        }
コード例 #14
0
        public DataTable MisVentas(string usuario)
        {
            BoletaBL boletaBl = new BoletaBL();

            return(boletaBl.MisVentas(usuario));
        }
コード例 #15
0
        public void BoletaBL_GetList()
        {
            var ListBoleta = BoletaBL.GetList(false);

            Assert.IsNotNull(ListBoleta);
        }
コード例 #16
0
        public DataTable Buscar(string texto, string criterio)
        {
            BoletaBL boletaBl = new BoletaBL();

            return(boletaBl.Buscar(texto, criterio));
        }
コード例 #17
0
        public DataSet ConsultarVentaFecha(string usuario, string semana)
        {
            BoletaBL boletaBL = new BoletaBL();

            return(boletaBL.ConsultarVentaFecha(usuario, semana));
        }
コード例 #18
0
        public DataTable Listar()
        {
            BoletaBL boletaBl = new BoletaBL();

            return(boletaBl.Listar());
        }