Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Enums.Days d = Enums.Days.Friday;

            string today = d.ToString();

            List <Student> StudentsList = new List <Student>();
            Student        s1           = new Student("Moshe", 20);

            Console.WriteLine(s1);

            DateTime date1 = DateTime.Now;
            DateTime date2 = new DateTime(2011, 10, 05);

            if (date1.DayOfWeek == (DayOfWeek)((int)d) - 1)
            {
                Console.WriteLine("Shabat Shaolm");
            }
            switch (d)
            {
            case Enums.Days.Sunday:
                Console.WriteLine("Shavua Tov");
                break;

            case Enums.Days.Monday:
                Console.WriteLine("Shiur C#");
                break;

            case Enums.Days.Friday:
                Console.WriteLine("Shabat Shaolm");
                break;

            default:
                Console.WriteLine("Tomorrow is another day");
                break;
            }

            TimeSpan t    = date1 - date2;
            string   str2 = "32 13 15";

            try
            {
                int i = Int32.Parse(str2);
                //int[] myInts = Convert.
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            var Person = new
            {
                Id         = 1234,
                personName = "oshri"
            };
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create query to get currency value from the CB site
        /// </summary>
        /// <param name="currency">Type of the currency</param>
        /// <param name="days">Query period</param>
        /// <returns>Query string</returns>
        private static string BuildCbUrl(string currency, Enums.Days days)
        {
            string curCode;

            switch (currency)
            {
            case Currencies.USD: curCode = "R01235";
                break;

            case Currencies.EUR: curCode = "R01239";
                break;

            default: curCode = "R01235";
                break;
            }

            var today     = DateTime.Now;
            var tillDate  = today.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture);
            var sinceDate = today.AddDays((int)days).ToString("dd/MM/yyyy", CultureInfo.InvariantCulture);

            return(string.Format(
                       "http://www.cbr.ru/scripts/XML_dynamic.asp?date_req1={0}&date_req2={1}&VAL_NM_RQ={2}", sinceDate, tillDate, curCode));
        }
Exemplo n.º 3
0
 public Magazine(string title, Enums.Days releaseDay, double price, int count) : base(title, price, count)
 {
     ReleaseDay = releaseDay;
 }
Exemplo n.º 4
0
 public Magazine(string title, Enums.Days releaseDay, double price) : base(title, price)
 {
     this.releaseDay = releaseDay;
 }