protected override void OnAddCommand() { var newCooler = new Cooler(); var newDevice = new Device(); newCooler.Device = newDevice; this.Context.Coolers.Add(newCooler); this.CoolersView.MoveCurrentTo(newCooler); }
private bool FilterCooler(Cooler entity) { return (entity.Id == this.CoolerId); }
private bool FilterCoolers(Cooler entity) { return (entity.DeviceTypeId == this.Id); }
private void DetachCoolers(Cooler entity) { entity.DeviceType = null; }
private void AttachCoolers(Cooler entity) { entity.DeviceType = this; }
/// <summary> /// Deprecated Method for adding a new object to the Coolers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCoolers(Cooler cooler) { base.AddObject("Coolers", cooler); }
/// <summary> /// Create a new Cooler object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="rotation">Initial value of the Rotation property.</param> /// <param name="size">Initial value of the Size property.</param> /// <param name="deviceTypeId">Initial value of the DeviceTypeId property.</param> /// <param name="deviceId">Initial value of the DeviceId property.</param> public static Cooler CreateCooler(global::System.Int32 id, global::System.Int16 rotation, global::System.Int16 size, global::System.Int32 deviceTypeId, global::System.Int32 deviceId) { Cooler cooler = new Cooler(); cooler.Id = id; cooler.Rotation = rotation; cooler.Size = size; cooler.DeviceTypeId = deviceTypeId; cooler.DeviceId = deviceId; return cooler; }