示例#1
0
        public FilingDataObject UpdateFiling(FilingDataObject filing)
        {
            Filing entity = this.filingRepository.FindByID(filing.ID);

            entity             = DyMapper.Map(filing, entity);
            entity.Involved    = this.filingRepository.Context.DoGet <Involved>(p => p.ID == filing.InvolvedID).FirstOrDefault();
            entity.SceneRecord = this.filingRepository.Context.DoGet <SceneRecord>(p => p.ID == filing.SceneRecordID).FirstOrDefault();
            entity.AskRecord   = this.filingRepository.Context.DoGet <AskRecord>(p => p.ID == filing.AskRecordID).FirstOrDefault();
            this.filingRepository.Update(entity);
            this.filingRepository.Commit();
            return(DyMapper.Map <Filing, FilingDataObject>(entity));
        }
示例#2
0
        public bool AddFiling(FilingDataObject filing)
        {
            Filing entity = this.filingRepository.Create();

            entity             = DyMapper.Map(filing, entity);
            entity.Involved    = this.filingRepository.Context.DoGet <Involved>(p => p.ID == filing.InvolvedID).FirstOrDefault();
            entity.SceneRecord = this.filingRepository.Context.DoGet <SceneRecord>(p => p.ID == filing.SceneRecordID).FirstOrDefault();
            entity.AskRecord   = this.filingRepository.Context.DoGet <AskRecord>(p => p.ID == filing.AskRecordID).FirstOrDefault();

            this.filingRepository.Add(entity);
            return(this.filingRepository.Commit() > 0);
        }
 public JsonResult <DyMessage> Add(FilingDataObject filing)
 {
     if (this.filingService.AddFiling(filing))
     {
         return(Json(new DyMessage()
         {
             Code = 2, Message = "立案成功!"
         }));
     }
     else
     {
         return(Json(new DyMessage()
         {
             Code = 0, Message = "立案失败!"
         }));
     }
 }
 public JsonResult <FilingDataObject> UpdateFiling(FilingDataObject filing)
 {
     return(Json(this.filingService.UpdateFiling(filing)));
 }