public IActionResult createhuibao(missionJournal_model model) { var response = ResponseModelFactory.CreateInstance; if (ConfigurationManager.AppSettings.IsTrialVersion) { response.SetIsTrial(); return(Ok(response)); } using (_dbContext) { var entity = new MissionJournal(); entity.MissionJournalUuid = Guid.NewGuid(); entity.MissionUuid = model.MissionUuid; //任务uuid entity.Completed = model.Completed; //已完成 entity.Coordination = model.Coordination; //需要协调 entity.IsDeleted = 0; entity.Accessory = model.Accessory; //附件 entity.EstablishTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //添加时间 entity.EstablishName = AuthContextService.CurrentUser.Guid.ToString(); //添加人姓名 _dbContext.MissionJournal.Add(entity); //添加 _dbContext.SaveChanges(); response = ResponseModelFactory.CreateInstance; return(Ok(response)); } }
public IActionResult appcreaterizhi(taskcaozuoCreateViewModel model) { var response = ResponseModelFactory.CreateInstance; if (ConfigurationManager.AppSettings.IsTrialVersion) { response.SetIsTrial(); return(Ok(response)); } using (_dbContext) { var entity = new MissionJournal(); entity.MissionJournalUuid = Guid.NewGuid(); entity.MissionUuid = Guid.Parse(model.MissionUUID.ToString()); //所属任务 entity.Content = model.Content; //日志内容 //if (model.Accessory != "" && model.Accessory != null) //{ // entity.Accessory = model.Accessory.Split('/')[3];//日志图片 //} //else //{ entity.Accessory = model.Accessory; //} entity.EstablishName = model.EstablishName; //创建人 entity.EstablishTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //创建时间 entity.Read = ""; //已读人员 _dbContext.MissionJournal.Add(entity); //添加 _dbContext.SaveChanges(); response = ResponseModelFactory.CreateInstance; return(Ok(response)); } }