Exemple #1
0
        public List <SysArticleChallanColor> GetArticleColorListAfterSave(long ArticleChallanID)
        {
            using (var context = new BLC_DEVEntities())
            {
                var Data = (from d in context.Sys_ArticleChallanColor.AsEnumerable()
                            where d.ArticleChallanID == ArticleChallanID

                            join c in _context.Sys_Color on d.ArticleColor equals c.ColorID into Colors
                            from c in Colors.DefaultIfEmpty()

                            join u in _context.Sys_Unit on d.ColorAreaUnit equals u.UnitID into Units
                            from u in Units.DefaultIfEmpty()

                            orderby d.ArticleColorNo ascending
                            select new SysArticleChallanColor
                {
                    ArticleChallanIDColor = d.ArticleChallanIDColor,
                    ArticleColorNo = d.ArticleColorNo,
                    ArticleColor = d.ArticleColor,
                    ArticleColorName = (c == null ? null : c.ColorName),
                    ColorAreaUnit = d.ColorAreaUnit,
                    ColorAreaUnitName = (u == null ? "SFT" : u.UnitName),
                    ArticleColorArea = d.ArticleColorArea,
                    RemarkDate = d.RemarkDate == null ? null : Convert.ToDateTime(d.RemarkDate).ToString("dd'/'MM'/'yyyy"),
                    Remarks = d.Remarks,
                    QuantityDescription = d.QuantityDescription,
                }).ToList();

                return(Data);
            }
        }
Exemple #2
0
        public List <SysArticleChallanDetail> GetArticleDetailListAfterSave(long ArticleChallanID)
        {
            using (var context = new BLC_DEVEntities())
            {
                var Data = (from d in context.Sys_ArticleChallanDetail.AsEnumerable()
                            where d.ArticleChallanID == ArticleChallanID

                            join u in _context.Sys_Unit on d.SizeRangeUnit equals u.UnitID into Units
                            from u in Units.DefaultIfEmpty()

                            join tu in _context.Sys_Unit on d.ThicknessUnit equals tu.UnitID into ThicknessUnits
                            from tu in ThicknessUnits.DefaultIfEmpty()

                            select new SysArticleChallanDetail
                {
                    ArticleChallanDtlID = d.ArticleChallanDtlID,
                    SizeRange = d.SizeRange,
                    PcsSideDescription = d.PcsSideDescription,
                    GradeRange = d.GradeRange,
                    ThicknessRange = d.ThicknessRange,
                    ThicknessAt = (d.ThicknessAt == "AFFN" ? "After Finishing" : "After Shaving"),
                    SizeRangeUnit = d.SizeRangeUnit,
                    SizeRangeUnitName = (u == null ? "SFT" : u.UnitName),
                    RequiredPercentage = d.RequiredPercentage,
                    ThicknessUnit = d.ThicknessUnit,
                    ThicknessUnitName = (tu == null?"SFT":tu.UnitName),
                    Remarks = d.Remarks
                }).ToList();

                return(Data);
            }
        }
        public List <PrdYearMonthCrustScheduleColor> GetColorListForOrderItem(string _BuyerOrderItemID)
        {
            using (_context)
            {
                var Data = (from c in _context.SLS_BuyerOrderItemColor.AsEnumerable()
                            where c.BuyerOrderItemID.ToString() == _BuyerOrderItemID

                            join col in _context.Sys_Color on c.ColorID equals col.ColorID into Colors
                            from col in Colors.DefaultIfEmpty()

                            join u in _context.Sys_Unit on c.ColorUnit equals u.UnitID into Units
                            from u in Units.DefaultIfEmpty()
                            select new PrdYearMonthCrustScheduleColor
                {
                    //SdulItemColorID = c.SdulItemColorID,
                    ColorID = c.ColorID,
                    ColorName = (col == null ? null : col.ColorName),
                    //ColorArea = c.ColorArea,
                    //ColorPCS = c.ColorPCS,
                    //ColorSide = c.ColorSide,
                    //Remarks = c.Remarks,
                    AreaUnit = c.ColorUnit,
                    AreaUnitName = (u == null ? "" : u.UnitName)
                }).ToList();

                return(Data);
            }
        }
        public List <PrdYearMonthCrustScheduleColor> GetColorListForRequisitionItem(string _RequisitionItemID)
        {
            using (_context)
            {
                var Data = (from c in _context.PRD_YearMonthFinishReqItemColor.AsEnumerable()
                            where c.RequisitionItemID.ToString() == _RequisitionItemID

                            join col in _context.Sys_Color on c.ColorID equals col.ColorID into Colors
                            from col in Colors.DefaultIfEmpty()

                            join u in _context.Sys_Unit on c.AreaUnit equals u.UnitID into Units
                            from u in Units.DefaultIfEmpty()

                            orderby c.ArticleColorNo ascending
                            select new PrdYearMonthCrustScheduleColor
                {
                    //SdulItemColorID = c.SdulItemColorID,
                    ReqItemColorID = c.ReqItemColorID,
                    RequisitionItemID = c.RequisitionItemID,
                    ColorID = c.ColorID,
                    ArticleColorNo = c.ArticleColorNo,
                    ColorName = (col == null ? null : col.ColorName),
                    ColorArea = c.ColorArea,
                    ColorPCS = c.ColorPcs,
                    ColorSide = c.ColorSide,
                    Remarks = c.Remarks,
                    AreaUnit = c.AreaUnit,
                    AreaUnitName = (u == null ? "" : u.UnitName)
                }).ToList();

                return(Data);
            }
        }
        public List <PrdYearMonthCrustScheduleColor> GetColorListForScheduleItem(string _ScheduleItemID)
        {
            using (_context)
            {
                var Data = (from c in _context.PRD_YearMonthFinishScheduleColor.AsEnumerable()
                            where c.ScheduleItemID.ToString() == _ScheduleItemID

                            join col in _context.Sys_Color on c.ColorID equals col.ColorID into Colors
                            from col in Colors.DefaultIfEmpty()

                            join u in _context.Sys_Unit on c.AreaUnit equals u.UnitID into Units
                            from u in Units.DefaultIfEmpty()

                            join wu in _context.Sys_Unit on c.WeightUnit equals wu.UnitID into WUnits
                            from wu in WUnits.DefaultIfEmpty()
                            select new PrdYearMonthCrustScheduleColor
                {
                    SdulItemColorID = c.SdulItemColorID,
                    ColorID = c.ColorID,
                    ArticleColorNo = c.ArticleColorNo,
                    ColorName = (col == null ? null : col.ColorName),
                    ColorArea = c.ColorArea,
                    ColorPCS = c.ColorPCS,
                    ColorSide = c.ColorSide,
                    Remarks = c.Remarks,
                    AreaUnit = c.AreaUnit,
                    AreaUnitName = (u == null ? "" : u.UnitName),
                    ColorWeight = c.ColorWeight,
                    WeightUnit = c.WeightUnit,
                    WeightUnitName = (wu == null ? "" : wu.UnitName),
                }).ToList();

                return(Data);
            }
        }
