Example #1
0
        public void Fill()
        {
            ItemIntValue none = new ItemIntValue();

            none.ID   = -1;
            none.Name = " - не вибрано - ";
            List <ItemIntValue> items0 = new List <ItemIntValue>();

            DocumentTypesLogic documentTypesLogic = new DocumentTypesLogic(manager);

            items0.Clear();
            items0.Add(none);
            foreach (var a in documentTypesLogic.GetAll().OrderBy(a => a.Name))
            {
                ItemIntValue i = new ItemIntValue();
                i.ID   = a.ID;
                i.Name = a.Name;
                items0.Add(i);
            }
            DocumentTypesCB.DataSource    = items0;
            DocumentTypesCB.ValueMember   = "ID";
            DocumentTypesCB.DisplayMember = "Name";
            DocumentTypesCB.Update();

            DateTime startDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
        }
Example #2
0
        private void FillDocumentTypes()
        {
            DocumentTypesLogic documentTypesLogic = new DocumentTypesLogic(manager);

            DocumentTypesCB.DataSource    = documentTypesLogic.GetAll();
            DocumentTypesCB.ValueMember   = "ID";
            DocumentTypesCB.DisplayMember = "Name";
            DocumentTypesCB.Update();
        }
Example #3
0
        /// <summary>
        /// заповнення можливих типів документів
        /// </summary>
        private void FillDocumentTypes()
        {
            DocumentTypesLogic types = new DocumentTypesLogic(manager);

            DocumentTypeLUE.Properties.DataSource    = types.GetAll();
            DocumentTypeLUE.Properties.DisplayMember = "Name";
            DocumentTypeLUE.Properties.ValueMember   = "ID";
            LookUpColumnInfoCollection coll = DocumentTypeLUE.Properties.Columns;

            coll.Add(new LookUpColumnInfo("Name", 0, "Назва"));
            DocumentTypeLUE.Properties.BestFitMode           = BestFitMode.BestFitResizePopup;
            DocumentTypeLUE.Properties.SearchMode            = SearchMode.AutoFilter;
            DocumentTypeLUE.Properties.AutoSearchColumnIndex = 1;
        }
Example #4
0
        public void FillFilters()
        {
            WareCategoriesLogic        categoriesLogic       = new WareCategoriesLogic(manager);
            StaffStructureObjectsLogic structureObjectsLogic = new StaffStructureObjectsLogic(manager);
            WaresLogic         waresLogic         = new WaresLogic(manager);
            DocumentTypesLogic documentTypesLogic = new DocumentTypesLogic(manager);


            StructureObjectsLUE.Properties.DisplayMember = "Name";
            StructureObjectsLUE.Properties.ValueMember   = "ID";
            StructureObjectsLUE.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "Назва"));
            StructureObjectsLUE.Properties.DataSource = structureObjectsLogic.GetHeirarchyView();



            WareCategoriesLUE.Properties.DisplayMember = "Name";
            WareCategoriesLUE.Properties.ValueMember   = "ID";
            WareCategoriesLUE.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "Назва"));
            WareCategoriesLUE.Properties.DataSource = categoriesLogic.GetCategoriesHierarchy();

            StartDateDE.EditValue = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
        }
Example #5
0
        public void Fill()
        {
            ItemIntValue none = new ItemIntValue();
            none.ID = -1;
            none.Name = " - не вибрано - ";
            List<ItemIntValue> items0 = new List<ItemIntValue>();

            DocumentTypesLogic documentTypesLogic = new DocumentTypesLogic(manager);
            items0.Clear();
            items0.Add(none);
            foreach (var a in documentTypesLogic.GetAll().OrderBy(a => a.Name))
            {
                ItemIntValue i = new ItemIntValue();
                i.ID = a.ID;
                i.Name = a.Name;
                items0.Add(i);
            }
            DocumentTypesCB.DataSource = items0;
            DocumentTypesCB.ValueMember = "ID";
            DocumentTypesCB.DisplayMember = "Name";
            DocumentTypesCB.Update();

            DateTime startDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
        }
Example #6
0
 /// <summary>
 /// заповнення можливих типів документів
 /// </summary>
 private void FillDocumentTypes()
 {
     DocumentTypesLogic types = new DocumentTypesLogic(manager);
     DocumentTypeLUE.Properties.DataSource = types.GetAll();
     DocumentTypeLUE.Properties.DisplayMember = "Name";
     DocumentTypeLUE.Properties.ValueMember = "ID";
     LookUpColumnInfoCollection coll = DocumentTypeLUE.Properties.Columns;
     coll.Add(new LookUpColumnInfo("Name", 0, "Назва"));
     DocumentTypeLUE.Properties.BestFitMode = BestFitMode.BestFitResizePopup;
     DocumentTypeLUE.Properties.SearchMode = SearchMode.AutoFilter;
     DocumentTypeLUE.Properties.AutoSearchColumnIndex = 1;
 }
