Пример #1
0
        public ActionResult Reports()
        {
            var rfqs = _context.ReferanceNumbers.Include("File").Where(r => r.Stage < 5 && r.Isactive == false).ToList();

            List <FileMasterDetailsViewModel> list = new List <FileMasterDetailsViewModel>();

            foreach (var rfq in rfqs)
            {
                var vessel = _context.Vessels.FirstOrDefault(v => v.Id == rfq.File.VesselId);

                StageList.Stages stag = (StageList.Stages)rfq.Stage;

                FileMasterDetailsViewModel item = new FileMasterDetailsViewModel
                {
                    File  = rfq.File.FileNumber,
                    Rfq   = rfq.Name,
                    RFQId = rfq.Id,
                    Stage = stag.ToString()
                };

                if (vessel != null)
                {
                    item.Vessel = vessel.VesselName;
                }
                list.Add(item);
            }


            return(View(list));
        }
Пример #2
0
        public JsonResult GetRfqsbyFileId(int FileId)
        {
            var splitstage = Convert.ToByte(StageList.Stages.OnSplitting);
            var files      = _context.ReferanceNumbers.Where(r => (r.Stage == splitstage) && r.IsDeleted == false && r.FileId == FileId).ToList();
            var list       =
                new List <RfqDetail>();

            foreach (var item in files)
            {
                int itemcount = _context.LineItems.Where(l => l.ReferanceNumberId == item.Id).ToList().Count;

                StageList.Stages STG = (StageList.Stages)item.Stage;

                list.Add(new RfqDetail {
                    RfqName = item.Name, RfqId = item.Id, Count = itemcount, StageId = item.Stage, Stage = STG.ToString(), PoNumber = item.PONumber
                });
            }
            return(Json(list));
        }
Пример #3
0
        public JsonResult GetRfqsDetailbyFileId(int FileId)
        {
            var files = _context.ReferanceNumbers.Where(f => f.FileId == FileId).Where(f => f.IsDeleted == false).ToList();
            var list  =
                new List <RfqDetail> ();

            foreach (var item in files)
            {
                int itemcount = _context.LineItems.Where(l => l.ReferanceNumberId == item.Id).ToList().Count;

                StageList.Stages STG = (StageList.Stages)item.Stage;

                list.Add(new RfqDetail {
                    RfqName = item.Name, RfqId = item.Id, Count = itemcount, StageId = item.Stage, Stage = STG.ToString()
                });
            }
            return(Json(list));
        }