Exemple #6
0
        public PRDChemProdReq GetRequisitionDetailsAfterSearch(int _RequisitionID)
        {
            var model = new PRDChemProdReq();


            var RequisitionInfo = (from r in _context.PRD_ChemProdReq.AsEnumerable()
                                   where r.RequisitionID == _RequisitionID

                                   join re in _context.PRD_Recipe on(r == null?null:r.RecipeID) equals re.RecipeID into Recepies
                                   from re in Recepies.DefaultIfEmpty()

                                   join c in _context.Sys_Color on(re == null? null: re.ArticleColor) equals c.ColorID into Colors
                                   from c in Colors.DefaultIfEmpty()

                                   join u in _context.Sys_Unit on(re == null ? 0 : re.BaseUnit) equals u.UnitID into Units
                                   from u in Units.DefaultIfEmpty()

                                   select new PRDChemProdReq
            {
                RequisitionID = r.RequisitionID,
                RequisitionNo = r.RequisitionNo,
                RequisitionCategory = r.RequisitionCategory,
                RequisitionType = r.RequisitionType,
                ReqRaisedOn = (Convert.ToDateTime(r.ReqRaisedOn)).ToString("dd'/'MM'/'yyyy"),
                RequiredByTime = (r.RequiredByTime == 0? null: r.RequiredByTime),
                ReqRaisedBy = (r.ReqRaisedBy),
                RequisitionFrom = r.RequisitionFrom,
                RequisitionTo = r.RequisitionTo,
                RecipeFor = (r.RecipeFor),
                RecipeID = (r.RecipeID),
                ArticleNo = r.ArticleNo,
                ArticleName = (re == null? null: re.ArticleName),
                ArticleChallanNo = (re == null ? null : re.ArticleChallanNo),
                ArticleColor = (re == null ? null : re.ArticleColor),
                ArticleColorName = (c == null ? null : c.ColorName),
                BaseQuantity = (re == null ? null : (re.BaseQuantity).ToString()),
                //BaseUnit = (re == null ? null : re.BaseUnit),
                BaseUnitName = (u == null ? null : u.UnitName),
                LeatherSize = r.LeatherSize,
                SizeUnit = (r.SizeUnit),
                Selection = r.Selection,
                Thickness = r.Thickness,
                ThicknessUnit = (r.ThicknessUnit),
                ProductionQty = (r.ProductionQty == 0 ? null : r.ProductionQty),
                ProductionQuantityUnit = (u == null ? null : u.UnitName),
                RecordStatus = r.RecordStatus
            }).FirstOrDefault();

            model.RequisitionInfo = RequisitionInfo;

            model.RequisitionItemList = GetRequisitionItemList(_RequisitionID, RequisitionInfo.RequisitionTo);

            return(model);
        }
