Exemple #1
0
 public void SubmitForm(ModuleFormInstanceEntity entity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         entity.Modify(keyValue);
         service.Update(entity);
     }
     else
     {
         entity.Create();
         service.Insert(entity);
     }
 }
Exemple #2
0
 /// <summary>
 /// 保存一个实体
 /// </summary>
 /// <param name="keyValue"></param>
 /// <param name="entity"></param>
 /// <returns></returns>
 public int SaveEntity(string keyValue, ModuleFormInstanceEntity entity)
 {
     if (string.IsNullOrEmpty(keyValue))
     {
         entity.Create();
         return(this.BaseRepository().Insert(entity));
     }
     else
     {
         entity.Modify(keyValue);
         return(this.BaseRepository().Update(entity));
     }
 }