public async Task <string> CreatePersonActivity(PersonActivity entity) { var query = @" INSERT INTO [PersonActivity] ([Id] ,[BiographyId] ,[DateCreated] ,[DateModified] ,[IsActive] ,[Activity] ,[ActivityType] ,[HasBegun] ,[DateBegin] ,[HasEnded] ,[DateEnd]) OUTPUT INSERTED.Id VALUES (@Id ,@BiographyId ,@DateCreated ,@DateModified ,@IsActive ,@Activity ,@ActivityType ,@HasBegun ,@DateBegin ,@HasEnded ,@DateEnd)"; return(await QueryFoD <string>(query, new DynamicParameters(entity))); }
public async Task <bool> SavePersonActivity(string personId, string bioId, PersonActivity newact) { var bio = await _mgrFcc.GetPersonBiographyByPersonId(personId); if (bio == null) { bioId = await _mgrFcc.SetPersonBiography(new PersonBiography() { Id = bioId, PersonId = personId, BiographyText = null }); } var dbRec = await _mgrFcc.GetPersonActivity(newact.Id); if (dbRec == null) { newact.Id = Guid.NewGuid().ToString(); newact.IsActive = true; newact.DateCreated = DateTime.Now; newact.BiographyId = bioId; newact.DateModified = DateTime.Now; return(!string.IsNullOrWhiteSpace(await _mgrFcc.SetPersonActivity(newact))); } dbRec.DateBegin = newact.DateBegin; dbRec.HasBegun = newact.HasBegun; dbRec.HasEnded = newact.HasEnded; dbRec.DateEnd = newact.DateEnd; dbRec.Activity = newact.Activity; dbRec.ActivityType = newact.ActivityType; dbRec.DateModified = DateTime.Now; return(await _mgrFcc.UpdatePersonActivity(dbRec)); }
public void Save(PersonActivity obj) { List <Expression <Func <PersonActivity, bool> > > conditions = new List <Expression <Func <PersonActivity, bool> > >(); conditions.Add(x => x._id == obj._id); context.ReplaceOne(conditions, obj); }
public void Save(PersonActivity data) { var release = repository.FindBy(data._id); if (release == null) { repository.Add(data); } else { repository.Save(data); } }
public async Task <bool> UpdatePersonActivity(PersonActivity entity) { var query = @" UPDATE [PersonActivity] SET [BiographyId] = @BiographyId ,[DateCreated] = @DateCreated ,[DateModified] = @DateModified ,[IsActive] = @IsActive ,[Activity] = @Activity ,[ActivityType] = @ActivityType ,[HasBegun] = @HasBegun ,[DateBegin] = @DateBegin ,[HasEnded] = @HasEnded ,[DateEnd] = @DateEnd WHERE Id = @Id"; return(await Execute(query, new DynamicParameters(entity)) > 0); }
public async Task <PartialViewResult> PersonActivityEdit(string activityId) { PersonActivity vm; if (!string.IsNullOrWhiteSpace(activityId)) { vm = await _vwbFcc.GetPersonActivity(activityId); } else { vm = new PersonActivity() { HasBegun = true, DateBegin = DateTime.Now } }; return(PartialView("Person/_PersonActivityEditBlock", vm)); }
private void SaveIntoRepository(PersonActivity personActivity) { ActivityDataService.Save(personActivity); }
private static void SaveIntoFile(string currentSprintActivityDataFile, PersonActivity personActivity) { var data = JsonConvert.SerializeObject(personActivity); File.WriteAllText(currentSprintActivityDataFile, data, Encoding.UTF8); }
public async Task SavePersonActivity(string personId, string bioId, PersonActivity newact) { await _vwbFcc.SavePersonActivity(personId, bioId, newact); }
public void Remove(PersonActivity obj) { throw new NotImplementedException(); }
public void Add(PersonActivity Obj) { context.Insert(Obj); }
public async Task <bool> UpdatePersonActivity(PersonActivity entity) { return(await _repo.UpdatePersonActivity(entity)); }
public async Task <string> SetPersonActivity(PersonActivity entity) { return(await _repo.CreatePersonActivity(entity)); }