예제 #1
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 Dictionary <string, string> GetValue(ConfigurationParameter _paramName)
 {
     try
     {
         Dictionary <string, string> result = new Dictionary <string, string>();
         XmlNodeList parameterElement       = _xmlDoc.GetElementsByTagName(_paramName.ToString());
         foreach (XmlNode node in parameterElement[0].ChildNodes)
         {
             if (node.NodeType != XmlNodeType.Comment)
             {
                 result.Add(node.Attributes["Name"].Value, node.InnerText);
             }
         }
         return((Dictionary <string, string>)result);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message + " (Configuration)");
     }
 }