public void Create(Tasadof t) { using (var db = new CarManagementDB()) { db.Tasadofat.Add(t); db.SaveChanges(); } }
public void Create(FanniOperationDetail t) { using (var db = new CarManagementDB()) { db.FanniOperationDetails.Add(t); db.SaveChanges(); } }
public void Create(Fuel t) { using (var db = new CarManagementDB()) { db.Fuels.Add(t); db.SaveChanges(); } }
public void Create(Driver t) { using (var db = new CarManagementDB()) { db.Drivers.Add(t); db.SaveChanges(); } }
public void Create(Mamoriat t) { using (var db = new CarManagementDB()) { db.Mamoriatha.Add(t); db.SaveChanges(); } }
public void Delete(int id) { using (var db = new CarManagementDB()) { var m = db.PersonalCars.Find(id); m.Deleted = true; db.SaveChanges(); } }
public void Delete(int id) { using (var db = new CarManagementDB()) { var f = db.FanniOperations.Find(id); db.FanniOperations.Remove(f); db.SaveChanges(); } }
public void Delete(int id) { using (var db = new CarManagementDB()) { var a = db.Tasadofat.Find(id); db.Tasadofat.Remove(a); db.SaveChanges(); } }
public void Delete(int id) { using (var db = new CarManagementDB()) { var m = db.Mamoriatha.Find(id); m.Deleted = true; db.SaveChanges(); } }
public void Create(PersonalCar t) { using (var db = new CarManagementDB()) { db.PersonalCars.Add(t); db.SaveChanges(); } }
public void DeleteByOperationId(int fId) { using (var db = new CarManagementDB()) { var op = db.FanniOperationDetails.Where(p => p.FanniOperationId == fId); db.FanniOperationDetails.RemoveRange(op); db.SaveChanges(); } }
public void Update(FanniOperation t) { using (var db = new CarManagementDB()) { var f = db.FanniOperations.Find(t.Id); f.CarId = t.CarId; f.Description = t.Description; f.Price = t.Price; f.Tarikh = t.Tarikh; db.SaveChanges(); } }
public void EndMamoriat(int id) { using (var db = new CarManagementDB()) { var m = db.PersonalCars.Find(id); if (m != null) { m.Finished = true; } db.SaveChanges(); } }
public void Update(Tasadof t) { using (var db = new CarManagementDB()) { var m = db.Tasadofat.Find(t.Id); m.CarId = t.CarId; m.DriverId = t.DriverId; m.Price = t.Price; m.Tarikh = t.Tarikh; db.SaveChanges(); } }
public void Update(Driver t) { using (var db = new CarManagementDB()) { var m = db.Drivers.Find(t.Id); m.CellPhone = t.CellPhone; m.MelliCode = t.MelliCode; m.Name = t.Name; db.SaveChanges(); } }
public void Update(Fuel t) { using (var db = new CarManagementDB()) { var a = db.Fuels.Find(t.Id); a.CarId = t.CarId; a.FactorNumber = t.FactorNumber; a.Kilometer = t.Kilometer; a.Mablagh = t.Mablagh; a.FuelTypeId = t.FuelTypeId; a.TarikhPardakht = t.TarikhPardakht; db.SaveChanges(); } }
public void Update(PersonalCar t) { using (var db = new CarManagementDB()) { var m = db.PersonalCars.Find(t.Id); m.CarId = t.CarId; m.DriverId = t.DriverId; m.KilometerBargasht = t.KilometerBargasht; m.KilometerRaft = t.KilometerRaft; m.Finished = t.Finished; m.ShomareNameh = t.ShomareNameh; m.TarikhBargasht = t.TarikhBargasht; m.TarikhRaft = t.TarikhRaft; db.SaveChanges(); } }
public void Update(Mamoriat t) { using (var db = new CarManagementDB()) { var m = db.Mamoriatha.Find(t.Id); m.Mabda = t.Mabda; m.CarId = t.CarId; m.DriverId = t.DriverId; m.Maghsad = t.Maghsad; m.ShomareNameh = t.ShomareNameh; m.TarikhBargasht = t.TarikhBargasht; m.TarikhRaft = t.TarikhRaft; m.KilometerBargasht = t.KilometerBargasht; m.KilometerRaft = t.KilometerRaft; m.Finished = t.Finished; m.ZamanBargasht = t.ZamanBargasht; m.ZamanRaft = t.ZamanRaft; db.SaveChanges(); } }