protected override string GetIndexViewTitle() { var programId = ParentEntityId.ToInteger(); var program = _programService.Find(programId); return(string.Format("{0} - Products", program.Name)); }
protected override string GetIndexViewTitle() { var userService = new UserService(new UnitOfWorkWrapper()); var user = userService.Find(ParentEntityId.ToInteger()); return(string.Format("{0} - User Group Map", user.UserName)); }
protected override IEnumerable <DosageViewModel> GetModelRecordsToBindInGrid() { var id = ParentEntityId.ToInteger(); var dosageItems = _dosageService.Filter(o => o.ProductId == id).Select(o => o.Convert <Dosage, DosageViewModel>()); return(dosageItems); }
protected override IEnumerable <UserGroupFunctionViewModel> GetModelRecordsToBindInGrid() { var theParentId = ParentEntityId.ToInteger(); var unitOfWork = new UnitOfWorkWrapper(); var model = unitOfWork.Repository <UserGroupFunction>().GetAllIncluding(o => o.CentralFunction.CentralModule) .Where(c => c.UserGroupId == (theParentId == 0 ? c.UserGroupId : theParentId)) .Select(source => new UserGroupFunctionViewModel { UserGroupFunctionId = source.UserGroupFunctionId, ModuleName = source.CentralFunction.CentralModule.ModuleName, FunctionName = source.CentralFunction.FunctionName, CentralFunctionId = source.CentralFunction.CentralFunctionId, UserGroupId = source.UserGroupId }); //var model = _service.Filter(c => c.UserGroupId == (theParentId == 0 ? c.UserGroupId : theParentId)) // .Select(source => new UserGroupFunctionViewModel // { // UserGroupFunctionId = source.UserGroupFunctionId, // ModuleName = source.CentralFunction.CentralModule.ModuleName, // FunctionName = source.CentralFunction.FunctionName, // CentralFunctionId = source.CentralFunction.CentralFunctionId, // UserGroupId = source.UserGroupId // }); //.OrderBy(c => c.CentralFunction.FunctionName) //.Select(AssignEntityToViewModel); return(model); }
protected override IEnumerable <CardPrefixViewModel> GetModelRecordsToBindInGrid() { var programId = ParentEntityId.ToInteger(); return(_cardPrefixService.Filter(o => o.ProgramId == programId) .Select(o => o.Convert <CardPrefix, CardPrefixViewModel>())); }
protected override void SetViewBagsForCreate(int?id) { var programId = ParentEntityId.ToInteger(); var program = _programService.Find(programId); ViewBag.ProgramName = program.Name; ViewBag.ProgramId = programId; }
protected override ConversionFactorViewModel SetViewModelData(ConversionFactorViewModel viewModel) { viewModel.DosageId = ParentEntityId.ToInteger(); var dosage = _dosageService.Find(viewModel.DosageId); viewModel.DosageForm = dosage.Name; viewModel.ProductName = _productService.Find(dosage.ProductId).Name; return(base.SetViewModelData(viewModel)); }
protected override void SetViewBagForIndexView(int?id) { var cardTypeId = ParentEntityId.ToInteger(); var cardTypeItem = _cardTypeService.Find(cardTypeId); if (cardTypeItem != null) { ViewBag.CardTypeName = cardTypeItem.Name; } }
private void SetViewBags() { var classItem = _classService.Find(ParentEntityId.ToInteger()); if (classItem != null) { ViewBag.ClassName = classItem.Name; } ViewBag.ClassId = ParentEntityId.ToString(); }
private void SetViewBag() { var productId = ParentEntityId.ToInteger(); var productItem = _productService.Find(productId); if (productItem != null) { ViewBag.ProductName = productItem.Name; } ViewBag.ProductId = ParentEntityId.ToString(); }
private void SetViewBags() { var classItem = _dosageService.Find(ParentEntityId.ToInteger()); if (classItem != null) { //TODO:Kevin Check ViewBag.ClassName = classItem.Name; } ViewBag.ClassId = ParentEntityId.ToString(); }
protected override IEnumerable <ProgramProductMappingViewModel> GetModelRecordsToBindInGrid() { var parentId = ParentEntityId.ToInteger(); return(_service.Filter(o => o.ProgramId == parentId) .Select(o => new ProgramProductMappingViewModel { ProgramProductMappingId = o.ProgramProductMappingId, ProductName = o.Product.Name, Status = o.Status })); }
protected override IEnumerable <SalesRetailPriceViewModel> GetModelRecordsToBindInGrid() { //TODO: check if it returns product and dosage var id = ParentEntityId.ToInteger(); var dosageItem = _dosageService.Find(id); var productId = dosageItem.ProductId; var productItem = _productService.Find(productId); var salesRetailItems = _service.Filter(o => o.DosageId.Equals(id)).ToList(); foreach (var item in salesRetailItems) { item.DosageId = id; item.ProductId = productId; item.Dosage.Name = dosageItem.Name; item.Product.Name = productItem.Name; } return(salesRetailItems.Where(o => o.SalesRetailPriceId.Equals(id)).Select(o => o.Convert <SalesRetailPrice, SalesRetailPriceViewModel>())); var items = _service.Filter(o => o.SalesRetailPriceId.Equals(id)).Select(o => o.Convert <SalesRetailPrice, SalesRetailPriceViewModel>()); return(_service.Filter(o => o.SalesRetailPriceId.Equals(id)).Select(o => o.Convert <SalesRetailPrice, SalesRetailPriceViewModel>())); }
protected override IEnumerable <ProgramViewModel> GetModelRecordsToBindInGrid() { var cardTypeId = ParentEntityId.ToInteger(); return(_service.Filter(o => o.CardTypeId == cardTypeId).Select(o => o.Convert <Program, ProgramViewModel>())); }
protected override IEnumerable <CardTypeViewModel> GetModelRecordsToBindInGrid() { var id = ParentEntityId.ToInteger(); return(_service.Filter(o => o.ClassId.Equals(id)).Select(o => o.Convert <CardType, CardTypeViewModel>())); }