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;
                }
                }
            }
        }
Beispiel #2
0
        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;
                }
            }
        }
Beispiel #3
0
        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;
                }
            }
        }
Beispiel #4
0
        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 = "";
            }
        }
Beispiel #5
0
        /// <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;
            }
        }
Beispiel #6
0
        /// <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;
                }
            }
        }
Beispiel #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();
        }
Beispiel #8
0
        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 = "";
        }
Beispiel #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();
        }