コード例 #1
0
        public JsonResult GetProductSelText(string Text)
        {
            var productSA      = new SA.detalleitemsSA();
            var listaProductos = productSA.GetProductosWithEquivalencias(new BE.detalleitems()
            {
                idEmpresa         = LoginInformation.Empresa.idEmpresa,
                idEstablecimiento = 3,
                descripcionItem   = Text
            });

            return(Json(listaProductos, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public JsonResult GetProductSelAlmacenText(string Text, int idalmacen)
        {
            var productSA      = new SA.detalleitemsSA();
            var listaProductos = productSA.GetProductosWithInventarioAlmacen(new BE.detalleitems()
            {
                idEmpresa         = LoginInformation.Empresa.idEmpresa,
                idEstablecimiento = 3,
                descripcionItem   = Text,
                idAlmacen         = idalmacen,
            });

            return(Json(listaProductos, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        public ActionResult Dashboardv1()
        {
            if (Session["username"] == null)
            {
                //return RedirectToAction("Login", "Account");
                return(View("~/Views/Account/Login.cshtml"));
            }
            else
            {
                ViewBag.username = Session["username"];

                SA.detalleitemsSA prodSA = new SA.detalleitemsSA();

                var Products = prodSA.GetProductosWithInventario(new BE.detalleitems
                {
                    idEmpresa         = LoginInformation.Empresa.idEmpresa,
                    idEstablecimiento = LoginInformation.Establecimiento.idCentroCosto,
                    descripcionItem   = ""
                });
                Product.GetDetalleitems = Products;

                return(View());
            }
        }
コード例 #4
0
        public JsonResult AjaxMethod(int pageIndex, string sortName, string sortDirection, String Text)
        {
            var productSA      = new SA.detalleitemsSA();
            var listaProductos = new List <BE.detalleitems>();

            if (pageIndex == 1)
            {
                LoginInformation.ListProducts = productSA.GetProductosWithEquivalencias(new BE.detalleitems()
                {
                    idEmpresa         = LoginInformation.Empresa.idEmpresa,
                    idEstablecimiento = 3,
                    descripcionItem   = Text
                });

                listaProductos = LoginInformation.ListProducts;
            }
            else if (pageIndex > 1)
            {
                listaProductos = LoginInformation.ListProducts;
            }


            //var listaProductos = productSA.GetProductosWithEquivalencias(new BE.detalleitems()
            //{
            //    idEmpresa = LoginInformation.Empresa.idEmpresa,
            //    idEstablecimiento = 3,
            //    descripcionItem = Text
            //});


            ProductModel model = new ProductModel();

            model.PageIndex   = pageIndex;
            model.PageSize    = 5;
            model.RecordCount = listaProductos.Count();
            int startIndex = (pageIndex - 1) * model.PageSize;

            //switch (sortName)
            //{
            //    case "CustomerID":
            //    case "":
            //        if (sortDirection == "ASC")
            //        {
            //            model.Customers = (from customer in entities.Customers
            //                               select customer)
            //                    .OrderBy(customer => customer.CustomerID)
            //                    .Skip(startIndex)
            //                    .Take(model.PageSize).ToList();
            //        }
            //        else
            //        {
            //            model.Customers = (from customer in entities.Customers
            //                               select customer)
            //                    .OrderByDescending(customer => customer.CustomerID)
            //                    .Skip(startIndex)
            //                    .Take(model.PageSize).ToList();
            //        }
            //        break;
            //    case "ContactName":
            //        if (sortDirection == "ASC")
            //        {
            //            model.Customers = (from customer in entities.Customers
            //                               select customer)
            //                    .OrderBy(customer => customer.ContactName)
            //                    .Skip(startIndex)
            //                    .Take(model.PageSize).ToList();
            //        }
            //        else
            //        {
            //            model.Customers = (from customer in entities.Customers
            //                               select customer)
            //                    .OrderByDescending(customer => customer.ContactName)
            //                    .Skip(startIndex)
            //                    .Take(model.PageSize).ToList();
            //        }
            //        break;
            //    case "City":
            //        if (sortDirection == "ASC")
            //        {
            //            model.Customers = (from customer in entities.Customers
            //                               select customer)
            //                    .OrderBy(customer => customer.City)
            //                    .Skip(startIndex)
            //                    .Take(model.PageSize).ToList();
            //        }
            //        else
            //        {
            //            model.Customers = (from customer in entities.Customers
            //                               select customer)
            //                    .OrderByDescending(customer => customer.City)
            //                    .Skip(startIndex)
            //                    .Take(model.PageSize).ToList();
            //        }
            //        break;
            //    case "Country":
            //        if (sortDirection == "ASC")
            //        {
            //            model.Customers = (from customer in entities.Customers
            //                               select customer)
            //                    .OrderBy(customer => customer.Country)
            //                    .Skip(startIndex)
            //                    .Take(model.PageSize).ToList();
            //        }
            //        else
            //         {
            model.Detalleitems = (from customer in listaProductos
                                  select customer)
                                 .OrderByDescending(customer => customer.descripcionItem)
                                 .Skip(startIndex)
                                 .Take(model.PageSize).ToList();
            //        }
            //        break;
            //}

            return(Json(model));
        }