예제 #1
0
 public static int DeleteLocation(Location location)
 {
     try
     {
         using (ProjectDBContextCF projectDBEntity = new ProjectDBContextCF())
         {
             projectDBEntity.Entry(location).State = EntityState.Deleted;
             return(projectDBEntity.SaveChanges());
         }
     }
     catch (Exception ex)
     {
         //FileOperations.FoutLoggen(ex);
         return(0);
     }
 }
예제 #2
0
 public static int AddLocation(Location location)
 {
     try
     {
         using (ProjectDBContextCF projectDBEntity = new ProjectDBContextCF())
         {
             projectDBEntity.Locations.Add(location);
             return(projectDBEntity.SaveChanges());
         }
     }
     catch (Exception ex)
     {
         //FileOperations.FoutLoggen(ex);
         return(0);
     }
 }