Beispiel #1
0
        public HistoryView()
        {
            this.Build();

            UoW = UnitOfWorkFactory.CreateWithoutRoot();

            datacomboObject.SetRenderTextFunc <HistoryObjectDesc> (x => x.DisplayName);
            datacomboObject.ItemsList = HistoryMain.TraceClasses.ToList();
            comboProperty.SetRenderTextFunc <HistoryFieldDesc> (x => x.DisplayName);
            comboAction.ItemsEnum = typeof(EntityChangeOperation);
            ComboWorks.ComboFillReference(comboUsers, "users", ComboWorks.ListMode.WithAll);
            selectperiod.ActiveRadio = SelectPeriod.Period.Today;

            datatreeChangesets.ColumnsConfig = Gamma.GtkWidgets.ColumnsConfigFactory.Create <ChangedEntity> ()
                                               .AddColumn("Время").AddTextRenderer(x => x.ChangeTimeText)
                                               .AddColumn("Пользователь").AddTextRenderer(x => x.ChangeSet.UserName)
                                               .AddColumn("Действие").AddTextRenderer(x => x.OperationText)
                                               .AddColumn("Тип объекта").AddTextRenderer(x => x.ObjectTitle)
                                               .AddColumn("Объект").AddTextRenderer(x => x.EntityTitle)
                                               .AddColumn("Откуда изменялось").AddTextRenderer(x => x.ChangeSet.ActionName)
                                               .Finish();
            datatreeChangesets.Selection.Changed += OnChangeSetSelectionChanged;
            GtkScrolledWindowChangesets.Vadjustment.ValueChanged += Vadjustment_ValueChanged;

            datatreeChanges.ColumnsConfig = Gamma.GtkWidgets.ColumnsConfigFactory.Create <FieldChange> ()
                                            .AddColumn("Поле").AddTextRenderer(x => x.FieldTitle)
                                            .AddColumn("Операция").AddTextRenderer(x => x.TypeText)
                                            .AddColumn("Новое значение").AddTextRenderer(x => x.NewPangoText, useMarkup: true)
                                            .AddColumn("Старое значение").AddTextRenderer(x => x.OldPangoText, useMarkup: true)
                                            .Finish();

            canUpdate = true;
            UpdateJournal();
        }
 public StockAllWearDlg()
 {
     this.Build();
     ComboWorks.ComboFillReference(comboObject, "warehouse", ComboWorks.ListMode.OnlyItems, true, "name");
     AutofacScope   = MainClass.AppDIContainer.BeginLifetimeScope();
     featureService = AutofacScope.Resolve <FeaturesService>();
     DisableFeatures();
     comboObject.Active = 0;
 }
Beispiel #3
0
 protected void OnReferenceUpdate(object sender, QSMain.ReferenceUpdatedEventArgs e)
 {
     switch (e.ReferenceTable)
     {
     case "doc_types":
         ComboWorks.ComboFillReference(comboDocType, "doc_types", ComboWorks.ListMode.OnlyItems);
         break;
     }
 }
        public GlassOrders()
        {
            this.Build();

            QSMain.CheckConnectionAlive();
            ComboWorks.ComboFillReference(comboStatus, "status", ComboWorks.ListMode.WithNo);

            string       sql = "SELECT id, name FROM stocks";
            MySqlCommand cmd = new MySqlCommand(sql, QSMain.connectionDB);

            using (MySqlDataReader rdr = cmd.ExecuteReader())
            {
                while (rdr.Read())
                {
                    checklistStock.AddCheckButton(rdr["id"].ToString(), rdr["name"].ToString());
                }
            }
        }