Example #7
0
        private void MainMDI_Load(object sender, EventArgs e)
        {
            //Початковий запуск - перевіряємо чи заповнений довідник типівдокументів
            ContextManager manager = new ContextManager();
            CompasDataContext context = manager.Context;
            DocumentTypesLogic documentTypes = new DocumentTypesLogic(manager);
            var existTypes = documentTypes.GetAll();
            if (existTypes.Count == 0)
            {
                documentTypes.Create(1, "Прихідна накладна", true, false);
                documentTypes.Create(2, "Розхідна накладна", false, true);
                documentTypes.Create(3, "Чек", false, true);
                documentTypes.Create(4, "Переміщення товару", false, false);
                documentTypes.Create(5, "Замовлення", false, false);
                manager.Save();
            }

            ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager);
            ConfigurationParameter param0 = config.Get(ParametersLogic.Parameter.MENUITEM_CARDS_VISIBLE.ToString());
            if (param0 != null)
            {
                if (param0.Value == "FALSE")
                {
                    foreach (ToolStripMenuItem mainMenu in menuStrip.Items)
                    {
                        if (mainMenu.Text == @"Довідники")
                        {
                            foreach (ToolStripItem subMenu in mainMenu.DropDownItems)
                            {
                                if (subMenu.Name == "CardsToolStripMenuItem")
                                    subMenu.Visible = false;
                            }
                        }
                    }
                }
            }

            ConfigurationParameter param1 = config.Get(ParametersLogic.Parameter.MENUITEM_CARWASH_VISIBLE.ToString());
            if (param1 != null)
            {
                if (param1.Value == "FALSE")
                {
                    foreach (ToolStripMenuItem mainMenu in menuStrip.Items)
                    {
                        if (mainMenu.Text == @"Довідники")
                        {
                            foreach (ToolStripItem subMenu in mainMenu.DropDownItems)
                            {
                                if (subMenu.Name == "CarWashToolStripMenuItem")
                                    subMenu.Visible = false;
                            }
                        }
                    }
                }
            }

            ConfigurationParameter param2 = config.Get(ParametersLogic.Parameter.MENUITEM_SECURITY_ENABLED.ToString());
            if (param2 != null)
            {
                if (param2.Value == "FALSE")
                {
                    menuStrip.Items["SecurityToolStripMenuItem"].Enabled = false;
                }
            }
            manager.CloseContext();
        }
Example #8
0
        public void FillFilters()
        {
            WareCategoriesLogic categoriesLogic = new WareCategoriesLogic(manager);
            StaffStructureObjectsLogic structureObjectsLogic = new StaffStructureObjectsLogic(manager);
            WaresLogic waresLogic = new WaresLogic(manager);
            DocumentTypesLogic documentTypesLogic = new DocumentTypesLogic(manager);

            StructureObjectsLUE.Properties.DisplayMember = "Name";
            StructureObjectsLUE.Properties.ValueMember = "ID";
            StructureObjectsLUE.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "Назва"));
            StructureObjectsLUE.Properties.DataSource = structureObjectsLogic.GetHeirarchyView();

            WareCategoriesLUE.Properties.DisplayMember = "Name";
            WareCategoriesLUE.Properties.ValueMember = "ID";
            WareCategoriesLUE.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "Назва"));
            WareCategoriesLUE.Properties.DataSource = categoriesLogic.GetCategoriesHierarchy();

            StartDateDE.EditValue = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
        }
Example #9
0
        private void MainMDI_Load(object sender, EventArgs e)
        {
            //Початковий запуск - перевіряємо чи заповнений довідник типівдокументів
            ContextManager     manager       = new ContextManager();
            CompasDataContext  context       = manager.Context;
            DocumentTypesLogic documentTypes = new DocumentTypesLogic(manager);
            var existTypes = documentTypes.GetAll();

            if (existTypes.Count == 0)
            {
                documentTypes.Create(1, "Прихідна накладна", true, false);
                documentTypes.Create(2, "Розхідна накладна", false, true);
                documentTypes.Create(3, "Чек", false, true);
                documentTypes.Create(4, "Переміщення товару", false, false);
                documentTypes.Create(5, "Замовлення", false, false);
                manager.Save();
            }

            ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager);
            ConfigurationParameter       param0 = config.Get(ParametersLogic.Parameter.MENUITEM_CARDS_VISIBLE.ToString());

            if (param0 != null)
            {
                if (param0.Value == "FALSE")
                {
                    foreach (ToolStripMenuItem mainMenu in menuStrip.Items)
                    {
                        if (mainMenu.Text == @"Довідники")
                        {
                            foreach (ToolStripItem subMenu in mainMenu.DropDownItems)
                            {
                                if (subMenu.Name == "CardsToolStripMenuItem")
                                {
                                    subMenu.Visible = false;
                                }
                            }
                        }
                    }
                }
            }

            ConfigurationParameter param1 = config.Get(ParametersLogic.Parameter.MENUITEM_CARWASH_VISIBLE.ToString());

            if (param1 != null)
            {
                if (param1.Value == "FALSE")
                {
                    foreach (ToolStripMenuItem mainMenu in menuStrip.Items)
                    {
                        if (mainMenu.Text == @"Довідники")
                        {
                            foreach (ToolStripItem subMenu in mainMenu.DropDownItems)
                            {
                                if (subMenu.Name == "CarWashToolStripMenuItem")
                                {
                                    subMenu.Visible = false;
                                }
                            }
                        }
                    }
                }
            }

            ConfigurationParameter param2 = config.Get(ParametersLogic.Parameter.MENUITEM_SECURITY_ENABLED.ToString());

            if (param2 != null)
            {
                if (param2.Value == "FALSE")
                {
                    menuStrip.Items["SecurityToolStripMenuItem"].Enabled = false;
                }
            }
            manager.CloseContext();
        }