Exemple #7
0
        //For LOV in Grid
        public List <PRDChemProdReqItem> GetStoreWiseChemicalItemStock(string _IssueFrom)
        {
            using (_context)
            {
                var StockResult = (from p in _context.INV_ChemStockSupplier
                                   where p.StoreID.ToString() == _IssueFrom
                                   group p by new
                {
                    //p.StoreID,
                    p.SupplierID,
                    p.PackSize,
                    p.ItemID,
                    p.SizeUnit,
                    p.UnitID
                } into g
                                   select new
                {
                    TransectionID = g.Max(p => p.TransectionID),
                    //StoreID = g.Where(p => p.TransectionID == g.Max(q => q.TransectionID)).Select(x => x.StoreID).FirstOrDefault(),
                    ItemID = g.Where(p => p.TransectionID == g.Max(q => q.TransectionID)).Select(x => x.ItemID).FirstOrDefault(),
                    SupplierID = g.Where(p => p.TransectionID == g.Max(q => q.TransectionID)).Select(x => x.SupplierID).FirstOrDefault(),
                    //UnitID = g.Where(p => p.TransectionID == g.Max(q => q.TransectionID)).Select(x => x.UnitID).FirstOrDefault(),
                    PackSize = g.Where(p => p.TransectionID == g.Max(q => q.TransectionID)).Select(x => x.PackSize).FirstOrDefault(),
                    SizeUnit = g.Where(p => p.TransectionID == g.Max(q => q.TransectionID)).Select(x => x.SizeUnit).FirstOrDefault(),
                    PackQty = g.Where(p => p.TransectionID == g.Max(q => q.TransectionID)).Select(x => x.PackClosingQty).FirstOrDefault(),
                    ClosingQty = g.Where(p => p.TransectionID == g.Max(q => q.TransectionID)).Select(x => x.ClosingQty).FirstOrDefault(),
                    StockUnit = g.Where(p => p.TransectionID == g.Max(q => q.TransectionID)).Select(x => x.UnitID).FirstOrDefault()
                }).ToList();



                var Data = (from s in StockResult
                            where s.ClosingQty > 0

                            join i in _context.Sys_ChemicalItem on(s == null ? null : s.ItemID) equals i.ItemID into Items
                            from i in Items.DefaultIfEmpty()


                            join sup in _context.Sys_Supplier on(s == null ? 0 : s.SupplierID) equals sup.SupplierID into Suppliers
                            from sup in Suppliers.DefaultIfEmpty()

                            join si in _context.Sys_Size on(s == null ? 0 : s.PackSize) equals si.SizeID into Sizes
                            from si in Sizes.DefaultIfEmpty()

                            join siu in _context.Sys_Unit on(s == null ? 0 : s.SizeUnit) equals siu.UnitID into Units
                            from siu in Units.DefaultIfEmpty()

                            join su in _context.Sys_Unit on(s == null ? 0 : s.StockUnit) equals su.UnitID into StockUnits
                            from su in StockUnits.DefaultIfEmpty()

                            orderby(i == null ? null : i.ItemName)

                            select new PRDChemProdReqItem
                {
                    ItemID = s.ItemID,
                    ItemName = (i == null ? null : i.ItemName),

                    SupplierID = s.SupplierID,
                    SupplierName = (sup == null ? null : sup.SupplierName),

                    PackSize = s.PackSize,
                    PackSizeName = (si == null ? null : si.SizeName),

                    SizeUnit = s.SizeUnit,
                    SizeUnitName = (siu == null ? null : siu.UnitName),

                    StockQty = s.ClosingQty,
                    StockUnit = s.StockUnit,
                    StockUnitName = (su == null ? null : su.UnitName),

                    PackQty = (Int32)(s.PackQty)
                }).ToList();

                return(Data);
            }
        }