コード例 #1
0
 public IEnumerable<DefectDetail> GetDefectDetailsByCommodityAndDefect(int commodityId, int defectId)
 {
     //DispositionDatabase dbDisposition = new DispositionDatabase();
     //return dbDisposition.GetDefectDetailsByCommodityAndDefect(commodityId, defectId);
     DispositionFactory factory = new DispositionFactory();
     return factory.GetDefectDetailsByCommodityAndDefect(commodityId, defectId);
 }
コード例 #2
0
ファイル: PartDatabase.cs プロジェクト: chriswong11/Integram
        public PartMasterModel GetPartMasterModel()
        {
            PartMasterDataContext dbParts = new PartMasterDataContext();
            //Part List
            var partList = (from p in dbParts.Parts orderby p.supplier ascending select p).ToList();


            //Part Filters
            var filterSupplierList = (from s in partList 
                                      group s by new { s.suppliercode, s.supplier } into grp 
                                      select new Supplier(grp.Key.suppliercode.Trim(), grp.Key.supplier.Trim())).OrderBy(c => c.Name).ToList();

            var filterTrimList = (from t in partList group t by new { t.trimcodeid, t.trim } into grp 
                                  select new Trim(int.Parse(grp.Key.trimcodeid.ToString()), grp.Key.trim.ToString().Trim())).OrderBy(c => c.Name).ToList();

            var filterSideList = (from s in partList group s by new { s.sidecodeid, s.side } into grp 
                                  select new Side(int.Parse(grp.Key.sidecodeid.ToString()), grp.Key.side.Trim().ToString().Trim())).OrderBy(c => c.Name).ToList();
           
            var filterBoundList = (from b in partList group b by new { b.boundcodeid, b.bound } into grp 
                                   select new Bound(int.Parse(grp.Key.boundcodeid.ToString()), grp.Key.bound.Trim().ToString().Trim())).OrderBy(c => c.Name).ToList();

            var filterColourList = (from c in partList group c by new { c.colourcodeid, c.colour } into grp 
                                    select new Colour(int.Parse(grp.Key.colourcodeid.ToString()), grp.Key.colour.Trim().ToString().Trim())).OrderBy(c => c.Name).ToList();

            var filterSeatRowList = (from r in partList group r by new { r.seatrowcodeid, r.seatrow } into grp 
                                     select new SeatRow(int.Parse(grp.Key.seatrowcodeid.ToString()), grp.Key.seatrow.Trim().ToString().Trim())).OrderBy(c => c.Name).ToList();

            var filterProgramList = (from p in partList group p by new { p.program } into grp 
                                     select new Program(grp.Key.program.Trim().ToString().Trim())).OrderBy(c => c.Name).ToList();

            DispositionFactory factory = new DispositionFactory();
            var dispositionOptions = factory.GetDispositionOptions();

            PartMasterModel model = new PartMasterModel
            {
                DispositionOptions = dispositionOptions,
                Parts = partList,
                Suppliers = filterSupplierList,
                Trims = filterTrimList,
                Sides = filterSideList,
                Bounds = filterBoundList,
                Colours = filterColourList,
                SeatRows = filterSeatRowList,
                Programs = filterProgramList,
            };

            return model;
        }
コード例 #3
0
 public IEnumerable<Defect> GetDefectsByCommodityId(int id)
 {
     DispositionFactory factory = new DispositionFactory();
     return factory.GetDefectsByCommodityId(id);
 }
コード例 #4
0
 public IEnumerable<DefectDetail> GetDefectDetailByCommodityAndDefect(int commodityId, int defectId)
 {
     DispositionFactory factory = new DispositionFactory();
     return factory.GetDefectDetailsByCommodityAndDefect(commodityId, defectId);
 }
コード例 #5
0
 public DispositionOptions GetDispositionOptions()
 {
     DispositionFactory factory = new DispositionFactory();
     return factory.GetDispositionOptions();
 }