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); }
private void FillDocumentTypes() { DocumentTypesLogic documentTypesLogic = new DocumentTypesLogic(manager); DocumentTypesCB.DataSource = documentTypesLogic.GetAll(); DocumentTypesCB.ValueMember = "ID"; DocumentTypesCB.DisplayMember = "Name"; DocumentTypesCB.Update(); }
/// <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; }
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(); }
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(); }
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); }