Exemplo n.º 1
0
 public void AddTypePromotion(ModelTypePromotions model)
 {
     using (var db = new DAL.BikeEntities())
     {
         db.TypePromotions.Add(MapToDB(model));
         db.SaveChanges();
     }
 }
Exemplo n.º 2
0
 public void AddBodyRent(ModelBodyRents model)
 {
     using (var db = new DAL.BikeEntities())
     {
         db.BodyRents.Add(MapToDB(model));
         db.SaveChanges();
     }
 }
Exemplo n.º 3
0
 public void DeleteTypePromotion(int id)
 {
     using (var db = new DAL.BikeEntities())
     {
         var aDelete = db.TypePromotions.Find(id);
         db.TypePromotions.Remove(aDelete);
         db.SaveChanges();
     }
 }
Exemplo n.º 4
0
 public void EditTypeRent(ModelTypeRents model)
 {
     using (var db = new DAL.BikeEntities())
     {
         var aEdit = db.TypeRents.Find(model.id);
         aEdit.name  = model.name;
         aEdit.price = model.price;
         db.SaveChanges();
     }
 }
Exemplo n.º 5
0
 public void EditTypePromotion(ModelTypePromotions model)
 {
     using (var db = new DAL.BikeEntities())
     {
         var aEdit = db.TypePromotions.Find(model.id);
         aEdit.name         = model.name;
         aEdit.discount     = model.discount;
         aEdit.quantity_min = model.quantity_min;
         aEdit.quantity_max = model.quantity_max;
         db.SaveChanges();
     }
 }
Exemplo n.º 6
0
 public void AddClient(ModelClients model)
 {
     try
     {
         using (var db = new DAL.BikeEntities())
         {
             db.Clients.Add(MapToDB(model));
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 7
0
 public void DeleteRent(int id)
 {
     try
     {
         using (var db = new DAL.BikeEntities())
         {
             var aDelet = db.Rents.Find(id);
             db.Rents.Remove(aDelet);
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 8
0
 public int AddRent(ModelRents model)
 {
     try
     {
         using (var db = new DAL.BikeEntities())
         {
             db.Rents.Add(MapToDB(model));
             db.SaveChanges();
             return(MapToApp(db.Set <DAL.Rents>().OrderByDescending(t => t.id).FirstOrDefault()).id);
         }
     }
     catch (Exception ex)
     {
         return(0);
     }
 }
Exemplo n.º 9
0
 public void EditClient(ModelClients model)
 {
     try
     {
         using (var db = new DAL.BikeEntities())
         {
             var aEdit = db.Clients.Find(model.id);
             aEdit.name      = model.name;
             aEdit.surname   = model.surname;
             aEdit.email     = model.email;
             aEdit.telephone = model.telephone;
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
     }
 }