public CarEditView(Car car, FuelTrackerContext context) : this() { //CarEditViewModel carEditViewModel = new CarEditViewModel( car.Id); //CarEditViewModel carEditViewModel = new CarEditViewModel(context, car); //this.DataContext = carEditViewModel; }
public CarEditViewModel(Car car, ICarDataService carDataService , IEnumerable<UserProfile> userProfiles ) : this(carDataService , userProfiles) { if (car == null) { throw new ArgumentNullException("car must not be null"); } this.Car = car; }
private Car GenerateNewDesignOrganizaiton(int id) { int i = id; var organizaiton = new Car { Engine = string.Format("Engine {0:5}", i), EngineVolume = i, //FuelTracks = null,//TO DO: Update design model assignment of property FuelTracks on Car Id = i, Manufacturer = string.Format("Manufacturer {0:5}", i), ManufacturingDate = DateTime.Now.AddDays(i), Model = string.Format("Model {0:5}", i), Name = string.Format("Name {0:5}", i), Types = string.Format("Types {0:5}", i), //UserProfile = null,//TO DO: Update design model assignment of property UserProfile on Car UserProfileId = i, }; return organizaiton; }
private void NewCar() { Car = new Car(); CanSaveCar = true; }
public void Save(Car car, Action<System.ServiceModel.DomainServices.Client.SubmitOperation> submitCallback, object state) { submitCallback(null); }
public UpdatedCarMessage(FuelTracker.Web.Car car) { this.Car = car; }
public void Save(Car car, Action<SubmitOperation> submitCallback, object state) { Context.Cars.Add(car); if (Context.HasChanges) { Context.SubmitChanges(submitCallback, state); } }
private bool FilterCars(Car entity) { return (entity.UserProfileId == this.Id); }
private bool FilterCar(Car entity) { return (entity.Id == this.CarId); }
private void DetachCars(Car entity) { entity.UserProfile = null; }
private void AttachCars(Car entity) { entity.UserProfile = this; }
public LaunchEditCarMessage(FuelTracker.Web.Car car) { this.Car = car; }
/// <summary> /// Create a new Car object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="engineVolume">Initial value of the EngineVolume property.</param> /// <param name="manufacturingDate">Initial value of the ManufacturingDate property.</param> /// <param name="userProfileId">Initial value of the UserProfileId property.</param> public static Car CreateCar(global::System.Int32 id, global::System.Double engineVolume, global::System.DateTime manufacturingDate, global::System.Int32 userProfileId) { Car car = new Car(); car.Id = id; car.EngineVolume = engineVolume; car.ManufacturingDate = manufacturingDate; car.UserProfileId = userProfileId; return car; }
/// <summary> /// Deprecated Method for adding a new object to the Cars EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCars(Car car) { base.AddObject("Cars", car); }