/// <summary> /// Получает или создает активный неподтвержденный заказ /// </summary> /// <returns></returns> public Order GetOrCreateCurrentOrder() { // Перебираем список заказов и ищем неподтвержденный var activeOrder = CreatedOrders.FirstOrDefault(o => o.Status == 0); if (activeOrder == null) { activeOrder = new Order() { Author = this, ManagerId = -1, DateCreated = DateTime.Now, CompanyId = this.CompanyId, ClientId = -1, Status = 0 }; CreatedOrders.Add(activeOrder); } return activeOrder; }
private void detach_ManagedOrders(Order entity) { this.SendPropertyChanging(); entity.Manager = null; }
private void attach_ManagedOrders(Order entity) { this.SendPropertyChanging(); entity.Manager = this; }
private void detach_CreatedOrders(Order entity) { this.SendPropertyChanging(); entity.Author = null; }
private void detach_Orders(Order entity) { this.SendPropertyChanging(); entity.Company = null; }
private void attach_Orders(Order entity) { this.SendPropertyChanging(); entity.Company = this; }