コード例 #1
0
        /// <summary>
        /// 根据盘点单编号得到结果行项信息
        /// </summary>
        /// <param name="IID">盘点单编号</param>
        /// <returns></returns>
        public DataTable GetConInventoryResultsByIID(string IID, ResultStatus Status)
        {
            int status  = (int)Status;
            var list    = _conInventoryResultRepository.GetResultsByStatus(IID, status);
            var results = from invR in list
                          join cons in _SMOSECDbContext.Consumableses on invR.CID equals cons.CID
                          join invs in _SMOSECDbContext.ConInventories on invR.IID equals invs.IID
                          select new ConInventoryResultOutputDto()
            {
                CID           = invR.CID,
                RESULT        = invR.RESULT,
                RESULTNAME    = "",
                Image         = cons.IMAGE,
                Name          = cons.NAME,
                Specification = cons.SPECIFICATION,
                Unit          = cons.UNIT,
                Total         = invR.TOTAL,
                RealAmount    = invR.REALAMOUNT
            };
            DataTable tempTable = LINQToDataTable.ToDataTable(results);

            foreach (DataRow row in tempTable.Rows)
            {
                row["RESULTNAME"] = Enum.GetName(typeof(ResultStatus), int.Parse(row["RESULT"].ToString()));
            }
            return(tempTable);
        }
コード例 #2
0
        /// <summary>
        /// 根据盘点单编号得到结果行项信息
        /// </summary>
        /// <param name="IID">盘点单编号</param>
        /// <returns></returns>
        public DataTable GetConInventoryResultsByIID(string IID, ResultStatus Status)
        {
            int status  = (int)Status;
            var list    = _conInventoryResultRepository.GetResultsByStatus(IID, status);
            var results = from invR in list
                          join cons in _SMOWMSDbContext.Consumableses on invR.CID equals cons.CID
                          join invs in _SMOWMSDbContext.ConInventories on invR.IID equals invs.IID
                          from WH in _SMOWMSDbContext.WareHouses
                          from WHSL in _SMOWMSDbContext.WHStorageLocations
                          from WHST in _SMOWMSDbContext.WHStorageTypes
                          where invR.WAREID == WH.WAREID &&
                          invR.STID == WHSL.STID && invR.SLID == WHSL.SLID &&
                          invR.WAREID == WHST.WAREID && invR.STID == WHST.STID &&
                          invR.WAREID == WH.WAREID
                          select new ConInventoryResultOutputDto()
            {
                CID        = invR.CID,
                WAREID     = invR.WAREID,
                WARENAME   = WH.NAME,
                STID       = invR.STID,
                STNAME     = WHST.NAME,
                SLID       = invR.SLID,
                SLNAME     = WHSL.NAME,
                RESULT     = invR.RESULT,
                RESULTNAME = "",
                Image      = cons.IMAGE,
                Name       = cons.NAME,
                Unit       = cons.UNIT,
                Total      = invR.TOTAL,
                RealAmount = invR.REALAMOUNT
            };
            DataTable tempTable = LINQToDataTable.ToDataTable(results);

            foreach (DataRow row in tempTable.Rows)
            {
                row["RESULTNAME"] = Enum.GetName(typeof(ResultStatus), int.Parse(row["RESULT"].ToString()));
            }
            return(tempTable);
        }