Beispiel #1
0
        static public string Create_CoinXML(Project.Coin coin)
        {
            string result = "<Coin>";

            result += "<Nominal>" + coin.Nominal + "</Nominal>";
            result += "<Tenor>" + coin.DebtTenor + "</Tenor>";
            result += "<RateCP>" + coin.RateDuringCP + "</RateCP>";
            result += "<RateAfterCP>" + coin.RateAfterCP + "</RateAfterCP>";
            result += "<Conversion>" + coin.Conversion + "</Conversion>";
            result += "<Frequency>" + coin.Frequency + "</Frequency>";
            result += "<IssuanceCost>" + coin.IssuanceCost + "</IssuanceCost>";
            result += "<Bullet>" + coin.IsBullet + "</Bullet>";
            result += "<PayEquity>" + coin.PayEqtyInterestDuringCP + "</PayEquity>";
            result += "<PortionEquity>" + coin.PortionPayingEqty + "</PortionEquity>";
            result += "<LastDividend>" + coin.LastDividend + "</LastDividend>";
            result += "<MinDivIncrease>" + coin.MinDivIncrease + "</MinDivIncrease>";

            result += "</Coin>";

            return(result);
        }
Beispiel #2
0
 static public BasicErrors DoBasicChecks(double ConcP, int CP, int Delay, Project.Coin coin, Project.EquityData equityData)
 {
     if (CP / 12.0 > ConcP)
     {
         return(BasicErrors.ConstructionPeriod_Bigger_ConcP);
     }
     if (CP < Delay)
     {
         return(BasicErrors.ConstructionPeriod_Smaller_Delay);
     }
     if ((CP + Delay) / 12.0 > ConcP)
     {
         return(BasicErrors.ConstructionPeriodAndDelay_Bigger_ConcP);
     }
     if (coin.DebtTenor < (CP + Delay) / 12)
     {
         return(BasicErrors.CoinGP_Bigger_Tenor);
     }
     if (equityData.Interest > coin.RateDuringCP)
     {
         return(BasicErrors.OtherInvestorEquity_Bigger_CoinInterest);
     }
     return(BasicErrors.NoError);
 }
Beispiel #3
0
        static public Project.Coin GetData_FromCoinXML(string strXML)
        {
            Project.Coin result = new Project.Coin();

            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.LoadXml(strXML);

            XmlNode BasicParam = xmlDoc.GetElementsByTagName("Coin").Item(0);

            XmlNodeList InnerParams = BasicParam.ChildNodes;

            for (int i = 0; i < InnerParams.Count; i++)
            {
                if (InnerParams[i].Name.Equals("Nominal"))
                {
                    result.Nominal = ToDouble(InnerParams[i].InnerText);
                }
                if (InnerParams[i].Name.Equals("Tenor"))
                {
                    result.DebtTenor = ToDouble(InnerParams[i].InnerText);
                }
                if (InnerParams[i].Name.Equals("RateCP"))
                {
                    result.RateDuringCP = ToDouble(InnerParams[i].InnerText);
                }
                if (InnerParams[i].Name.Equals("RateAfterCP"))
                {
                    result.RateAfterCP = ToDouble(InnerParams[i].InnerText);
                }
                if (InnerParams[i].Name.Equals("Conversion"))
                {
                    result.Conversion = ToDouble(InnerParams[i].InnerText);
                }
                if (InnerParams[i].Name.Equals("Frequency"))
                {
                    switch (InnerParams[i].InnerText)
                    {
                    case "Quarterly":
                        result.Frequency = Project.Frequency.Quarterly;
                        break;

                    case "Semi Annually":
                        result.Frequency = Project.Frequency.SemiAnnually;
                        break;

                    case "SemiAnnually":
                        result.Frequency = Project.Frequency.SemiAnnually;
                        break;

                    case "Annually":
                        result.Frequency = Project.Frequency.Annually;
                        break;
                    }
                }
                if (InnerParams[i].Name.Equals("IssuanceCost"))
                {
                    result.IssuanceCost = ToDouble(InnerParams[i].InnerText);
                }
                if (InnerParams[i].Name.Equals("Bullet"))
                {
                    result.IsBullet = Convert.ToBoolean(InnerParams[i].InnerText);
                }
                if (InnerParams[i].Name.Equals("PayEquity"))
                {
                    result.PayEqtyInterestDuringCP = Convert.ToBoolean(InnerParams[i].InnerText);
                }
                if (InnerParams[i].Name.Equals("PortionEquity"))
                {
                    result.PortionPayingEqty = ToDouble(InnerParams[i].InnerText);
                }
                if (InnerParams[i].Name.Equals("LastDividend"))
                {
                    result.LastDividend = ToDouble(InnerParams[i].InnerText);
                }
                if (InnerParams[i].Name.Equals("MinDivIncrease"))
                {
                    result.MinDivIncrease = ToDouble(InnerParams[i].InnerText);
                }
            }

            return(result);
        }