Ejemplo n.º 1
0
 //Get the details of a particular Cover
 public CoverModel GetCoverData(long id)
 {
     try
     {
         CoverModel cover = doruDB.Cover.Find(id);
         return(cover);
     }
     catch
     {
         throw;
     }
 }
Ejemplo n.º 2
0
 //To Update the records of a particluar Cover
 public int UpdateCover(CoverModel cover)
 {
     try
     {
         doruDB.Entry(cover).State = EntityState.Modified;
         doruDB.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
Ejemplo n.º 3
0
 //To Add new Cover record
 public int AddCover(CoverModel cover)
 {
     try
     {
         doruDB.Cover.Add(cover);
         doruDB.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
Ejemplo n.º 4
0
 //To Delete the record of a particular Cover
 public int DeleteCover(long id)
 {
     try
     {
         CoverModel cover = doruDB.Cover.Find(id);
         doruDB.Cover.Remove(cover);
         doruDB.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }