Пример #1
0
        public void ConvertToRoman(int number, string roman)
        {
            var    ConvertNumbers = new ConvertNumbers();
            string result         = ConvertNumbers.NumberToRoman(number);

            Assert.Equal(roman, result);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="rpStockIn"/> class.
 /// </summary>
 /// <param name="qt">The qt<see cref="List{QuoationItem}"/>.</param>
 /// <param name="sup">The sup<see cref="string"/>.</param>
 /// <param name="rp">The rp<see cref="string"/>.</param>
 /// <param name="name">The name<see cref="string"/>.</param>
 /// <param name="number">The number<see cref="string"/>.</param>
 public rpStockIn(/*QuoationItems LS*/List<QuoationItem>qt, string sup,string rp,string name,string number)
 {
     InitializeComponent();
     objectDataSource1.DataSource = qt /*LS*/;
     xrLabel16.Text = sup;
     xrLabel50.Text = rp;
     xrLabel52.Text = name;
     xrLabel54.Text = number;        
     foreach (QuoationItem i in qt)
     {
         total += i.ActualNumber * i.UnitPrice;
     }
     xrLabel55.Text = ConvertNumbers.ChuyenSoSangChuoi(double.Parse(total.ToString()));
 }
Пример #3
0
 public rpStockOut(List <POItem> qt, string cus, string name, string rp, string number)
 {
     InitializeComponent();
     objectDataSource1.DataSource = qt;
     xrLabel8.Text  = cus;
     xrLabel46.Text = name;
     xrLabel45.Text = rp;
     xrLabel55.Text = number;
     foreach (POItem i in qt)
     {
         total += i.ActualNumber * int.Parse(i.UnitPrice.ToString());
     }
     xrLabel56.Text = ConvertNumbers.ChuyenSoSangChuoi(double.Parse(total.ToString()));
 }
        public string ConvertNumbersToWords(decimal numberValue)
        {
            string[] strNUmber    = numberValue.ToString().Split('.');
            string   returnString = "";
            long     lngDollers   = 0;
            long     lngcents     = 0;

            if (strNUmber.Length > 1)
            {
                lngDollers = Convert.ToInt64(strNUmber[0]);
                lngcents   = Convert.ToInt32(strNUmber[1]);
            }
            else if (strNUmber.Length > 0)
            {
                lngDollers = Convert.ToInt64(strNUmber[0]);
            }
            if (lngcents.ToString().Length == 1)
            {
                if (lngcents > 10)
                {
                    lngcents = lngcents * 10;
                }
            }
            returnString = ConvertNumbers.ToWords(lngDollers);;
            returnString = returnString + " DOLLARS ";
            if (lngcents > 0)
            {
                string strCents = strNUmber[1];
                if (strCents[0] == '0')
                {
                    returnString = returnString + " " + "ZERO " + ConvertNumbers.ToWords(lngcents) + " CENTS ";
                }
                else
                {
                    returnString = returnString + " " + ConvertNumbers.ToWords(lngcents) + " CENTS ";
                }
            }

            return(returnString);
        }