public IHttpActionResult GetAllMachineBags() { PillarsaltDbContext db = new PillarsaltDbContext(); BagViewModel bagViewModel = new BagViewModel(); bagViewModel.TmsMachineBagses = db.TMS_MachineBags.ToList(); bagViewModel.TmsDepositeBags = db.TMS_DepositeBag.ToList().ToList(); bagViewModel.TmsMachineBrands = db.TMS_Machine_BrandandModels.ToList(); var qry = from d in _machineBagsBll.GetAll() join b in bagViewModel.TmsMachineBrands on d.MachineId equals b.Id join t in bagViewModel.TmsMachineDocumentses on d.MachineId equals t.Id join p in bagViewModel.TmsDepositeBags on d.BagId equals p.Id select new { t.MachineName, machineId = b.Id, mBagNo = p.BagNo, d.Id, d.Notes, d.MachineId, d.BagId, d.StaffId, d.Amount, d.CurrentStage, d.UserId, d.AttachDate, d.Active }; return(Ok(qry.ToList())); }
public IHttpActionResult GetMachineBagsById(int id) { var contact = _machineBagsBll.GetById(id); if (contact.Any()) { PillarsaltDbContext db = new PillarsaltDbContext(); BagViewModel bagViewModel = new BagViewModel { TmsMachineBagses = db.TMS_MachineBags.ToList(), TmsDepositeBags = db.TMS_DepositeBag.ToList().ToList(), TmsMachineDocumentses = db.TMS_Machine_Documents.ToList() }; var qry = from d in _machineBagsBll.GetById(id) join b in bagViewModel.TmsMachineDocumentses on d.MachineId equals b.Id join p in bagViewModel.TmsDepositeBags on d.BagId equals p.Id select new { b.MachineName, machineId = b.Id, mBagNo = p.BagNo, d.Id, d.Notes, d.MachineId, d.BagId, d.StaffId, d.Amount, d.CurrentStage, d.UserId, d.AttachDate, d.Active }; return(Ok(qry.ToList())); } else { return(Json(new { Msg = "0", Reason = "Recordset is empty!" })); } }
public IHttpActionResult GetMachineBagsByContext(string sValue) { if (sValue != null) { PillarsaltDbContext db = new PillarsaltDbContext(); BagViewModel bagViewModel = new BagViewModel { TmsMachineBagses = db.TMS_MachineBags.ToList(), TmsDepositeBags = db.TMS_DepositeBag.ToList().ToList(), TmsMachineDocumentses = db.TMS_Machine_Documents.ToList() }; var qry = from d in _machineBagsBll.GetAll().Where(m => m.MachineId != null && m.MachineId.Equals(sValue)) join b in bagViewModel.TmsMachineDocumentses on d.MachineId equals b.Id join p in bagViewModel.TmsDepositeBags on d.BagId equals p.Id select new { b.MachineName, machineId = b.Id, mBagNo = p.BagNo, d.Id, d.Notes, d.MachineId, d.BagId, d.StaffId, d.Amount, d.CurrentStage, d.UserId, d.AttachDate, d.Active }; return(Ok(qry.ToList())); } return(Json(new { Msg = "0" })); }
public TmsJobProgressionRepository() { _dbContext = new PillarsaltDbContext(); }
public AccBankMappingController() { _batViewModel = new BankAccountViewModel(); _bankMappingBll = new AccBankMappingBll(); _db = new PillarsaltDbContext(); }
public AccAccountsBankDetailsController() { _batViewModel = new BankAccountViewModel(); _accountsBankDetailsBll = new AccAccountsBankDetailsBll(); _db = new PillarsaltDbContext(); }
public TmsLanguageResourcesController() { _languageResourcesBll = new TmsLanguageResourcesBll(); _languageViewModel = new LanguageViewModel(); _dbContext = new PillarsaltDbContext(); }