public bool PostPackageByActivity(PackageByActivity PackageByActivity) { bool requiredField; requiredField = (PackageByActivity.PackageId == 0) ? true : false; requiredField = (PackageByActivity.ActivityId == 0)? true : false; return(requiredField); }
public async Task <ActionResult> UpdatePackageByActivity(int id, PackageByActivity PackageByActivity) { if (id != PackageByActivity.Id) { return(null); } dc.Entry(PackageByActivity).State = EntityState.Modified; var res = await dc.SaveChangesAsync(); return(new ObjectResult(res)); }
public async Task <IActionResult> AddPackageByActivity(PackageByActivity PackageByActivity) { var RequiredField = uow.PackageByActivityDomainService.PostPackageByActivity(PackageByActivity); if (!RequiredField) { dc.PackageByActivity.Add(PackageByActivity); await dc.SaveChangesAsync(); return(new ObjectResult(PackageByActivity)); } return(null); }