예제 #1
0
 // Get rider detail by id
 public RiderDetails GetRiderDetail_ById(int id)
 {
     try
     {
         RiderDetails rider = db.RiderDetails.Find(id);
         return(rider);
     }
     catch
     {
         throw;
     }
 }
예제 #2
0
 // Update rifer
 public int EditRider(RiderDetails rider)
 {
     try
     {
         db.RiderDetails.Update(rider);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
예제 #3
0
        // Add rider

        public int AddRider(RiderDetails rider)
        {
            try
            {
                db.RiderDetails.Add(rider);
                db.SaveChanges();
                return(1);
            }
            catch
            {
                throw;
            }
        }
예제 #4
0
 // Delete rider
 public int DeleteRider(int id)
 {
     try
     {
         RiderDetails rider = new RiderDetails();
         rider = db.RiderDetails.Find(id);
         db.RiderDetails.Remove(rider);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }