public static Crowd ConvertCrowdDTOCToDAL(CrowdDTO crowd) { return(new Crowd { nameCrowd = crowd.nameCrowd }); }
public static bool addCrowd(CrowdDTO c) { using (libraryEntities db = new libraryEntities()) { db.Crowds.Add(Converters.CrowdConverter.ConvertCrowdDTOCToDAL(c)); try { db.SaveChanges(); return(true); } catch (Exception e) { return(false); } } }
public static bool updateCrowd(CrowdDTO a) { using (libraryEntities db = new libraryEntities()) { Crowd b = db.Crowds.First(x => x.codeCrowd == a.codeCrowd); b.nameCrowd = a.nameCrowd; try { db.SaveChanges(); return(true); } catch (Exception e) { return(false); } } }
public IHttpActionResult UpdateCrowd(CrowdDTO crowd) { return(Ok(BL.crowdBL.updateCrowd(crowd))); }
public IHttpActionResult AddCrowd(CrowdDTO crowd) { return(Ok(BL.crowdBL.addCrowd(crowd))); }