public int InsertCTShipCar(CTShipCar sc) { CTShipCar ct = db.CTShipCars.SingleOrDefault(n => n.idshipcar == sc.idshipcar && n.idhd == sc.idhd); if (ct == null) { db.CTShipCars.InsertOnSubmit(sc); db.SubmitChanges(); return 1; } else { ct.idhd = sc.idhd; db.SubmitChanges(); return 2; } }
partial void DeleteCTShipCar(CTShipCar instance);
partial void UpdateCTShipCar(CTShipCar instance);
partial void InsertCTShipCar(CTShipCar instance);
private void detach_CTShipCars(CTShipCar entity) { this.SendPropertyChanging(); entity.ShipCar = null; }
private void attach_CTShipCars(CTShipCar entity) { this.SendPropertyChanging(); entity.ShipCar = this; }