Ejemplo n.º 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));
                }
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 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;
     }
 }
Ejemplo n.º 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));
         }
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 7
0
 public void Add(sysBpmsLURow LURow)
 {
     LURow.ID = Guid.NewGuid();
     this.Context.sysBpmsLURows.Add(LURow);
 }
Ejemplo n.º 8
0
 public void Update(sysBpmsLURow lurow)
 {
     this.Context.Entry(lurow).State = EntityState.Modified;
 }