DAL/WarehouseDAL.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using GoodsProject.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace GoodsProject.DAL
{
    public class WarehouseDAL
    {
        CommodityDBDataContext db = new CommodityDBDataContext();

        #region 获取入库信息
        public List<InWarehouse> GetInWarehouseList(string Brand, string Name, string BeginInDate, string EndInDate, int index, int pagesize, out int count)
        {
            var sql = from w in db.TB_InWarehouse.OrderByDescending(o => o.InDate)
                      join n in db.TB_Goods on w.GoodsID equals n.ID
                      join b in db.TB_Brand on n.BrandID equals b.ID
                      select new InWarehouse
                      {
                          ID = w.ID,
                          GoodsID = n.ID,
                          NowCount = w.NowCount,
                          InCount = w.InCount,
                          InUser = w.InUser,
                          InDate = w.InDate,
                          InRemarks = w.InRemarks,
                          Name = n.Name,
                          Image = n.Image,
                          BrandName = b.BrandName,
                          BrandID = n.BrandID,
                          Remarks = n.Remarks,
                          InPrice = w.InPrice,
                          InMoney = w.InMoney
                      };
            if (!string.IsNullOrEmpty(Brand))
            {
                Brand = Brand.Trim();
                sql = sql.Where(w => w.BrandID == Brand);
            }
            if (!string.IsNullOrEmpty(Name))
            {
                Name = Name.Trim();
                sql = sql.Where(w => w.Name.Contains(Name));
            }
            if (!string.IsNullOrEmpty(BeginInDate))
            {
                BeginInDate = BeginInDate.Trim();
                sql = sql.Where(w => w.InDate >= Convert.ToDateTime(BeginInDate));
            }
            if (!string.IsNullOrEmpty(EndInDate))
            {
                EndInDate = EndInDate.Trim() + " 23:59:59";
                sql = sql.Where(w => w.InDate <= Convert.ToDateTime(EndInDate));
            }
            var data = sql;
            count = data.Count();
            var result = data.Skip((index - 1) * pagesize).Take(pagesize).OrderByDescending(w => w.InDate).ToList();

            return result;
后面还有 56 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。