示例#1
0
        public object PostAddEdit(LURowDTO lURowDTO)
        {
            using (LURowService luRowService = new LURowService())
            {
                ResultOperation resultOperation = null;
                sysBpmsLURow    lURow           = new sysBpmsLURow().Update(lURowDTO.LUTableID, lURowDTO.NameOf, lURowDTO.CodeOf, lURowDTO.DisplayOrder, lURowDTO.IsSystemic, lURowDTO.IsActive);
                lURow.ID = lURowDTO.ID;
                if (lURow.ID != Guid.Empty)
                {
                    resultOperation = luRowService.Update(lURow);
                }
                else
                {
                    resultOperation = luRowService.Add(lURow);
                }

                if (resultOperation.IsSuccess)
                {
                    return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
                }
                else
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
            }
        }
示例#2
0
        public void Delete(Guid processGroupId)
        {
            sysBpmsLURow sysBpmsLURow = this.Context.sysBpmsLURows.FirstOrDefault(d => d.ID == processGroupId);

            if (sysBpmsLURow != null)
            {
                this.Context.sysBpmsLURows.Remove(sysBpmsLURow);
            }
        }
示例#3
0
        public ResultOperation Add(sysBpmsLURow LURow)
        {
            ResultOperation resultOperation = new ResultOperation();

            if (resultOperation.IsSuccess)
            {
                this.UnitOfWork.Repository <ILURowRepository>().Add(LURow);
                this.UnitOfWork.Save();
            }
            return(resultOperation);
        }
 public LURowDTO(sysBpmsLURow lURow)
 {
     if (lURow != null)
     {
         this.ID           = lURow.ID;
         this.LUTableID    = lURow.LUTableID;
         this.NameOf       = lURow.NameOf;
         this.CodeOf       = lURow.CodeOf;
         this.DisplayOrder = lURow.DisplayOrder;
         this.IsSystemic   = lURow.IsSystemic;
         this.IsActive     = lURow.IsActive;
     }
 }
示例#5
0
 public object GetAddEdit(Guid?ID = null, Guid?LUTableID = null)
 {
     using (LURowService luRowService = new LURowService())
     {
         using (LUTableService luTableService = new LUTableService())
         {
             sysBpmsLURow lURow = !ID.HasValue ?
                                  new sysBpmsLURow().Update(LUTableID.Value, "", (luRowService.MaxCodeOfByLUTableID(LUTableID.Value) + 1).ToStringObj(), luRowService.MaxOrderByLUTableID(LUTableID.Value) + 1, false, true) :
                                  luRowService.GetInfo(ID.Value);
             return(new LURowDTO(lURow));
         }
     }
 }
示例#6
0
        public ResultOperation Delete(Guid Id)
        {
            ResultOperation resultOperation = new ResultOperation();

            if (resultOperation.IsSuccess)
            {
                sysBpmsLURow   sysBpmsLU      = this.GetInfo(Id);
                sysBpmsLUTable sysBpmsLUTable = new LUTableService(base.UnitOfWork).GetInfo(sysBpmsLU.LUTableID);

                if (sysBpmsLUTable.Alias == sysBpmsLUTable.e_LUTable.DepartmentRoleLU.ToString() &&
                    new DepartmentMemberService(base.UnitOfWork).GetList(null, sysBpmsLU.CodeOf.ToIntObj(), null).Any())
                {
                    resultOperation.AddError($"this LookUp is used by Organization's members so you have to first delete that items first.");
                }
                if (resultOperation.IsSuccess)
                {
                    this.UnitOfWork.Repository <ILURowRepository>().Delete(Id);
                    this.UnitOfWork.Save();
                }
            }
            return(resultOperation);
        }
示例#7
0
 public void Add(sysBpmsLURow LURow)
 {
     LURow.ID = Guid.NewGuid();
     this.Context.sysBpmsLURows.Add(LURow);
 }
示例#8
0
 public void Update(sysBpmsLURow lurow)
 {
     this.Context.Entry(lurow).State = EntityState.Modified;
 }