public override void Init(Guid subscriberId) { if (CategorySearchRepository.Any(subscriberId)) { return; } IEnumerable <SalaryCategoryEntity> categories = new List <SalaryCategoryEntity> { new SalaryCategoryEntity { Name = "工资", SubscriberId = subscriberId }, new SalaryCategoryEntity { Name = "奖金", SubscriberId = subscriberId }, new SalaryCategoryEntity { Name = "报销", SubscriberId = subscriberId }, new SalaryCategoryEntity { Name = "补贴", SubscriberId = subscriberId } }; CategoryAddRepository.AddEntities(categories); }
protected virtual bool Exist(Guid id, string name) { var subscriberId = UserContext.Current.SubscriberId; var properties = CategorySearchRepository.GetEntities(subscriberId, s => s.Name == name); return(properties.Any(s => s.Id != id)); }
protected override bool Compensate(Guid categoryId, IEnumerable <Guid> compensates) { var compensate = true; if (CategoryAssociationBindTriggers == null) { return(compensate); } var subscriberId = UserContext.Current.SubscriberId; var category = CategorySearchRepository.GetEntity(subscriberId, categoryId); if (category == null) { return(false); } var associations = AssociationSearchRepository.GetEntities(subscriberId, s => compensates.Contains(s.Id)); associations.ForEach(association => { CategoryAssociationBindTriggers.ToList().ForEach( trigger => { compensate &= trigger.Bound(category, association); } ); }); return(compensate); }
public List <dynamic> Execute() { using (var cmd = new CategorySearchRepository()) { return(cmd.Exeucte()); } }
public ActionResult ProductInput(ProductInputAction CommandAction) { this.ViewBag.Result = new List <dynamic>(); if (CommandAction.ProductId != null) { this.ViewBag.Result = CommandAction.Execute(); this.ViewBag.EditFlag = "M"; } using (var cmd = new CategorySearchRepository()) { this.ViewBag.Product = cmd.Exeucte(); } return(View()); }
public override void Init(Guid subscriberId) { if (CategorySearchRepository.Any(subscriberId)) { return; } IEnumerable <PurchaseCategoryEntity> categories = new List <PurchaseCategoryEntity> { new PurchaseCategoryEntity { Name = "默认", SubscriberId = subscriberId } }; CategoryAddRepository.AddEntities(categories); }
public override void Init(Guid subscriberId) { if (CategorySearchRepository.Any(subscriberId)) { return; } IEnumerable <EmployeeCategoryEntity> categories = new List <EmployeeCategoryEntity> { new EmployeeCategoryEntity { Name = "正式员工", SubscriberId = subscriberId }, new EmployeeCategoryEntity { Name = "临时工", SubscriberId = subscriberId } }; CategoryAddRepository.AddEntities(categories); }
public override void Init(Guid subscriberId) { if (CategorySearchRepository.Any(subscriberId)) { return; } IEnumerable <AttendanceCategoryEntity> categories = new List <AttendanceCategoryEntity> { new AttendanceCategoryEntity { Name = "出勤", SubscriberId = subscriberId }, new AttendanceCategoryEntity { Name = "请假", SubscriberId = subscriberId } }; CategoryAddRepository.AddEntities(categories); }
public override void Init(Guid subscriberId) { if (CategorySearchRepository.Any(subscriberId)) { return; } IEnumerable <GoodsCategoryEntity> categories = new List <GoodsCategoryEntity> { new GoodsCategoryEntity { Name = "产品", SubscriberId = subscriberId, Saleable = true, Purchaseable = false }, new GoodsCategoryEntity { Name = "原料", SubscriberId = subscriberId, Saleable = false, Purchaseable = true } }; CategoryAddRepository.AddEntities(categories); }
public override void Init(Guid subscriberId) { if (CategorySearchRepository.Any(subscriberId)) { return; } IEnumerable <StockCategoryEntity> categories = new List <StockCategoryEntity> { new StockCategoryEntity { Name = "当前库存", SubscriberId = subscriberId }, new StockCategoryEntity { Name = "出库记录", SubscriberId = subscriberId }, new StockCategoryEntity { Name = "入库记录", SubscriberId = subscriberId }, }; CategoryAddRepository.AddEntities(categories); }
protected virtual CategoryEntity GetCategory(Guid categoryId) { return(CategorySearchRepository.GetEntity(UserContext.Current.SubscriberId, categoryId)); }
protected virtual bool Exist(string name) { var subscriberId = UserContext.Current.SubscriberId; return(CategorySearchRepository.Any(subscriberId, name)); }