/*private Window mHotkeyWindow; private void btnHotkeys_Click(object sender, RoutedEventArgs e) { if(mHotkeyWindow != null) { mHotkeyWindow.Activate(); return; } mHotkeyWindow = new Window(); mHotkeyWindow.Content = new HotkeyListControl(); mHotkeyWindow.SizeToContent = SizeToContent.WidthAndHeight; mHotkeyWindow.ResizeMode = ResizeMode.NoResize; mHotkeyWindow.Icon = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"/Images/FamilyFeudIcon.png", UriKind.RelativeOrAbsolute)); mHotkeyWindow.Title = "Family Feud"; mHotkeyWindow.Closed += (send, args) => { mHotkeyWindow = null; }; mHotkeyWindow.Show(); }*/ private void btnGetBonusSheet_Click(object sender, RoutedEventArgs e) { if(currentGame != null) { ImagePrinter.DownloadBonusRoundImage(currentGame.BonusRound); } }
public string PrintImage(string fileName) { var filePath = Path.Combine(AppConfig.ImageLibraryFolder, fileName); var imagePrinter = new ImagePrinter(filePath); imagePrinter.PrintImage(); return filePath; }
public PrinterActivityViewerViewModelFactory( IViewModelNavigator navigator, PrinterMessageProvider printerMessageProvider, SettingsProvider settingsProvider, ImagePrinter imagePrinter) { _printerActivityViewModel = new Lazy <PrinterActivityViewerViewModel>(() => new PrinterActivityViewerViewModel(navigator, printerMessageProvider, imagePrinter, settingsProvider)); }
public CameraResultViewModelFactory( IViewModelNavigator navigator, ImagePrinter printer, SettingsProvider settingsProvider, ImageService imageService) { _navigator = navigator; _printer = printer; _settingsProvider = settingsProvider; _imageService = imageService; }
public CurrentSessionViewModelFactory( IViewModelNavigator navigator, SessionService sessionService, ImagePrinter printer, SettingsProvider settings ) { _navigator = navigator; _sessionService = sessionService; _printer = printer; _settings = settings; }
private void btnPrint_Click(object sender, EventArgs e) { if (rbImage.Checked) { ImagePrinter imagePrinter = new ImagePrinter(Convert.ToInt32(txtHeight.Text), Convert.ToInt32(txtWidth.Text)); Status(imagePrinter); } else if (rbtext.Checked) { TextPrinter textPrinter = new TextPrinter(Convert.ToInt32(txtHeight.Text), Convert.ToInt32(txtWidth.Text)); Status(textPrinter); } }
public AppSettingsExplorerViewModelFactory( SettingsProvider settingsProvider, IViewModelNavigator navigator, IMappingEngine mappingEngine, SchedulerService schedulerService, ImagePrinter imagePrinter) { _settingsProvider = settingsProvider; _navigator = navigator; _mappingEngine = mappingEngine; _schedulerService = schedulerService; _imagePrinter = imagePrinter; }
//public Hour DateEnd //{ // get { return new Hour(_dateEnd);; } // set // { // if (value == null) // { // _dateEnd = TimeSpan.Zero; // return; // } // _dateEnd = value.GetCurrentTime(); // RaisePropertyChanged(); // } //} #endregion public AppSettingsExplorerViewModel( IViewModelNavigator navigator, SettingsProvider settingsProvider, IMappingEngine mappingEngine, SchedulerService schedulerService, ImagePrinter imagePrinter) { _navigator = navigator; _settingsProvider = settingsProvider; _mappingEngine = mappingEngine; _schedulerService = schedulerService; _imagePrinter = imagePrinter; _maxAvailableCopies = 255; }
public void Print_AnyState_PdfDocOnExit() { var printer = new ImagePrinter(); const string filePath = @"C:\Users\phantomer\Documents\Visual Studio 2013\Projects\ImageMaker\Test\5_ozer.png"; byte[] fileContent = new byte[0]; if (File.Exists(filePath)) { fileContent = File.ReadAllBytes(filePath); } printer.Print(fileContent); }
public MessageAdapter( IMappingEngine mappingEngine, QueueUtilizerFactory queueUtilizerFactory, ImagePrinter imagePrinter, ImageService imageService, PatternViewModelProvider patternViewModelProvider, ImageUtils imageUtils) { _mappingEngine = mappingEngine; _queueUtilizer = queueUtilizerFactory.CreateQueue <InstagramMessageDto>(); _imagePrinter = imagePrinter; _imageService = imageService; _patternVmProvider = patternViewModelProvider; _imageUtils = imageUtils; }
public InstagramExplorerViewModelFactory( IViewModelNavigator navigator, InstagramExplorer instagramExplorer, SettingsProvider settings, ImagePrinter printer, PatternViewModelProvider patternVMProvider, ImageUtils imageUtils, IMappingEngine mappingEngine) { _navigator = navigator; _instagramExplorer = instagramExplorer; _settings = settings; _printer = printer; _patternVmProvider = patternVMProvider; _imageUtils = imageUtils; _mappingEngine = mappingEngine; }
public CurrentSessionViewModel( IViewModelNavigator navigator, SessionService sessionService, ImagePrinter printer, SettingsProvider settings ) { _navigator = navigator; _sessionService = sessionService; _printer = printer; AppSettingsDto appSettings = settings.GetAppSettings(); if (appSettings != null) { _printerName = appSettings.PrinterName; } }
public PrinterActivityViewerViewModel( IViewModelNavigator navigator, PrinterMessageProvider messageProvider, ImagePrinter imagePrinter, SettingsProvider settingsProvider ) { _navigator = navigator; _messageProvider = messageProvider; _imagePrinter = imagePrinter; _copiesCount = 1; AppSettingsDto appSettings = settingsProvider.GetAppSettings(); if (appSettings != null) { HashTag = appSettings.HashTag; _printerName = appSettings.PrinterName; } }
public CameraResultViewModel( IViewModelNavigator navigator, ImagePrinter printer, SettingsProvider settingsProvider, ImageService imageService, CompositionProcessingResult result) { _navigator = navigator; _printer = printer; _imageService = imageService; Image = result.ImageResult; _copiesCount = 1; var appSettings = settingsProvider.GetAppSettings(); if (appSettings != null) { _maxCopies = appSettings.MaxPrinterCopies; _printerName = appSettings.PrinterName; } }
public Form1() { InitializeComponent(); headCatalog = new MonsterCatalog(inputFile); bodyCatalog = new MonsterCatalog(inputFile); legCatalog = new MonsterCatalog(inputFile); headTypes = headCatalog.MonsterList; bodyTypes = bodyCatalog.MonsterList; legTypes = legCatalog.MonsterList; cb_Head.DataSource = headTypes; cb_Head.DisplayMember = "Type"; cb_Body.DataSource = bodyTypes; cb_Body.DisplayMember = "Type"; cb_Leg.DataSource = legTypes; cb_Leg.DisplayMember = "Type"; printer = new ImagePrinter(cb_Head, cb_Body, cb_Leg, pictureBox1, pictureBox2, pictureBox3); }
public InstagramExplorerViewModel( IViewModelNavigator navigator, InstagramExplorer instagramExplorer, SettingsProvider settings, ImagePrinter printer, PatternViewModelProvider patternVMProvider, ImageUtils imageUtils, IMappingEngine mappingEngine) { _navigator = navigator; _printer = printer; _patternVmProvider = patternVMProvider; _imageUtils = imageUtils; _mappingEngine = mappingEngine; _instagramExplorer = instagramExplorer; AppSettingsDto appSettings = settings.GetAppSettings(); if (appSettings != null) { _printerName = appSettings.PrinterName; } IsHashTag = true; SearchAsyncOperation = new NotifyTaskCompletion <ImageResponse>(Task.FromResult(default(ImageResponse))); _searchTokenSource = new CancellationTokenSource(); }
public void CreateApplicationConfig() { logger.Debug("Конфигурация маппингов диалогов, HistoryTrace, принтеров и ParentReference..."); #region Dialogs mapping OrmMain.ClassMappingList = new List <IOrmObjectMapping> { //Простые справочники OrmObjectMapping <CullingCategory> .Create().DefaultTableView().SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <Nationality> .Create().DefaultTableView().SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <Citizenship> .Create().DefaultTableView().SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <Manufacturer> .Create().DefaultTableView().SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <EquipmentColors> .Create().DefaultTableView().SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <User> .Create().DefaultTableView().SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <UserSettings> .Create().Dialog <UserSettingsView>(), OrmObjectMapping <FuelType> .Create().Dialog <FuelTypeViewModel>().DefaultTableView() .SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <MovementWagon> .Create().Dialog <MovementWagonViewModel>().DefaultTableView() .SearchColumn("Название", x => x.Name).End(), //Остальные справочники OrmObjectMapping <CarProxyDocument> .Create().Dialog <CarProxyDlg>(), OrmObjectMapping <M2ProxyDocument> .Create().Dialog <M2ProxyDlg>(), OrmObjectMapping <ProductGroup> .Create().Dialog <ProductGroupDlg>(), OrmObjectMapping <CommentTemplate> .Create().Dialog <CommentTemplateDlg>().DefaultTableView() .SearchColumn("Шаблон комментария", x => x.Comment).End(), OrmObjectMapping <FineTemplate> .Create().Dialog <FineTemplateDlg>().DefaultTableView() .SearchColumn("Шаблон комментария", x => x.Reason).End(), OrmObjectMapping <MeasurementUnits> .Create().Dialog <MeasurementUnitsDlg>().DefaultTableView() .SearchColumn("ОКЕИ", x => x.OKEI).SearchColumn("Название", x => x.Name).Column("Точность", x => x.Digits.ToString()) .End(), OrmObjectMapping <Contact> .Create().Dialog <ContactDlg>() .DefaultTableView().SearchColumn("Фамилия", x => x.Surname).SearchColumn("Имя", x => x.Name) .SearchColumn("Отчество", x => x.Patronymic).End(), OrmObjectMapping <Order> .Create().Dialog <OrderDlg>().PopupMenu(OrderPopupMenu.GetPopupMenu), OrmObjectMapping <UndeliveredOrder> .Create().Dialog <UndeliveredOrderDlg>(), OrmObjectMapping <Organization> .Create().Dialog <OrganizationDlg>().DefaultTableView().Column("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <DeliverySchedule> .Create().Dialog <DeliveryScheduleDlg>().DefaultTableView() .SearchColumn("Название", x => x.Name) .SearchColumn("Время доставки", x => x.DeliveryTime) .Column("Архивный?", x => x.IsArchive ? "Да" : string.Empty) .OrderAsc(x => x.IsArchive).OrderAsc(x => x.From).OrderAsc(x => x.To) .End(), OrmObjectMapping <ProductSpecification> .Create().Dialog <ProductSpecificationDlg>().DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()).SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <EquipmentKind> .Create().Dialog <EquipmentKindDlg>().DefaultTableView() .Column("Название", equipmentKind => equipmentKind.Name).End(), //Связанное с клиентом OrmObjectMapping <Proxy> .Create().Dialog <ProxyDlg>() .DefaultTableView().SearchColumn("Номер", x => x.Number).SearchColumn("С", x => x.StartDate.ToShortDateString()) .SearchColumn("По", x => x.ExpirationDate.ToShortDateString()).End(), OrmObjectMapping <PaidRentPackage> .Create().Dialog <PaidRentPackageDlg>() .DefaultTableView().SearchColumn("Название", x => x.Name).Column("Вид оборудования", x => x.EquipmentKind.Name) .SearchColumn("Цена в сутки", x => CurrencyWorks.GetShortCurrencyString(x.PriceDaily)) .SearchColumn("Цена в месяц", x => CurrencyWorks.GetShortCurrencyString(x.PriceMonthly)).End(), OrmObjectMapping <FreeRentPackage> .Create().Dialog <FreeRentPackageDlg>().DefaultTableView() .SearchColumn("Название", x => x.Name).Column("Вид оборудования", x => x.EquipmentKind.Name).OrderAsc(x => x.Name) .End(), OrmObjectMapping <Counterparty> .Create().Dialog <CounterpartyDlg>().DefaultTableView() .SearchColumn("Название", x => x.FullName).End(), OrmObjectMapping <Tag> .Create().Dialog <TagDlg>().DefaultTableView().SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <CounterpartyContract> .Create().Dialog <CounterpartyContractDlg>(), OrmObjectMapping <DocTemplate> .Create().Dialog <DocTemplateDlg>().DefaultTableView().SearchColumn("Название", x => x.Name) .Column("Тип", x => x.TemplateType.GetEnumTitle()).End(), OrmObjectMapping <TransferOperationDocument> .Create().Dialog <TransferOperationDocumentDlg>(), //Справочники с фильтрами OrmObjectMapping <Equipment> .Create().Dialog <EquipmentDlg>().JournalFilter <EquipmentFilter>() .DefaultTableView().Column("Код", x => x.Id.ToString()).SearchColumn("Номенклатура", x => x.NomenclatureName) .Column("Тип", x => x.Nomenclature.Kind.Name).SearchColumn("Серийный номер", x => x.Serial) .Column("Дата последней обработки", x => x.LastServiceDate.ToShortDateString()).End(), //Логисткика OrmObjectMapping <RouteList> .Create().Dialog <RouteListCreateDlg>() .DefaultTableView().SearchColumn("Номер", x => x.Id.ToString()).Column("Дата", x => x.Date.ToShortDateString()) .Column("Статус", x => x.Status.GetEnumTitle()) .SearchColumn("Водитель", x => String.Format("{0} - {1}", x.Driver.FullName, x.Car.Title)).End(), OrmObjectMapping <RouteColumn> .Create().DefaultTableView().Column("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <DeliveryShift> .Create().Dialog <DeliveryShiftDlg>().DefaultTableView().SearchColumn("Название", x => x.Name) .SearchColumn("Диапазон времени", x => x.DeliveryTime).End(), OrmObjectMapping <DeliveryDaySchedule> .Create().Dialog <DeliveryDayScheduleDlg>().DefaultTableView() .SearchColumn("Название", x => x.Name).End(), //Сервис OrmObjectMapping <ServiceClaim> .Create().Dialog <ServiceClaimDlg>().DefaultTableView().Column("Номер", x => x.Id.ToString()) .Column("Тип", x => x.ServiceClaimType.GetEnumTitle()).Column("Оборудование", x => x.Equipment.Title) .Column("Подмена", x => x.ReplacementEquipment != null ? "Да" : "Нет") .Column("Точка доставки", x => x.DeliveryPoint.Title).End(), //Касса OrmObjectMapping <Income> .Create().Dialog <CashIncomeDlg>(), OrmObjectMapping <ExpenseCategory> .Create().Dialog <ExpenseCategoryViewModel>().DefaultTableView() .Column("Код", x => x.Id.ToString()).SearchColumn("Название", e => e.Name) .Column("Тип документа", e => e.ExpenseDocumentType.GetEnumTitle()) .TreeConfig(new RecursiveTreeConfig <ExpenseCategory>(x => x.Parent, x => x.Childs)).End(), OrmObjectMapping <Expense> .Create().Dialog <CashExpenseDlg>(), OrmObjectMapping <AdvanceReport> .Create().Dialog <AdvanceReportDlg>(), OrmObjectMapping <Fine> .Create().Dialog <FineDlg>(), OrmObjectMapping <IncomeCashTransferDocument> .Create().Dialog <IncomeCashTransferDlg>(), OrmObjectMapping <CommonCashTransferDocument> .Create().Dialog <CommonCashTransferDlg>(), //Банкинг OrmObjectMapping <AccountIncome> .Create(), OrmObjectMapping <AccountExpense> .Create(), //Склад OrmObjectMapping <Warehouse> .Create().Dialog <WarehouseDlg>().DefaultTableView().Column("Название", w => w.Name) .Column("В архиве", w => w.IsArchive ? "Да" : "").End(), OrmObjectMapping <RegradingOfGoodsTemplate> .Create().Dialog <RegradingOfGoodsTemplateDlg>().DefaultTableView() .Column("Название", w => w.Name).End(), OrmObjectMapping <CarEventType> .Create().Dialog <CarEventTypeViewModel>() }; #region Складские документы OrmMain.AddObjectDescription <IncomingWater>().Dialog <IncomingWaterDlg>(); OrmMain.AddObjectDescription <WriteoffDocument>().Dialog <WriteoffDocumentDlg>(); OrmMain.AddObjectDescription <InventoryDocument>().Dialog <InventoryDocumentDlg>(); OrmMain.AddObjectDescription <ShiftChangeWarehouseDocument>().Dialog <ShiftChangeWarehouseDocumentDlg>(); OrmMain.AddObjectDescription <RegradingOfGoodsDocument>().Dialog <RegradingOfGoodsDocumentDlg>(); OrmMain.AddObjectDescription <SelfDeliveryDocument>().Dialog <SelfDeliveryDocumentDlg>(); OrmMain.AddObjectDescription <CarLoadDocument>().Dialog <CarLoadDocumentDlg>(); OrmMain.AddObjectDescription <CarUnloadDocument>().Dialog <CarUnloadDocumentDlg>(); #endregion #region Goods OrmMain.AddObjectDescription <Nomenclature>().Dialog <NomenclatureDlg>().JournalFilter <NomenclatureFilter>().DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .Column("Тип", x => x.CategoryString) .SearchColumn("Номер в ИМ", x => x.OnlineStoreExternalId) .End(); OrmMain.AddObjectDescription <Folder1c>().Dialog <Folder1cDlg>() .DefaultTableView() .SearchColumn("Код 1С", x => x.Code1c) .SearchColumn("Название", x => x.Name) .TreeConfig(new RecursiveTreeConfig <Folder1c>(x => x.Parent, x => x.Childs)).End(); #endregion #region Простые справочники OrmMain.AddObjectDescription <GeographicGroup>() .Dialog <GeographicGroupDlg>() .DefaultTableView() .SearchColumn("Название", x => x.Name) .Column("Код", x => x.Id.ToString()) .End(); OrmMain.AddObjectDescription <NonReturnReason>() .DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .End(); OrmMain.AddObjectDescription <PaymentFrom>() .DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .End(); OrmMain.AddObjectDescription <Post>() .DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .End(); OrmMain.AddObjectDescription <SalesChannel>() .DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .End(); #endregion #region неПростые справочники OrmMain.AddObjectDescription <Subdivision>().Dialog <SubdivisionDlg>().DefaultTableView().SearchColumn("Название", x => x.Name) .Column("Руководитель", x => x.Chief == null ? "" : x.Chief.ShortName).SearchColumn("Номер", x => x.Id.ToString()) .TreeConfig(new RecursiveTreeConfig <Subdivision>(x => x.ParentSubdivision, x => x.ChildSubdivisions)).End(); OrmMain.AddObjectDescription <TypeOfEntity>() .Dialog <TypeOfEntityDlg>() .DefaultTableView() .SearchColumn("Тип документа", x => TypeOfEntityRepository.GetEntityNameByString(x.Type)) .SearchColumn("Название документа", x => x.CustomName) .SearchColumn("Код", x => x.Id.ToString()) .Column("Активно", x => !x.IsActive ? "нет" : String.Empty) .SearchColumn("Имя класса", x => x.Type) .OrderAsc(x => x.CustomName) .End(); OrmMain.AddObjectDescription <Trainee>().Dialog <TraineeDlg>().DefaultTableView() .Column("Код", x => x.Id.ToString()) .SearchColumn("Ф.И.О.", x => x.FullName) .OrderAsc(x => x.LastName).OrderAsc(x => x.Name).OrderAsc(x => x.Patronymic) .End(); OrmMain.AddObjectDescription <DeliveryPriceRule>().Dialog <DeliveryPriceRuleDlg>().DefaultTableView() .Column("< 19л б.", x => x.Water19LCount.ToString()) .Column("< 6л б.", x => x.Water6LCount) .Column("< 1,5л б.", x => x.Water1500mlCount) .Column("< 0,6л б.", x => x.Water600mlCount) .Column("< 0,5л б.", x => x.Water500mlCount) .Column("Минимальная сумма заказа", x => x.OrderMinSumEShopGoods.ToString()) .SearchColumn("Описание правила", x => x.Title) .End(); OrmMain.AddObjectDescription <Certificate>().Dialog <CertificateDlg>().DefaultTableView() .SearchColumn("Имя", x => x.Name) .Column("Тип", x => x.TypeOfCertificate.GetEnumTitle()) .SearchColumn("Номер", x => x.Id.ToString()) .SearchColumn("Начало срока", x => x.StartDate.HasValue ? x.StartDate.Value.ToString("dd.MM.yyyy") : "Ошибка!") .SearchColumn("Окончание срока", x => x.ExpirationDate.HasValue ? x.ExpirationDate.Value.ToString("dd.MM.yyyy") : "Бессрочно") .Column("Архивный?", x => x.IsArchive ? "Да" : string.Empty) .OrderAsc(x => x.IsArchive) .OrderAsc(x => x.Id) .End(); OrmMain.AddObjectDescription <StoredResource>().Dialog <ImageLoaderDlg>().DefaultTableView() .SearchColumn("Номер", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .End(); OrmMain.AddObjectDescription <DeliveryPointCategory>().Dialog <DeliveryPointCategoryDlg>().DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .Column("В архиве?", x => x.IsArchive ? "Да" : "Нет") .OrderAsc(x => x.Name) .End(); OrmMain.AddObjectDescription <CounterpartyActivityKind>().Dialog <CounterpartyActivityKindDlg>().DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .End(); #endregion OrmMain.ClassMappingList.AddRange(QSBanks.QSBanksMain.GetModuleMaping()); #endregion HistoryMain.Enable(); TemplatePrinter.InitPrinter(); ImagePrinter.InitPrinter(); logger.Debug("OK"); }
static void CreateBaseConfig() { logger.Info("Настройка параметров базы..."); //Увеличиваем таймоут QSMain.ConnectionString += ";ConnectionTimeout=120"; var db_config = FluentNHibernate.Cfg.Db.MySQLConfiguration.Standard .Dialect <MySQL57SpatialExtendedDialect>() .ConnectionString(QSMain.ConnectionString) .AdoNetBatchSize(100) .Driver <LoggedMySqlClientDriver>(); // Настройка ORM OrmConfig.ConfigureOrm( db_config, new System.Reflection.Assembly[] { System.Reflection.Assembly.GetAssembly(typeof(QS.Project.HibernateMapping.UserBaseMap)), System.Reflection.Assembly.GetAssembly(typeof(HibernateMapping.OrganizationMap)), System.Reflection.Assembly.GetAssembly(typeof(Bank)), System.Reflection.Assembly.GetAssembly(typeof(HistoryMain)), }, (cnf) => { cnf.DataBaseIntegration( dbi => { dbi.BatchSize = 100; dbi.Batcher <MySqlClientBatchingBatcherFactory>(); } ); } ); #region Dialogs mapping OrmMain.ClassMappingList = new List <IOrmObjectMapping> { //Простые справочники OrmObjectMapping <CullingCategory> .Create().DefaultTableView().SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <Nationality> .Create().DefaultTableView().SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <Citizenship> .Create().DefaultTableView().SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <Manufacturer> .Create().DefaultTableView().SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <EquipmentColors> .Create().DefaultTableView().SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <User> .Create().DefaultTableView().SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <UserSettings> .Create().Dialog <UserSettingsView>(), OrmObjectMapping <FuelType> .Create().Dialog <FuelTypeDlg>().DefaultTableView().SearchColumn("Название", x => x.Name).SearchColumn("Стоимость", x => x.Cost.ToString()).End(), OrmObjectMapping <MovementWagon> .Create().Dialog <MovementWagonViewModel>().DefaultTableView().SearchColumn("Название", x => x.Name).End(), //Остальные справочники OrmObjectMapping <CarProxyDocument> .Create().Dialog <CarProxyDlg>(), OrmObjectMapping <M2ProxyDocument> .Create().Dialog <M2ProxyDlg>(), OrmObjectMapping <ProductGroup> .Create().Dialog <ProductGroupDlg>(), OrmObjectMapping <CommentTemplate> .Create().Dialog <CommentTemplateDlg>().DefaultTableView().SearchColumn("Шаблон комментария", x => x.Comment).End(), OrmObjectMapping <FineTemplate> .Create().Dialog <FineTemplateDlg>().DefaultTableView().SearchColumn("Шаблон комментария", x => x.Reason).End(), OrmObjectMapping <PremiumTemplate> .Create().Dialog <PremiumTemplateDlg>().DefaultTableView().SearchColumn("Шаблон комментария", x => x.Reason).End(), OrmObjectMapping <MeasurementUnits> .Create().Dialog <MeasurementUnitsDlg>().DefaultTableView().SearchColumn("ОКЕИ", x => x.OKEI).SearchColumn("Название", x => x.Name).Column("Точность", x => x.Digits.ToString()).End(), OrmObjectMapping <Contact> .Create().Dialog <ContactDlg>() .DefaultTableView().SearchColumn("Фамилия", x => x.Surname).SearchColumn("Имя", x => x.Name).SearchColumn("Отчество", x => x.Patronymic).End(), OrmObjectMapping <Order> .Create().Dialog <OrderDlg>().PopupMenu(OrderPopupMenu.GetPopupMenu), OrmObjectMapping <UndeliveredOrder> .Create().Dialog <UndeliveredOrderDlg>(), OrmObjectMapping <Organization> .Create().Dialog <OrganizationDlg>().DefaultTableView().Column("Код", x => x.Id.ToString()).SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <DeliverySchedule> .Create().Dialog <DeliveryScheduleDlg>().DefaultTableView().SearchColumn("Название", x => x.Name).SearchColumn("Время доставки", x => x.DeliveryTime).End(), OrmObjectMapping <ProductSpecification> .Create().Dialog <ProductSpecificationDlg>().DefaultTableView().SearchColumn("Код", x => x.Id.ToString()).SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <EquipmentType> .Create().Dialog <EquipmentTypeDlg>().DefaultTableView().Column("Название", equipmentType => equipmentType.Name).End(), //Связанное с клиентом OrmObjectMapping <Proxy> .Create().Dialog <ProxyDlg>() .DefaultTableView().SearchColumn("Номер", x => x.Number).SearchColumn("С", x => x.StartDate.ToShortDateString()).SearchColumn("По", x => x.ExpirationDate.ToShortDateString()).End(), OrmObjectMapping <DeliveryPoint> .Create().Dialog <DeliveryPointDlg>().DefaultTableView().SearchColumn("ID", x => x.Id.ToString()).Column("Адрес", x => x.Title).End(), OrmObjectMapping <PaidRentPackage> .Create().Dialog <PaidRentPackageDlg>() .DefaultTableView().SearchColumn("Название", x => x.Name).Column("Тип оборудования", x => x.EquipmentType.Name).SearchColumn("Цена в сутки", x => CurrencyWorks.GetShortCurrencyString(x.PriceDaily)).SearchColumn("Цена в месяц", x => CurrencyWorks.GetShortCurrencyString(x.PriceMonthly)).End(), OrmObjectMapping <FreeRentPackage> .Create().Dialog <FreeRentPackageDlg>().DefaultTableView().SearchColumn("Название", x => x.Name).Column("Тип оборудования", x => x.EquipmentType.Name).OrderAsc(x => x.Name).End(), OrmObjectMapping <Counterparty> .Create().Dialog <CounterpartyDlg>().DefaultTableView().SearchColumn("Название", x => x.FullName).End(), OrmObjectMapping <Tag> .Create().Dialog <TagDlg>().DefaultTableView().SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <CounterpartyContract> .Create().Dialog <CounterpartyContractDlg>(), OrmObjectMapping <DocTemplate> .Create().Dialog <DocTemplateDlg>().DefaultTableView().SearchColumn("Название", x => x.Name).Column("Тип", x => x.TemplateType.GetEnumTitle()).End(), OrmObjectMapping <TransferOperationDocument> .Create().Dialog <TransferOperationDocumentDlg>(), //Справочники с фильтрами OrmObjectMapping <Equipment> .Create().Dialog <EquipmentDlg>().JournalFilter <EquipmentFilter>() .DefaultTableView().Column("Код", x => x.Id.ToString()).SearchColumn("Номенклатура", x => x.NomenclatureName).Column("Тип", x => x.Nomenclature.Type.Name).SearchColumn("Серийный номер", x => x.Serial).Column("Дата последней обработки", x => x.LastServiceDate.ToShortDateString()).End(), //Логисткика OrmObjectMapping <RouteList> .Create().Dialog <RouteListCreateDlg>() .DefaultTableView().SearchColumn("Номер", x => x.Id.ToString()).Column("Дата", x => x.Date.ToShortDateString()).Column("Статус", x => x.Status.GetEnumTitle()).SearchColumn("Водитель", x => String.Format("{0} - {1}", x.Driver.FullName, x.Car.Title)).End(), OrmObjectMapping <RouteColumn> .Create().DefaultTableView().Column("Код", x => x.Id.ToString()).SearchColumn("Название", x => x.Name).End(), OrmObjectMapping <DeliveryShift> .Create().Dialog <DeliveryShiftDlg>().DefaultTableView().SearchColumn("Название", x => x.Name).SearchColumn("Диапазон времени", x => x.DeliveryTime).End(), OrmObjectMapping <DeliveryDaySchedule> .Create().Dialog <DeliveryDayScheduleDlg>().DefaultTableView().SearchColumn("Название", x => x.Name).End(), //Сервис OrmObjectMapping <ServiceClaim> .Create().Dialog <ServiceClaimDlg>().DefaultTableView().Column("Номер", x => x.Id.ToString()).Column("Тип", x => x.ServiceClaimType.GetEnumTitle()).Column("Оборудование", x => x.Equipment.Title).Column("Подмена", x => x.ReplacementEquipment != null ? "Да" : "Нет").Column("Точка доставки", x => x.DeliveryPoint.Title).End(), //Касса OrmObjectMapping <Income> .Create().Dialog <CashIncomeDlg> (), OrmObjectMapping <ExpenseCategory> .Create().Dialog <ExpenseCategoryViewModel>().DefaultTableView().Column("Код", x => x.Id.ToString()).SearchColumn("Название", e => e.Name).Column("Тип документа", e => e.ExpenseDocumentType.GetEnumTitle()).TreeConfig(new RecursiveTreeConfig <ExpenseCategory>(x => x.Parent, x => x.Childs)).End(), OrmObjectMapping <Expense> .Create().Dialog <CashExpenseDlg> (), OrmObjectMapping <AdvanceReport> .Create().Dialog <AdvanceReportDlg> (), OrmObjectMapping <Fine> .Create().Dialog <FineDlg> (), OrmObjectMapping <Premium> .Create().Dialog <PremiumDlg> (), OrmObjectMapping <IncomeCashTransferDocument> .Create().Dialog <IncomeCashTransferDlg>(), OrmObjectMapping <CommonCashTransferDocument> .Create().Dialog <CommonCashTransferDlg>(), //Банкинг OrmObjectMapping <AccountIncome> .Create(), OrmObjectMapping <AccountExpense> .Create(), //Склад OrmObjectMapping <Warehouse> .Create().Dialog <WarehouseDlg>().DefaultTableView().Column("Название", w => w.Name).Column("В архиве", w => w.IsArchive ? "Да":"").End(), OrmObjectMapping <RegradingOfGoodsTemplate> .Create().Dialog <RegradingOfGoodsTemplateDlg>().DefaultTableView().Column("Название", w => w.Name).End() }; #region Складские документы OrmMain.AddObjectDescription <IncomingWater>().Dialog <IncomingWaterDlg>(); OrmMain.AddObjectDescription <WriteoffDocument>().Dialog <WriteoffDocumentDlg>(); OrmMain.AddObjectDescription <InventoryDocument>().Dialog <InventoryDocumentDlg>(); OrmMain.AddObjectDescription <ShiftChangeWarehouseDocument>().Dialog <ShiftChangeWarehouseDocumentDlg>(); OrmMain.AddObjectDescription <RegradingOfGoodsDocument>().Dialog <RegradingOfGoodsDocumentDlg>(); OrmMain.AddObjectDescription <SelfDeliveryDocument>().Dialog <SelfDeliveryDocumentDlg>(); OrmMain.AddObjectDescription <CarLoadDocument>().Dialog <CarLoadDocumentDlg>(); OrmMain.AddObjectDescription <CarUnloadDocument>().Dialog <CarUnloadDocumentDlg>(); #endregion #region Goods OrmMain.AddObjectDescription <Nomenclature>().Dialog <NomenclatureDlg>().JournalFilter <NomenclatureFilter>(). DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .Column("Тип", x => x.CategoryString) .SearchColumn("Номер в ИМ", x => x.OnlineStoreExternalId) .End(); OrmMain.AddObjectDescription <Folder1c>().Dialog <Folder1cDlg>() .DefaultTableView() .SearchColumn("Код 1С", x => x.Code1c) .SearchColumn("Название", x => x.Name) .TreeConfig(new RecursiveTreeConfig <Folder1c>(x => x.Parent, x => x.Childs)).End(); #endregion #region Простые справочники OrmMain.AddObjectDescription <DiscountReason>() .DefaultTableView() .SearchColumn("Название", x => x.Name) .End(); OrmMain.AddObjectDescription <GeographicGroup>() .Dialog <GeographicGroupDlg>() .DefaultTableView() .SearchColumn("Название", x => x.Name) .Column("Код", x => x.Id.ToString()) .End(); OrmMain.AddObjectDescription <TariffZone>() .DefaultTableView() .SearchColumn("Номер", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .End(); OrmMain.AddObjectDescription <NonReturnReason>() .DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .End(); OrmMain.AddObjectDescription <PaymentFrom>() .DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .End(); OrmMain.AddObjectDescription <Post>() .DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .End(); #endregion #region неПростые справочники OrmMain.AddObjectDescription <Subdivision>().Dialog <SubdivisionDlg>().DefaultTableView().SearchColumn("Название", x => x.Name).Column("Руководитель", x => x.Chief == null ? "" : x.Chief.ShortName).SearchColumn("Номер", x => x.Id.ToString()).TreeConfig(new RecursiveTreeConfig <Subdivision>(x => x.ParentSubdivision, x => x.ChildSubdivisions)).End(); OrmMain.AddObjectDescription <TypeOfEntity>() .Dialog <TypeOfEntityDlg>() .DefaultTableView() .SearchColumn("Тип документа", x => TypeOfEntityRepository.GetEntityNameByString(x.Type)) .SearchColumn("Название документа", x => x.CustomName) .SearchColumn("Код", x => x.Id.ToString()) .Column("Активно", x => !x.IsActive ? "нет" : String.Empty) .SearchColumn("Имя класса", x => x.Type) .OrderAsc(x => x.CustomName) .End(); OrmMain.AddObjectDescription <Employee>().Dialog <EmployeeDlg>().DefaultTableView() .Column("Код", x => x.Id.ToString()) .SearchColumn("Ф.И.О.", x => x.FullName) .Column("Категория", x => x.Category.GetEnumTitle()) .OrderAsc(x => x.LastName).OrderAsc(x => x.Name).OrderAsc(x => x.Patronymic) .End(); OrmMain.AddObjectDescription <Trainee>().Dialog <TraineeDlg>().DefaultTableView() .Column("Код", x => x.Id.ToString()) .SearchColumn("Ф.И.О.", x => x.FullName) .OrderAsc(x => x.LastName).OrderAsc(x => x.Name).OrderAsc(x => x.Patronymic) .End(); OrmMain.AddObjectDescription <DeliveryPriceRule>().Dialog <DeliveryPriceRuleDlg>().DefaultTableView() .Column("< 19л б.", x => x.Water19LCount.ToString()) .Column("< 6л б.", x => x.Water6LCount) .Column("< 1,5л б.", x => x.Water1500mlCount) .Column("< 0,6л б.", x => x.Water600mlCount) .Column("Минимальная сумма заказа", x => x.OrderMinSumEShopGoods.ToString()) .SearchColumn("Описание правила", x => x.Title) .End(); OrmMain.AddObjectDescription <Car>().Dialog <CarsDlg>().DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()) .SearchColumn("Модель а/м", x => x.Model) .SearchColumn("Гос. номер", x => x.RegistrationNumber) .SearchColumn("Водитель", x => x.Driver != null ? x.Driver.FullName : string.Empty) .End(); OrmMain.AddObjectDescription <Certificate>().Dialog <CertificateDlg>().DefaultTableView() .SearchColumn("Имя", x => x.Name) .Column("Тип", x => x.TypeOfCertificate.GetEnumTitle()) .SearchColumn("Номер", x => x.Id.ToString()) .SearchColumn("Начало срока", x => x.StartDate.HasValue ? x.StartDate.Value.ToString("dd.MM.yyyy") : "Ошибка!") .SearchColumn("Окончание срока", x => x.ExpirationDate.HasValue ? x.ExpirationDate.Value.ToString("dd.MM.yyyy") : "Бессрочно") .Column("Архивный?", x => x.IsArchive ? "Да" : string.Empty) .OrderAsc(x => x.IsArchive) .OrderAsc(x => x.Id) .End(); OrmMain.AddObjectDescription <StoredImageResource>().Dialog <ImageLoaderDlg>().DefaultTableView() .SearchColumn("Номер", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .End(); OrmMain.AddObjectDescription <DeliveryPointCategory>().Dialog <DeliveryPointCategoryDlg>().DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .Column("В архиве?", x => x.IsArchive ? "Да" : "Нет") .OrderAsc(x => x.Name) .End(); OrmMain.AddObjectDescription <CounterpartyActivityKind>().Dialog <CounterpartyActivityKindDlg>().DefaultTableView() .SearchColumn("Код", x => x.Id.ToString()) .SearchColumn("Название", x => x.Name) .End(); #endregion OrmMain.ClassMappingList.AddRange(QSBanks.QSBanksMain.GetModuleMaping()); #endregion HistoryMain.Enable(); TemplatePrinter.InitPrinter(); ImagePrinter.InitPrinter(); //Настройка ParentReference ParentReferenceConfig.AddActions(new ParentReferenceActions <Organization, Account> { AddNewChild = (o, a) => o.AddAccount(a) }); ParentReferenceConfig.AddActions(new ParentReferenceActions <Counterparty, Account> { AddNewChild = (c, a) => c.AddAccount(a) }); ParentReferenceConfig.AddActions(new ParentReferenceActions <Employee, Account> { AddNewChild = (c, a) => c.AddAccount(a) }); ParentReferenceConfig.AddActions(new ParentReferenceActions <Trainee, Account> { AddNewChild = (c, a) => c.AddAccount(a) }); }