Exemplo n.º 1
0
        public void ReadSettingsFromNode(XmlNode Node, ReportType Type)
        {
            try
            {
                SettingsNode = Node;
                this.Type    = Type;

                String Value;
                XMLFileUtils.GetChildNodeValue(SettingsNode, "HeaderTitle", out HeaderTitle);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "HeaderSubTitle", out HeaderSubTitle);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "FooterTitle", out FooterTitle);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "Address", out Address);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "PhoneNumber", out PhoneNumber);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "EMailID", out EMailID);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "VATPercent", out VATPercent);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "TINNumber", out TINNumber);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "GSTINumber", out GSTINumber);

                if (XMLFileUtils.GetChildNodeValue(SettingsNode, "LastNumber", out Value))
                {
                    LastNumber = Int32.Parse(Value);
                }

                if (XMLFileUtils.GetChildNodeValue(SettingsNode, "HeaderTitleColor", out Value))
                {
                    HeaderTitleColor = CommonFunctions.GetColor(Value);
                }
                if (XMLFileUtils.GetChildNodeValue(SettingsNode, "HeaderSubTitleColor", out Value))
                {
                    HeaderSubTitleColor = CommonFunctions.GetColor(Value);
                }
                if (XMLFileUtils.GetChildNodeValue(SettingsNode, "FooterTitleColor", out Value))
                {
                    FooterTitleColor = CommonFunctions.GetColor(Value);
                }
                if (XMLFileUtils.GetChildNodeValue(SettingsNode, "FooterTextColor", out Value))
                {
                    FooterTextColor = CommonFunctions.GetColor(Value);
                }
                XmlNode PastSalesPeriodNode;
                if (XMLFileUtils.GetChildNode(SettingsNode, "PastSalesPeriod", out PastSalesPeriodNode))
                {
                    if (XMLFileUtils.GetChildNodeValue(PastSalesPeriodNode, "Value", out Value))
                    {
                        PastSalePeriodValue = Int32.Parse(Value);
                    }
                    if (XMLFileUtils.GetChildNodeValue(PastSalesPeriodNode, "Units", out Value))
                    {
                        PastSalePeriodUnits = GetTimePeriodUnits(Value);
                    }
                }
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("ReportSettings.ReadSettingsFromNode()", ex);
            }
        }