Example #1
0
 /// <summary>
 /// 保存表头实体数据(新增、修改)
 /// <param name="keyValue">主键</param>
 /// <summary>
 /// <returns></returns>
 public void SaveGant(string keyValue, LR_OA_ProjectEntity entity)
 {
     try
     {
         if (!string.IsNullOrEmpty(keyValue))
         {
             entity.Modify(keyValue);
             this.BaseRepository().Update(entity);
         }
         else
         {
             entity.Create();
             this.BaseRepository().Insert(entity);
         }
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }
Example #2
0
        /// <summary>
        /// 保存实体数据(新增、修改)
        /// <param name="keyValue">主键</param>
        /// <summary>
        /// <returns></returns>
        public void SaveEntity(string keyValue, LR_OA_ProjectEntity entity, List <LR_OA_ProjectDetailEntity> lR_OA_ProjectDetailList)
        {
            var db = this.BaseRepository().BeginTrans();

            try
            {
                if (!string.IsNullOrEmpty(keyValue))
                {
                    var lR_OA_ProjectEntityTmp = GetLR_OA_ProjectEntity(keyValue);
                    entity.Modify(keyValue);
                    db.Update(entity);
                    db.Delete <LR_OA_ProjectDetailEntity>(t => t.F_ParentId == lR_OA_ProjectEntityTmp.F_Id);
                    foreach (LR_OA_ProjectDetailEntity item in lR_OA_ProjectDetailList)
                    {
                        item.Create();
                        item.F_ParentId = lR_OA_ProjectEntityTmp.F_Id;
                        db.Insert(item);
                    }
                }
                else
                {
                    entity.Create();
                    db.Insert(entity);
                    foreach (LR_OA_ProjectDetailEntity item in lR_OA_ProjectDetailList)
                    {
                        item.Create();
                        item.F_ParentId = entity.F_Id;
                        db.Insert(item);
                    }
                }
                db.Commit();
            }
            catch (Exception ex)
            {
                db.Rollback();
                if (ex is ExceptionEx)
                {
                    throw;
                }
                else
                {
                    throw ExceptionEx.ThrowServiceException(ex);
                }
            }
        }
Example #3
0
 /// <summary>
 /// 保存表头实体数据(新增、修改)
 /// <param name="keyValue">主键</param>
 /// <summary>
 /// <returns></returns>
 public void SaveGant(string keyValue, LR_OA_ProjectEntity entity)
 {
     try
     {
         gantProjectService.SaveGant(keyValue, entity);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowBusinessException(ex);
         }
     }
 }
Example #4
0
 /// <summary>
 /// 保存实体数据(新增、修改)
 /// <param name="keyValue">主键</param>
 /// <summary>
 /// <returns></returns>
 public void SaveEntity(string keyValue, LR_OA_ProjectEntity entity, List <LR_OA_ProjectDetailEntity> lR_OA_ProjectDetailList)
 {
     try
     {
         gantProjectService.SaveEntity(keyValue, entity, lR_OA_ProjectDetailList);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowBusinessException(ex);
         }
     }
 }