public async Task <List <AmqCvRate> > GetAsync(AmqCvRate model, EntityContextFASTTRACK context) { return(await context.AmqCvRate .Where(c => c.Prdplan == model.Prdplan && c.Insureage == model.Insureage) .OrderBy(c => c.Endyear) .ToListAsync()); }
public async Task <List <AmqPlan> > GetAsync(EntityContextFASTTRACK context) { return(await context.AmqPlan .Join(context.AmqProduct, plan => plan.ProdId, product => product.ProdId, (plan, product) => new { plan, product }) .Join(context.AmqProductGroup, B => B.product.ProdGrpId, planGr => planGr.ProdGrpId, (B, planGr) => new AmqPlan { PlanCode = B.plan.PlanCode, PlanShortNameTh = (B.plan.IsActive != "A" ? MsgNotSale : B.product.IsActive != "A" ? MsgNotSale : "") + B.plan.PlanCode + " : " + B.plan.PlanShortNameTh, ProdGrpNameTh = planGr.ProdGrpNameTh, IsActive = B.plan.IsActive, ProdGrpType = planGr.ProdGrpType }) .Where(c => c.ProdGrpType == "B") .ToListAsync()); }
public async Task <bool> IsActivePlan(string PlanCode, EntityContextFASTTRACK context) => await context.AmqPlan.Where(c => c.PlanCode == PlanCode && c.IsActive == "A").AnyAsync();
public PlanController(IOptions <AppSettings> _appSettings, EntityContextFASTTRACK _contextFt, EntityContextWEB _contextWeb) { appSettings = _appSettings.Value; contextFt = _contextFt; contextWeb = _contextWeb; }