Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
        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));
            }
        }
Ejemplo n.º 6
0
 public DepartmentTypeInDepartment()
 {
     this.ID       = Guid.NewGuid();
     this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <DepartmentTypeInDepartment>();
 }
Ejemplo n.º 7
0
        }                                            // 使用该图片的业务对象的 id

        public BusinessImage()
        {
            this.ID           = Guid.NewGuid();
            this.SortCode     = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <BusinessImage>();
            this.UploadedTime = DateTime.Now;
        }
Ejemplo n.º 8
0
 }                                             //订单创建时间
 public SK_WM_ShopCarGoodsItem()
 {
     this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <SK_WM_ShopCarGoodsItem>();
     this.ID       = Guid.NewGuid();
 }
Ejemplo n.º 9
0
 public MessageNotification()
 {
     ID             = Guid.NewGuid();
     CreateDateTime = DateTime.Now;
     SortCode       = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <MessageNotification>();
 }
Ejemplo n.º 10
0
 public Person()
 {
     ID         = Guid.NewGuid();
     UpdateTime = CreateDateTime = Birthday = ExpiredDateTime = DateTime.Now;
     SortCode   = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <Person>();
 }
Ejemplo n.º 11
0
        }                                                          // 授权任务

        public AccreditRoleGroup()
        {
            this.ID       = Guid.NewGuid();
            this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <AccreditRoleGroup>();
        }
Ejemplo n.º 12
0
 }                                                                       //系统审核员ID
 public SK_WM_ShopSttled()
 {
     this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <SK_WM_Goods>();
     this.ID       = Guid.NewGuid();
     this.State    = 0;
 }
Ejemplo n.º 13
0
        }                                                // 审核人

        public AuditRecord()
        {
            Id            = Guid.NewGuid();
            BussinessCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <AuditRecord>();
            AuditDateTime = DateTime.Now;
        }
Ejemplo n.º 14
0
 public SK_WM_Shop()
 {
     this.SortCode   = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <SK_WM_Shop>();
     this.ID         = Guid.NewGuid();
     SettledDateTime = DateTime.Now;
 }
Ejemplo n.º 15
0
        }                                                                    //绑定的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();
        }
Ejemplo n.º 16
0
 public ApplicaitionUserInApplication()
 {
     this.ID       = Guid.NewGuid();
     this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <ApplicationInformation>();
 }
Ejemplo n.º 17
0
 }                              // 备案号
 public WebSiteSettings()
 {
     this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <WebSiteSettings>();
     this.Id       = Guid.NewGuid();
 }
Ejemplo n.º 18
0
 public SK_WM_ShopExecuteIllegal()
 {
     this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <SK_WM_Goods>();
     this.ID       = Guid.NewGuid();
 }
Ejemplo n.º 19
0
        }                                                         // 上级部门

        public Department()
        {
            this.Id = Guid.NewGuid();
            this.IsActiveDepartment = true;
            this.SortCode           = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <Department>();
        }
Ejemplo n.º 20
0
 public BusinessFile()
 {
     this.BussinessCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <BusinessFile>();
 }
Ejemplo n.º 21
0
 }                                                              // 关联上传人ID
 public BusinessFile()
 {
     this.Id       = Guid.NewGuid();
     this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <BusinessFile>();
     this.AttachmentTimeUploaded = DateTime.Now;
 }
Ejemplo n.º 22
0
 public YZ_Commodity()
 {
     this.SortCode = BusinessEntityComponentsFactory.SortCodeByDefaultDateTime <YZ_Commodity>();
     this.Id       = Guid.NewGuid();
     this.AddTime  = DateTime.Now;
 }