public DocumentPaymentData(int DocumentID, CashRegister _CashRegister) { InitializeComponent(); cashRegister = _CashRegister; manager = new ContextManager(); DocumentsLogic dl = new DocumentsLogic(manager); document = dl.Get(DocumentID); documentSuma = document.DocumentSum; documentId = DocumentID; PayDateDTP.Value = DateTime.Now; DocumentSumaL.Text = Convert.ToString(documentSuma); CheckNumberTB.Text = document.Number; Fill(); FillPaymentTypes(); FillStructureObjects(); ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager); ConfigurationParameter param0 = config.Get(ParametersLogic.Parameter.PAYMENTS_SHOW_CARD.ToString()); if (param0 != null) { if (Helpers.ConfigDataTypeConverter.ConvertToBoolean(param0.Value) == true) { tableLayoutPanel1.RowStyles[4].SizeType = SizeType.Absolute; tableLayoutPanel1.RowStyles[4].Height = 0; } } }
public DocumentDetailsDataSimple(string _mode, WareDocument document, List <WareDocumentDetail> documentDetails, WareDocumentDetail documentDetail) { InitializeComponent(); manager = new ContextManager(); mode = _mode; MessageL.Text = "Оберіть одиницю"; Document = document; DocumentDetails = documentDetails; DocumentDetail = documentDetail; //categoriesUC1.Fill(); //categoriesUC1.ExpandAll(); wareSelectorUC1.Init(""); ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager); ConfigurationParameter param0 = config.Get(ParametersLogic.Parameter.DOCUMENTDETAILS_SHOW_SECONDARY_UNIT.ToString()); if (param0 != null) { SecondaryGroupGB.Visible = Helpers.ConfigDataTypeConverter.ConvertToBoolean(param0.Value); } ConfigurationParameter param1 = config.Get(ParametersLogic.Parameter.DOCUMENTDETAILS_SHOW_FONTSIZE.ToString()); if (param1 != null) { float size = Helpers.ConfigDataTypeConverter.ConvertToFloat(param1.Value); wareSelectorUC1.FontSize = size; //this.Font = new Font(this.Font.Name, size); } ConfigurationParameter param2 = config.Get(ParametersLogic.Parameter.DOCUMENTDETAILS_SHOW_WARES_MINROWHEIGHT.ToString()); if (param2 != null) { int size = Convert.ToInt32(param2.Value); wareSelectorUC1.MinRowHeight = size; } ConfigurationParameter param3 = config.Get(ParametersLogic.Parameter.DOCUMENTDETAILS_SHOW_WARES_VIEWMODE.ToString()); if (param3 != null) { switch (param3.ToString().ToUpper()) { case "TREEVIEW": { wareSelectorUC1.CategoriesViewMode = UC.CategoriesUC.Mode.TreeView; break; } case "BUTTON": { wareSelectorUC1.CategoriesViewMode = UC.CategoriesUC.Mode.Button; break; } } } }
public DocumentPaymentData(int DocumentID, WareDocument Document, CashRegister _CashRegister) { InitializeComponent(); cashRegister = _CashRegister; document = Document; manager = new ContextManager(); documentSuma = Document.DocumentSum; documentId = DocumentID; PayDateDTP.Value = DateTime.Now; DocumentSumaL.Text = Convert.ToString(documentSuma); CheckNumberTB.Text = document.Number; Fill(); FillPaymentTypes(); FillStructureObjects(); ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager); ConfigurationParameter param0 = config.Get(ParametersLogic.Parameter.PAYMENTS_SHOW_CARD.ToString()); if (param0 != null) { if (Helpers.ConfigDataTypeConverter.ConvertToBoolean(param0.Value) == true) { tableLayoutPanel1.RowStyles[4].SizeType = SizeType.Absolute; tableLayoutPanel1.RowStyles[4].Height = 0; } } }
private void DeleteSB_Click(object sender, EventArgs e) { ConfigurationParametersLogic parametersLogic = new ConfigurationParametersLogic(manager); parametersLogic.Delete(Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value)); manager.Save(); Fill(); }
private void FillDataGV() { Compas.Logic.Config.ConfigurationParametersLogic configurationsLogic = new ConfigurationParametersLogic(manager); ListToDataTable listToDataTable = new ListToDataTable(); DataGV.AutoGenerateColumns = false; DataGV.DataSource = listToDataTable.ToDataTable <ViewConfigurationParameter>(configurationsLogic.GetAllView()); DgvFilterManager filterManager = new DgvFilterManager(DataGV); DataGV.Update(); }
private void SaveBt_Click(object sender, EventArgs e) { ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager); int modeId; int? userId; string parameter; string value; string comment; modeId = Convert.ToInt32(ModeCB.SelectedValue); userId = Convert.ToInt32(UsersCB.SelectedValue); parameter = ParametersCB.SelectedValue.ToString(); value = ValueTB.Text; comment = CommentTB.Text; if (userId <= 0) { userId = null; } if (mode == "new") { config.Create(modeId, userId, parameter, value, comment); } if (mode == "edit") { config.Update(Convert.ToInt32(id), modeId, userId, parameter, value, comment); } manager.Save(); this.Close(); //WareDiscountsLogic discounts = new WareDiscountsLogic(manager); //int discountTypeId = Convert.ToInt32(DiscountTypesCB.SelectedValue); //string name = NameTB.Text; //bool active = ActiveCB.Checked; //decimal defaultDiscountPercent = DefaultDiscountPercentNUD.Value; //if (mode == "new") //{ // discounts.Create(name, active, discountTypeId, defaultDiscountPercent); //} //if (mode == "edit") //{ // discounts.Update(Convert.ToInt32(id), name, active, discountTypeId, defaultDiscountPercent); //} //manager.Save(); //this.Close(); }
private void SaveBt_Click(object sender, EventArgs e) { string portNumber = PortNumberTB.Text; string logicNumber = LogicNumberTB.Text; string user = UserTB.Text; string password = PasswordTB.Text; int modeId = ((SecurityMode)(ModesCB.SelectedItem)).ID; Logic.Config.ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager); config.Create(installationId, modeId, null, Convert.ToString(Logic.Config.ParametersLogic.Parameter.CASHREGISTER_PORTNUMBER), portNumber, ""); config.Create(installationId, modeId, null, Convert.ToString(Logic.Config.ParametersLogic.Parameter.CASHREGISTER_LOGICNUMBER), logicNumber, ""); config.Create(installationId, modeId, null, Convert.ToString(Logic.Config.ParametersLogic.Parameter.CASHREGISTER_USER), user, ""); config.Create(installationId, modeId, null, Convert.ToString(Logic.Config.ParametersLogic.Parameter.CASHREGISTER_PASSWORD), password, ""); manager.Save(); }
private void Fill() { Logic.Config.ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager); int modeId = ((SecurityMode)(ModesCB.SelectedItem)).ID; var parameterPortNumber = config.Get(installationId, Convert.ToInt32(modeId), Logic.Config.ParametersLogic.Parameter.CASHREGISTER_PORTNUMBER.ToString()); var parameterLogicNumber = config.Get(installationId, Convert.ToInt32(modeId), Logic.Config.ParametersLogic.Parameter.CASHREGISTER_LOGICNUMBER.ToString()); var parameterUser = config.Get(installationId, Convert.ToInt32(modeId), Logic.Config.ParametersLogic.Parameter.CASHREGISTER_USER.ToString()); var parameterPassword = config.Get(installationId, Convert.ToInt32(modeId), Logic.Config.ParametersLogic.Parameter.CASHREGISTER_PASSWORD.ToString()); if (parameterPortNumber != null) { PortNumberTB.Text = parameterPortNumber.Value; } else { PortNumberTB.Text = ""; } if (parameterLogicNumber != null) { LogicNumberTB.Text = parameterLogicNumber.Value; } else { LogicNumberTB.Text = ""; } if (parameterUser != null) { UserTB.Text = parameterUser.Value; } else { UserTB.Text = ""; } if (parameterPassword != null) { PasswordTB.Text = parameterPassword.Value; } else { PasswordTB.Text = ""; } }
/// <summary> /// Заповнюємо поля відображення даних документу /// </summary> private void Fill() { CompasLogger.Add(String.Format("p21"), CompasLogger.Level.Info); InitContractorsLookUp(); CompasLogger.Add(String.Format("p22"), CompasLogger.Level.Info); FillDocumentTypes(); CompasLogger.Add(String.Format("p23"), CompasLogger.Level.Info); FillToObjects(); CompasLogger.Add(String.Format("p24"), CompasLogger.Level.Info); //FillFromObjects(); CompasLogger.Add(String.Format("p25"), CompasLogger.Level.Info); FillCurrencies(); CompasLogger.Add(String.Format("p26"), CompasLogger.Level.Info); FillDetails(); CompasLogger.Add(String.Format("p27"), CompasLogger.Level.Info); FillTeams(); CompasLogger.Add(String.Format("p28"), CompasLogger.Level.Info); FillEmployees(); CompasLogger.Add(String.Format("p29"), CompasLogger.Level.Info); FillCategories(); FillCarInfo(); FillEnterprises(); if(mode == "new") { DateDE.EditValue = DateTime.Now; //CurrencyLUE.EditValue = CurrencyLUE. } ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager); ConfigurationParameter param0 = config.Get(ParametersLogic.Parameter.DOCUMENT_TYPE.ToString()); if (param0 != null) { int value = Convert.ToInt32(param0.Value); DocumentTypeLUE.EditValue = value; } ConfigurationParameter param1 = config.Get(ParametersLogic.Parameter.DOCUMENT_TYPE_ENABLED.ToString()); if (param1 != null) { DocumentTypeLUE.Enabled = false; } ConfigurationParameter param2 = config.Get(ParametersLogic.Parameter.DOCUMENT_CAR_DEFAULT_CATEGORY.ToString()); if (param2 != null) { int value = Convert.ToInt32(param2.Value); foreach (object a in CarCategoriesCB.Items) { if (((CWCategory)a).ID == value) { CarCategoriesCB.SelectedItem = a; } } } ConfigurationParameter param3 = config.Get(ParametersLogic.Parameter.DOCUMENT_CAR_VISIBLE.ToString()); if (param3 != null) { CarGB.Visible = Helpers.ConfigDataTypeConverter.ConvertToBoolean(param3.Value); } ConfigurationParameter param4 = config.Get(ParametersLogic.Parameter.DOCUMENT_CURRENCY.ToString()); if (param4 != null) { int value = Convert.ToInt32(param4.Value); CurrencyLUE.EditValue = value; } ConfigurationParameter param5 = config.Get(ParametersLogic.Parameter.DOCUMENT_CURRENCY_ENABLED.ToString()); if (param5 != null) { CurrencyLUE.Enabled = Helpers.ConfigDataTypeConverter.ConvertToBoolean(param5.Value); } ConfigurationParameter param6 = config.Get(ParametersLogic.Parameter.DOCUMENT_DATE_ENABLED.ToString()); if (param6 != null) { DateDE.Enabled = Helpers.ConfigDataTypeConverter.ConvertToBoolean(param6.Value); } ConfigurationParameter param7 = config.Get(ParametersLogic.Parameter.DOCUMENT_FROM_OBJECT.ToString()); if (param7 != null) { int value = Convert.ToInt32(param7.Value); FromObjectLUE.EditValue = value; } ConfigurationParameter param8 = config.Get(ParametersLogic.Parameter.DOCUMENT_FROM_OBJECT_ENABLED.ToString()); if (param8 != null) { FromObjectLUE.Enabled = Helpers.ConfigDataTypeConverter.ConvertToBoolean(param8.Value); } ConfigurationParameter param9 = config.Get(ParametersLogic.Parameter.DOCUMENT_TO_OBJECT.ToString()); if (param9 != null) { int value = Convert.ToInt32(param9.Value); ToObjectLUE.EditValue = value; } ConfigurationParameter param10 = config.Get(ParametersLogic.Parameter.DOCUMENT_TO_OBJECT_ENABLED.ToString()); if (param10 != null) { ToObjectLUE.Enabled = Helpers.ConfigDataTypeConverter.ConvertToBoolean(param10.Value); } ConfigurationParameter param11 = config.Get(ParametersLogic.Parameter.DOCUMENT_PARAMETERS_IN_DOCUMENTDATA_VISIBLE.ToString()); if (param11 != null) { if (Helpers.ConfigDataTypeConverter.ConvertToBoolean(param11.Value) == false) { splitContainerControl1.Panel1.Visible = Helpers.ConfigDataTypeConverter.ConvertToBoolean(param11.Value); splitContainerControl1.Panel1.Width = 1; splitContainerControl1.SplitterPosition = 0; } } if (mode == "edit") { if (document.DocumentTypeID != null) DocumentTypeLUE.EditValue = document.DocumentTypeID; ContractorLUE.EditValue = document.ContractorID; NumberTE.Text = document.Number; if(document.Date != null) DateDE.DateTime = Convert.ToDateTime(document.Date); if (document.FromStructureObjectID != null) FromObjectLUE.EditValue = document.FromStructureObjectID; if (document.ToStructureObjectD != null) ToObjectLUE.EditValue = document.ToStructureObjectD; if (document.CurrencyID != null) CurrencyLUE.EditValue = document.CurrencyID; DescriptionTE.Text = document.Description; AddressTE.Text = document.Address; if(document.EnterpriseID != null) EnterprisesCB.SelectedValue = document.EnterpriseID; } }
/// <summary> /// Заповнюємо поля відображення даних документу /// </summary> private void Fill() { CompasLogger.Add(String.Format("p21"), CompasLogger.Level.Info); InitContractorsLookUp(); CompasLogger.Add(String.Format("p22"), CompasLogger.Level.Info); FillDocumentTypes(); CompasLogger.Add(String.Format("p23"), CompasLogger.Level.Info); FillToObjects(); CompasLogger.Add(String.Format("p24"), CompasLogger.Level.Info); //FillFromObjects(); CompasLogger.Add(String.Format("p25"), CompasLogger.Level.Info); FillCurrencies(); CompasLogger.Add(String.Format("p26"), CompasLogger.Level.Info); FillDetails(); CompasLogger.Add(String.Format("p27"), CompasLogger.Level.Info); FillTeams(); CompasLogger.Add(String.Format("p28"), CompasLogger.Level.Info); FillEmployees(); CompasLogger.Add(String.Format("p29"), CompasLogger.Level.Info); FillCategories(); FillCarInfo(); FillEnterprises(); if (mode == "new") { DateDE.EditValue = DateTime.Now; //CurrencyLUE.EditValue = CurrencyLUE. } ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager); ConfigurationParameter param0 = config.Get(ParametersLogic.Parameter.DOCUMENT_TYPE.ToString()); if (param0 != null) { int value = Convert.ToInt32(param0.Value); DocumentTypeLUE.EditValue = value; } ConfigurationParameter param1 = config.Get(ParametersLogic.Parameter.DOCUMENT_TYPE_ENABLED.ToString()); if (param1 != null) { DocumentTypeLUE.Enabled = false; } ConfigurationParameter param2 = config.Get(ParametersLogic.Parameter.DOCUMENT_CAR_DEFAULT_CATEGORY.ToString()); if (param2 != null) { int value = Convert.ToInt32(param2.Value); foreach (object a in CarCategoriesCB.Items) { if (((CWCategory)a).ID == value) { CarCategoriesCB.SelectedItem = a; } } } ConfigurationParameter param3 = config.Get(ParametersLogic.Parameter.DOCUMENT_CAR_VISIBLE.ToString()); if (param3 != null) { CarGB.Visible = Helpers.ConfigDataTypeConverter.ConvertToBoolean(param3.Value); } ConfigurationParameter param4 = config.Get(ParametersLogic.Parameter.DOCUMENT_CURRENCY.ToString()); if (param4 != null) { int value = Convert.ToInt32(param4.Value); CurrencyLUE.EditValue = value; } ConfigurationParameter param5 = config.Get(ParametersLogic.Parameter.DOCUMENT_CURRENCY_ENABLED.ToString()); if (param5 != null) { CurrencyLUE.Enabled = Helpers.ConfigDataTypeConverter.ConvertToBoolean(param5.Value); } ConfigurationParameter param6 = config.Get(ParametersLogic.Parameter.DOCUMENT_DATE_ENABLED.ToString()); if (param6 != null) { DateDE.Enabled = Helpers.ConfigDataTypeConverter.ConvertToBoolean(param6.Value); } ConfigurationParameter param7 = config.Get(ParametersLogic.Parameter.DOCUMENT_FROM_OBJECT.ToString()); if (param7 != null) { int value = Convert.ToInt32(param7.Value); FromObjectLUE.EditValue = value; } ConfigurationParameter param8 = config.Get(ParametersLogic.Parameter.DOCUMENT_FROM_OBJECT_ENABLED.ToString()); if (param8 != null) { FromObjectLUE.Enabled = Helpers.ConfigDataTypeConverter.ConvertToBoolean(param8.Value); } ConfigurationParameter param9 = config.Get(ParametersLogic.Parameter.DOCUMENT_TO_OBJECT.ToString()); if (param9 != null) { int value = Convert.ToInt32(param9.Value); ToObjectLUE.EditValue = value; } ConfigurationParameter param10 = config.Get(ParametersLogic.Parameter.DOCUMENT_TO_OBJECT_ENABLED.ToString()); if (param10 != null) { ToObjectLUE.Enabled = Helpers.ConfigDataTypeConverter.ConvertToBoolean(param10.Value); } ConfigurationParameter param11 = config.Get(ParametersLogic.Parameter.DOCUMENT_PARAMETERS_IN_DOCUMENTDATA_VISIBLE.ToString()); if (param11 != null) { if (Helpers.ConfigDataTypeConverter.ConvertToBoolean(param11.Value) == false) { splitContainerControl1.Panel1.Visible = Helpers.ConfigDataTypeConverter.ConvertToBoolean(param11.Value); splitContainerControl1.Panel1.Width = 1; splitContainerControl1.SplitterPosition = 0; } } if (mode == "edit") { if (document.DocumentTypeID != null) { DocumentTypeLUE.EditValue = document.DocumentTypeID; } ContractorLUE.EditValue = document.ContractorID; NumberTE.Text = document.Number; if (document.Date != null) { DateDE.DateTime = Convert.ToDateTime(document.Date); } if (document.FromStructureObjectID != null) { FromObjectLUE.EditValue = document.FromStructureObjectID; } if (document.ToStructureObjectD != null) { ToObjectLUE.EditValue = document.ToStructureObjectD; } if (document.CurrencyID != null) { CurrencyLUE.EditValue = document.CurrencyID; } DescriptionTE.Text = document.Description; AddressTE.Text = document.Address; if (document.EnterpriseID != null) { EnterprisesCB.SelectedValue = document.EnterpriseID; } } }
private void FillDataGV() { Compas.Logic.Config.ConfigurationParametersLogic configurationsLogic = new ConfigurationParametersLogic(manager); ListToDataTable listToDataTable = new ListToDataTable(); DataGV.AutoGenerateColumns = false; DataGV.DataSource = listToDataTable.ToDataTable<ViewConfigurationParameter>(configurationsLogic.GetAllView()); DgvFilterManager filterManager = new DgvFilterManager(DataGV); DataGV.Update(); }
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 Fill() { Logic.Config.ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager); int modeId = ((SecurityMode)(ModesCB.SelectedItem)).ID; var parameterPortNumber = config.Get(installationId, Convert.ToInt32(modeId), Logic.Config.ParametersLogic.Parameter.CASHREGISTER_PORTNUMBER.ToString()); var parameterLogicNumber = config.Get(installationId, Convert.ToInt32(modeId), Logic.Config.ParametersLogic.Parameter.CASHREGISTER_LOGICNUMBER.ToString()); var parameterUser = config.Get(installationId, Convert.ToInt32(modeId), Logic.Config.ParametersLogic.Parameter.CASHREGISTER_USER.ToString()); var parameterPassword = config.Get(installationId, Convert.ToInt32(modeId), Logic.Config.ParametersLogic.Parameter.CASHREGISTER_PASSWORD.ToString()); if (parameterPortNumber != null) PortNumberTB.Text = parameterPortNumber.Value; else PortNumberTB.Text = ""; if (parameterLogicNumber != null) LogicNumberTB.Text = parameterLogicNumber.Value; else LogicNumberTB.Text = ""; if (parameterUser != null) UserTB.Text = parameterUser.Value; else UserTB.Text = ""; if (parameterPassword != null) PasswordTB.Text = parameterPassword.Value; else PasswordTB.Text = ""; }
private void SaveBt_Click(object sender, EventArgs e) { ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager); int modeId; int? userId; string parameter; string value; string comment; modeId = Convert.ToInt32(ModeCB.SelectedValue); userId = Convert.ToInt32(UsersCB.SelectedValue); parameter = ParametersCB.SelectedValue.ToString(); value = ValueTB.Text; comment = CommentTB.Text; if (userId <= 0) userId = null; if (mode == "new") { config.Create(modeId, userId, parameter, value, comment); } if (mode == "edit") { config.Update(Convert.ToInt32(id), modeId, userId, parameter, value, comment); } manager.Save(); this.Close(); //WareDiscountsLogic discounts = new WareDiscountsLogic(manager); //int discountTypeId = Convert.ToInt32(DiscountTypesCB.SelectedValue); //string name = NameTB.Text; //bool active = ActiveCB.Checked; //decimal defaultDiscountPercent = DefaultDiscountPercentNUD.Value; //if (mode == "new") //{ // discounts.Create(name, active, discountTypeId, defaultDiscountPercent); //} //if (mode == "edit") //{ // discounts.Update(Convert.ToInt32(id), name, active, discountTypeId, defaultDiscountPercent); //} //manager.Save(); //this.Close(); }
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(); }