public ActionResult Delete(Guid id) { var relevance = new List <object>() { new StatusMessageForDeleteOperation <Person>("当前类型已经被人员数据引用,不能删除。", x => x.JobLevel.ID == id), }; var deleteStatus = new DeleteStatus(); BusinessEntityComponentsFactory.SetDeleteStatus <JobLevel>(id, deleteStatus, relevance); var actionDeleteStatus = new DeleteActionStatus(); actionDeleteStatus.IsOK = deleteStatus.SDSM[0].OperationStatus; actionDeleteStatus.ErrorMassage = deleteStatus.SDSM[0].OperationMessage; actionDeleteStatus.PageIndex = "1"; actionDeleteStatus.TypeID = ""; return(Json(actionDeleteStatus)); }
public ActionResult Delete(Guid id) { var bo = _Service.GetSingle(id); var relevance = new List <object>() { new StatusMessageForDeleteOperation <SystemWorkPlace>("当前工作区已经包含有内部使用的数据,不能删除。", bo.SystemWorkSections.Count), }; var deleteStatus = new DeleteStatus(); BusinessEntityComponentsFactory.SetDeleteStatus <SystemWorkPlace>(id, deleteStatus, relevance); var actionDeleteStatus = new DeleteActionStatus(); actionDeleteStatus.IsOK = deleteStatus.SDSM[0].OperationStatus; actionDeleteStatus.ErrorMassage = deleteStatus.SDSM[0].OperationMessage; actionDeleteStatus.PageIndex = "1"; actionDeleteStatus.TypeID = ""; return(Json(actionDeleteStatus)); }
public ActionResult Delete(Guid id) { var typeID = _Service.GetSingle(id).Department.ID.ToString(); // 下面的删除管理条件需要根据各个实体的业务逻辑进行定义的 var relevance = new List <object>() { new StatusMessageForDeleteOperation <ApplicationUser>("当前人员数据已经在系统用户中关联使用,不能删除。", x => x.Person.ID == id), }; var deleteStatus = new DeleteStatus(); BusinessEntityComponentsFactory.SetDeleteStatus <Person>(id, deleteStatus, relevance); var actionDeleteStatus = new DeleteActionStatus(); actionDeleteStatus.IsOK = deleteStatus.SDSM[0].OperationStatus; actionDeleteStatus.ErrorMassage = deleteStatus.SDSM[0].OperationMessage; actionDeleteStatus.PageIndex = "1"; actionDeleteStatus.TypeID = typeID; return(Json(actionDeleteStatus)); }
public ActionResult Delete(Guid id) { var typeID = _Service.GetSingle(id).ParentDapartment.ID.ToString(); // 下面的删除管理条件需要根据各个实体的业务逻辑进行定义的 var relevance = new List <object>() { new StatusMessageForDeleteOperation <Department>("当前部门已经被其它部门作为上级部门使用,不能删除。", x => x.ParentDapartment.ID == id), }; var deleteStatus = new DeleteStatus(); BusinessEntityComponentsFactory.SetDeleteStatus <Department>(id, deleteStatus, relevance); var actionDeleteStatus = new DeleteActionStatus(); actionDeleteStatus.IsOK = deleteStatus.SDSM[0].OperationStatus; actionDeleteStatus.ErrorMassage = deleteStatus.SDSM[0].OperationMessage; actionDeleteStatus.PageIndex = "1"; actionDeleteStatus.TypeID = typeID; actionDeleteStatus.ExtenssionFunctionString = "RefreshTreeView"; // 约定数据持久化之后,除了执行返回列表的方法外,还需要执行的刷新导航树的另外的方法 return(Json(actionDeleteStatus)); }
public ActionResult Save(PersonVM boVM) { if (ModelState.IsValid) { var bo = _Service.GetSingle(boVM.ID); if (bo == null) { bo = new Person(); bo.ID = boVM.ID; } boVM.MapToBo(bo); var creID = Guid.Parse(boVM.CredentialsTypeID); var credentialType = _Service.GetSingleRelevance <CredentialsType>(creID); var jlID = Guid.Parse(boVM.JobLevelID); var jobLevel = _Service.GetSingleRelevance <JobLevel>(jlID); var jtID = Guid.Parse(boVM.JobTitleID); var jobTitle = _Service.GetSingleRelevance <JobTitle>(jtID); var dID = Guid.Parse(boVM.ParentItemID); var dept = _Service.GetSingleRelevance <Department>(dID); bo.Name = bo.FirstName + bo.LastName; if (String.IsNullOrEmpty(bo.SortCode)) { bo.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <Person>(); } bo.CredentialsType = credentialType; bo.JobLevel = jobLevel; bo.JobTitle = jobTitle; bo.Department = dept; bo.UpdateTime = DateTime.Now; bo.IsActivePerson = true; _Service.AddOrEditAndSave(bo); //var personInDepartment = _Service.GetSingleRelevanceBy<PersonsInDepartment>(p => p.Person.ID == bo.ID && p.Department.ID == dID); //if (personInDepartment == null) //{ // personInDepartment = new PersonsInDepartment() { Department = dept, Person = bo }; // _Service.AddAndSaveRelevance<PersonsInDepartment>(personInDepartment); //} var typeID = boVM.ParentItemID; return(Json(PageComponentRepository <PersonVM> .SaveOK(true, "1", typeID))); } else { var vItems = new List <ValidatorResult>(); foreach (var item in ModelState) { if (item.Value.Errors != null) { foreach (var vItem in item.Value.Errors) { var errItem = new ValidatorResult(); errItem.Name = item.Key; errItem.ErrorMessage = vItem.ErrorMessage; vItems.Add(errItem); } } } boVM.ParentItemColection = BusinessCollectionFactory <Department> .GetSelfReferentialItemCollection(true); boVM.CredentialsTypeCollection = BusinessCollectionFactory <CredentialsType> .GetPlainFacadeItemCollection(); boVM.JobLevelCollection = BusinessCollectionFactory <JobLevel> .GetPlainFacadeItemCollection(); boVM.JobTitleCollection = BusinessCollectionFactory <JobTitle> .GetPlainFacadeItemCollection(); var editor = PageComponentRepository <PersonVM> .UpdateCreateOrEditDialog(boVM, false, vItems).InnerHtmlContent; return(Json(editor)); } }
public DepartmentTypeInDepartment() { this.ID = Guid.NewGuid(); this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <DepartmentTypeInDepartment>(); }
} // 使用该图片的业务对象的 id public BusinessImage() { this.ID = Guid.NewGuid(); this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <BusinessImage>(); this.UploadedTime = DateTime.Now; }
} //订单创建时间 public SK_WM_ShopCarGoodsItem() { this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <SK_WM_ShopCarGoodsItem>(); this.ID = Guid.NewGuid(); }
public MessageNotification() { ID = Guid.NewGuid(); CreateDateTime = DateTime.Now; SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <MessageNotification>(); }
public Person() { ID = Guid.NewGuid(); UpdateTime = CreateDateTime = Birthday = ExpiredDateTime = DateTime.Now; SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <Person>(); }
} // 授权任务 public AccreditRoleGroup() { this.ID = Guid.NewGuid(); this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <AccreditRoleGroup>(); }
} //系统审核员ID public SK_WM_ShopSttled() { this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <SK_WM_Goods>(); this.ID = Guid.NewGuid(); this.State = 0; }
} // 审核人 public AuditRecord() { Id = Guid.NewGuid(); BussinessCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <AuditRecord>(); AuditDateTime = DateTime.Now; }
public SK_WM_Shop() { this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <SK_WM_Shop>(); this.ID = Guid.NewGuid(); SettledDateTime = DateTime.Now; }
} //绑定的User //public virtual IQueryable<SK_WM_OrderItem> SK_WM_OrderItem { get; set; } public SK_WM_Order() { this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <SK_WM_Order>(); this.ID = Guid.NewGuid(); }
public ApplicaitionUserInApplication() { this.ID = Guid.NewGuid(); this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <ApplicationInformation>(); }
} // 备案号 public WebSiteSettings() { this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <WebSiteSettings>(); this.Id = Guid.NewGuid(); }
public SK_WM_ShopExecuteIllegal() { this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <SK_WM_Goods>(); this.ID = Guid.NewGuid(); }
} // 上级部门 public Department() { this.Id = Guid.NewGuid(); this.IsActiveDepartment = true; this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <Department>(); }
public BusinessFile() { this.BussinessCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <BusinessFile>(); }
} // 关联上传人ID public BusinessFile() { this.Id = Guid.NewGuid(); this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <BusinessFile>(); this.AttachmentTimeUploaded = DateTime.Now; }
public YZ_Commodity() { this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <YZ_Commodity>(); this.Id = Guid.NewGuid(); this.AddTime = DateTime.Now; }