您的位置:首页 > 娱乐 > 八卦 > 西安微网站制作_台湾服务器ip_手机网页链接制作_网站关键词排名外包

西安微网站制作_台湾服务器ip_手机网页链接制作_网站关键词排名外包

2024/12/21 19:56:44 来源:https://blog.csdn.net/weixin_42132177/article/details/142653621  浏览:    关键词:西安微网站制作_台湾服务器ip_手机网页链接制作_网站关键词排名外包
西安微网站制作_台湾服务器ip_手机网页链接制作_网站关键词排名外包

目录

1、 AccessoriesqueryController

1.1、 库存配件查询

1.2、 查询仓库

1.2.1、 //把数据库数据加到表格:跟默认然一行数据进行合并

1.3、 /// 查询

1.3.1、 配件编码查询

1.3.2、 配件名称查询

1.3.3、 配件类型查询

  1. AccessoriesqueryController 

using QXQPS.Vo;

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;

namespace QXQPS.Areas.InventoryManagment.Controllers

{

    public class AccessoriesqueryController : Controller

    {

        Models.QXQPEntities myModels = new Models.QXQPEntities();

        // GET: InventoryManagment/Accessoriesquery

    1. 库存配件查询

        public ActionResult query()//库存配件查询

        {

            return View();

        }

        public ActionResult SelectWarehouse()//

    1. 查询仓库

        {

            List<SelectVo> listWarehouse = (from tbWarehouse in myModels.SYS_Warehouse

                                            select new SelectVo

                                            {

                                                id = tbWarehouse.WarehouseID,

                                                text = tbWarehouse.WarehouseName.Trim()

                                            }).ToList();

      1.             //把数据库数据加到表格:跟默认然一行数据进行合并

            listWarehouse = Common.Tools.SetSelectJson(listWarehouse);//设置selectjson

            return Json(listWarehouse, JsonRequestBehavior.AllowGet);

        }

        /// <summary>

    1.         /// 查询

        /// </summary>

        /// <returns></returns>

        public ActionResult SelectQuery(BsgridPage bsgridPage, string FittingsCode, string FittingsName, string FittingsType, int WarehouseID)

        {

            var lingItem = (from tbQuery in myModels.SYS_Inventory   

                             join tbWarehouse in myModels.SYS_Warehouse on tbQuery.WarehouseID equals tbWarehouse.WarehouseID

                             select new QueryVo

                             {

                                 InventoryID = tbQuery.InventoryID,//库存ID

                                 WarehouseID = tbWarehouse.WarehouseID,//仓库ID

                                 WarehouseName = tbWarehouse.WarehouseName,//仓库名称

                                 FittingsTypeName = tbQuery.FittingsType.Trim() ,//所属类型

                                 FittingsCode = tbQuery.FittingsCode,//配件编码

                                 FittingsName = tbQuery.FittingsName,//配件名称

                                 VehicleType = tbQuery.VehicleType,//车型

                                 SystemUnit = tbQuery.SystemUnit,//单位

                                 InvenQuan = tbQuery.InvenQuan,//库存量

                                 NewIntake = tbQuery.NewIntake,//最新进价

                                 WholePrice = tbQuery.WholePrice,//批发价

                                 SalePrice = tbQuery.SalePrice,//销售价

                                 MinInventory = tbQuery.MinInventory,//最低库存

                                 Position = tbQuery.Position,//仓位

                             }).ToList();

            #region

            if (!string.IsNullOrEmpty(FittingsCode))

            {

                lingItem = lingItem.Where(m => m.FittingsCode.Contains(FittingsCode)).ToList();//

      1. 配件编码查询

            }

            if (!string.IsNullOrEmpty(FittingsName))

            {

                lingItem = lingItem.Where(m => m.FittingsName.Contains(FittingsName)).ToList();//

      1. 配件名称查询

            }

            if (!string.IsNullOrEmpty(FittingsType))

            {

                lingItem = lingItem.Where(m => m.FittingsTypeName.Contains(FittingsType)).ToList();//

      1. 配件类型查询

            }

            if (WarehouseID > 0)

            {

                lingItem = lingItem.Where(m => m.WarehouseID == WarehouseID).ToList();

            }

            #endregion

            int count = lingItem.Count();

            List<QueryVo> listQuery = lingItem.OrderByDescending(m => m.InventoryID).Skip(bsgridPage.GetStartIndex()).Take(bsgridPage.pageSize).ToList();

            Bsgrid<QueryVo> bsgrid = new Bsgrid<QueryVo>()

            {

                success = true,

                totalRows = count,

                curPage = bsgridPage.curPage,

                data = listQuery,

            };

            return Json(bsgrid, JsonRequestBehavior.AllowGet);

        }

        /// <summary>

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com