Esempio n. 1
0
        public async Task <TData <string> > SaveForm(PartsEntity entity)
        {
            TData <string> obj = new TData <string>();
            await partsService.SaveForm(entity);

            obj.Data = entity.Id.ParseToString();
            obj.Tag  = 1;
            return(obj);
        }
Esempio n. 2
0
 public void SubmitForm(PartsEntity partsEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         partsEntity.Modify(keyValue);
         service.Update(partsEntity);
     }
     else
     {
         partsEntity.Create();
         service.Insert(partsEntity);
     }
 }
 public bool Delete(int id)
 {
     using (UnitOfWork unitOfWork = new UnitOfWork())
     {
         PartsEntity res = unitOfWork.PartsRepository.GetById(id);
         if (res == null)
         {
             return(false);
         }
         unitOfWork.PartsRepository.Delete(res);
         return(unitOfWork.Save());
     }
 }
Esempio n. 4
0
        public async Task SaveForm(PartsEntity entity)
        {
            if (entity.Id.IsNullOrZero())
            {
                await entity.Create();

                await this.BaseRepository().Insert(entity);
            }
            else
            {
                await entity.Modify();

                await this.BaseRepository().Update(entity);
            }
        }
Esempio n. 5
0
        public async Task <ActionResult> SaveFormJson(PartsEntity entity)
        {
            TData <string> obj = await partsBLL.SaveForm(entity);

            return(Json(obj));
        }
Esempio n. 6
0
 public ActionResult SubmitForm(PartsEntity partsEntity, string keyValue)
 {
     partsApp.SubmitForm(partsEntity, keyValue);
     return(Success("操作成功。"));
 }