Beispiel #5
0
        public MainWindow() : base(WindowType.Toplevel)
        {
            Build();

            QSMain.StatusBarLabel = labelStatus;
            this.Title            = QSSupportLib.MainSupport.GetTitle();
            QSMain.MakeNewStatusTargetForNlog();
            QSSupportLib.MainSupport.LoadBaseParameters();

            MainUpdater.RunCheckVersion(true, true, true);

            Reference.RunReferenceItemDlg += OnRunReferenceItemDialog;
            QSMain.ReferenceUpdated       += OnReferenceUpdate;

            if (QSMain.User.Login == "root")
            {
                string        Message = "Вы зашли в программу под администратором базы данных. У вас есть только возможность создавать других пользователей.";
                MessageDialog md      = new MessageDialog(this, DialogFlags.DestroyWithParent,
                                                          MessageType.Info,
                                                          ButtonsType.Ok,
                                                          Message);
                md.Run();
                md.Destroy();
                OnUsersActionActivated(null, null);
                return;
            }

            UsersAction.Sensitive    = QSMain.User.Admin;
            labelUser.LabelProp      = QSMain.User.Name;
            ActionDocTypes.Sensitive = QSMain.User.Permissions["edit_db"];
            buttonInput.Sensitive    = QSMain.User.Permissions["can_edit"];

            // Создаем главное окно
            ComboWorks.ComboFillReference(comboDocType, "doc_types", ComboWorks.ListMode.OnlyItems);
            selectperiodDocs.ActiveRadio = SelectPeriod.Period.Week;
        }
Beispiel #6
0
        public InputDocs() :
            base(Gtk.WindowType.Toplevel)
        {
            this.Build();

            FieldLables  = new Dictionary <int, Label>();
            FieldWidgets = new Dictionary <int, object>();
            FieldIcons   = new Dictionary <int, Gtk.Image>();
            ComboWorks.ComboFillReference(comboType, "doc_types", ComboWorks.ListMode.OnlyItems, false);
            ImageList = new ImageTreeStore(typeof(int),         //0 - id
                                           typeof(string),      //1 - Image Name
                                           typeof(string),      //2 - full path
                                           typeof(Document),    //3 - document
                                           typeof(Pixbuf),      //4 - thumbnails
                                           typeof(Pixbuf),      //5 - full image
                                           typeof(bool),        //6 - IsImage
                                           typeof(string),      //7 - Doc name
                                           typeof(string)       //8 - Doc Icon Name
                                           );

            TreeViewColumn ImageColumn = new TreeViewColumn();
            var            ImageCell   = new ImageListCellRenderer(Pango.FontDescription.FromString("Tahoma 10"), IconSize.Menu);

            ImageCell.Xalign = 0;
            ImageColumn.PackStart(ImageCell, true);
            ImageColumn.AddAttribute(ImageCell, "pixbuf", 4);
            ImageColumn.AddAttribute(ImageCell, "text", 7);
            ImageColumn.AddAttribute(ImageCell, "IsImageRow", 6);
            ImageColumn.AddAttribute(ImageCell, "IconName", 8);

            treeviewImages.AppendColumn(ImageColumn);
            treeviewImages.Model         = ImageList;
            treeviewImages.Reorderable   = true;
            treeviewImages.TooltipColumn = 1;
            treeviewImages.ShowAll();
            treeviewImages.Selection.Changed += OnTreeviewImagesSelectionChanged;
            NextDocNumber = 1;

            //Настраиваем сканирование
            logger.Debug("Initialaze scan");
            //scan = new ScanAuxWorks();
            try
            {
                scan                = new ScanWorks();
                scan.ScanerSetup    = ScanerSetup.Native;
                scan.Pulse         += OnScanWorksPulse;
                scan.ImageTransfer += OnScanWorksImageTransfer;

                var scanners = scan.GetScannerList();
                if (scanners.Length > 0)
                {
                    comboScaner.ItemsList = scanners;
                    comboScaner.Active    = scan.CurrentScanner;
                }
                else
                {
                    comboScaner.Sensitive = ScanAction.Sensitive = false;
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Не удалось инициализировать подсистему сканирования.");
                comboScaner.Sensitive = ScanAction.Sensitive = false;
            }
        }
 public WearStatement()
 {
     this.Build();
     ComboWorks.ComboFillReference(comboObject, "objects", ComboWorks.ListMode.OnlyItems);
     comboObject.Active = 0;
 }