Example #1
0
 private void TechViewAutoDataGrid_RowEditEnding(object sender, DataGridRowEditEndingEventArgs e)
 {
     if (e.EditAction == DataGridEditAction.Commit)
     {
         TechnicalInspections newItem = e.Row.DataContext as TechnicalInspections;
         newItem.AutoID = Data.IdAuto;
         new DAO().AddTechnical(newItem);
     }
 }
Example #2
0
File: DAO.cs Project: SaviN13/Gibdd
 public void AddTechnical(TechnicalInspections tech)
 {
     using (DBContext db = new DBContext())
     {
         db.TechnicalInspections.Add(new TechnicalInspections
         {
             AutoID     = tech.AutoID,
             DateSee    = tech.DateSee,
             Distance   = tech.Distance,
             Inspector  = tech.Inspector,
             Okey       = tech.Okey,
             Reason     = tech.Reason,
             Work       = tech.Work,
             YearNumber = tech.YearNumber
         });
         db.SaveChanges();
     }
 }