protected void OnNewOrderClicked(OrderTypeClass ordertyp) { EventHandler <NewOrderEventArgs> handler = NewOrderClicked; if (handler != null) { NewOrderEventArgs e = new NewOrderEventArgs(); e.OrderType = ordertyp; handler(this, e); } }
public OrderDlg(ushort pointNumber, ushort calendarNumber, OrderTypeClass Type, DateTime date, ushort hour) { this.Build(); UoWGeneric = UnitOfWorkFactory.CreateWithNewRoot <WorkOrder>(); Entity.OrderTypeClass = Type; Entity.Date = date; Entity.Hour = hour; Entity.PointNumber = pointNumber; Entity.CalendarNumber = calendarNumber; Entity.CreatedBy = UserRepository.GetCurrentUser(UoW); ConfigureDlg(); }
public void Fill(int id) { NewItem = false; service = UoW.Session.QueryOver <Service>().List().FirstOrDefault(x => x.Id == id); logger.Info("Запрос услуги №{0}...", id); labelID.Text = service.Id.ToString(); entryName.Text = service.Name; if (service.ListServiceOrderType.Count > 0) { OrderTypeClass orderTypeClass = service.ListServiceOrderType.First().OrderTypeClass; comboboxOrderType.SelectedItem = orderTypeClass; } spinPrice.Value = double.Parse(service.Price.ToString()); logger.Info("Ok"); this.Title = entryName.Text; TestCanSave(); }
private void Fill(int id) { ItemId = id; NewItem = false; logger.Info("Запрос типа заказов №{0}...", id); Entity = UoW.GetById <OrderTypeClass>(ItemId); var l = UoW.GetAll <ServiceOrderType>() .Where(x => x.OrderTypeClass.Id == ItemId) .ToList(); foreach (var ser in l) { listService.Add(UoW.Session.QueryOver <Service>().List().First(x => x == ser.Service)); } entryNumberOrder.Text = Entity.Id.ToString(); entryNameOrder.Text = Entity.Name; checkbuttonCalculationSalary.Active = Entity.IsCalculateSalary; if (Entity.PositionInTabs == null) { Entity.PositionInTabs = ""; } checkbuttonInstallationSuburban.Active = Entity.PositionInTabs.Contains(checkbuttonInstallationSuburban.Label); checkbuttonSuburbanTinting.Active = Entity.PositionInTabs.Contains(checkbuttonSuburbanTinting.Label); checkbuttonOrder.Active = Entity.PositionInTabs.Contains(checkbuttonOrder.Label); checkbuttonTintedEntry.Active = Entity.PositionInTabs.Contains(checkbuttonTintedEntry.Label); checkbuttonInstall.Active = Entity.IsInstallType; checkbuttonOther.Active = Entity.IsOtherType; checkbuttonMainParameters.Active = Entity.IsShowMainWidgets; checkbuttonAdditionalParameters.Active = Entity.IsShowAdditionalWidgets; logger.Info("Ok"); this.Title = $"Редактирование типа заказа: \"{Entity.Name}\" "; createTable(); TestCanSave(); }
private string GetTitleFormat(OrderTypeClass type) { string str = "Тип заказа \'" + type.Name + "\' №{0} на {1:D} в {2} часов"; return(str); }
public static IList <OrderState> GetStates(IUnitOfWork uow, OrderTypeClass orderType) { return(uow.Session.QueryOver <OrderState>() .Where(x => x.UsedForTypesPlainText.IsLike(orderType.Id.ToString(), MatchMode.Anywhere)) .List()); }