Exemplo n.º 1
0
        public void moharram_1399()
        {
            var d1  = new PersianDateTime(1401, 5, 16);
            var str = d1.GetDateData();

            Assert.True(d1.IsHoliDay && d1.DateMetaDatas.Any(d => d.DateType == DateType.HoliDay));
        }
Exemplo n.º 2
0
        public void CheckHoliDays()
        {
            var d1  = new PersianDateTime(1397, 3, 14);
            var str = d1.GetDateData();

            Assert.True(d1.IsHoliDay);
            //var x2 = PersianDateTime.GetLongHoliDays(1398);
        }
Exemplo n.º 3
0
        private void DateTimeForm2_Load(object sender, EventArgs e)
        {
            var info = PersianDateTime.GetDateData(DateTime.Now);

            lblTodayMonasebat.Text      = info;
            lblTodayMonasebat.BackColor = Color.Blue;



            lblHolidayTomarow.Font = new Font(lblHolidayTomarow.Font.FontFamily, (tableLayoutPanel1.Height / 6) + 7);
            lblTodayMonasebat.Font = new Font(lblTodayMonasebat.Font.FontFamily, (tableLayoutPanel1.Height / 6) + 7);
            var tomarow = new PersianDateTime(DateTime.Now.AddDays(1));

            if (tomarow.IsHoliDay)
            {
                lblHolidayTomarow.Text      = "فردا تعطیل است";
                lblHolidayTomarow.BackColor = Color.Red;
            }
            else
            {
                lblHolidayTomarow.Text      = "فردا تعطیل نیست";
                lblHolidayTomarow.BackColor = Color.Pink;
            }
        }
Exemplo n.º 4
0
        private void NextItem()
        {
            string[] monasebat = PersianDateTime.GetDateData(DateTime.Now).Split(' ');



            if (step >= monasebat.Length)
            {
                part = 1000000;

                if (part == 1)
                {
                    var nowdate = PersianDateTime.Now;
                    if (nowdate.IsHoliDay)
                    {
                        lblDayofWeek.Text = "امروز";
                        lblDateFull.Text  = "تعطیل";
                        lbl3.Text         = "است";
                    }
                    else
                    {
                        lblDayofWeek.Text = "امروز";
                        lblDateFull.Text  = "تعطیل";
                        lbl3.Text         = "نیست";
                    }
                }
                else if (part == 2)
                {
                    var nowdat = PersianDateTime.Now.AddDays(1);
                    if (nowdat.IsHoliDay)
                    {
                        lblDayofWeek.Text = "فردا";
                        lblDateFull.Text  = "تعطیل";
                        lbl3.Text         = "است";
                    }
                    else
                    {
                        lblDayofWeek.Text = "فردا";
                        lblDateFull.Text  = "تعطیل";
                        lbl3.Text         = "نیست";
                    }
                }
                else if (part == 3)
                {
                }
                else
                {
                    this.Close();
                    this.Dispose();
                }
            }
            else
            {
                if (part >= 3)
                {
                    part = 3;
                }
                else
                {
                    part++;
                }
                if (part == 1)
                {
                    var nowdate = PersianDateTime.Now;
                    if (nowdate.IsHoliDay)
                    {
                        lblDayofWeek.Text = "امروز";
                        lblDateFull.Text  = "تعطیل";
                        lbl3.Text         = "است";
                    }
                    else
                    {
                        lblDayofWeek.Text = "امروز";
                        lblDateFull.Text  = "تعطیل";
                        lbl3.Text         = "نیست";
                    }
                }
                else if (part == 2)
                {
                    var nowdat = PersianDateTime.Now.AddDays(1);
                    if (nowdat.IsHoliDay)
                    {
                        lblDayofWeek.Text = "فردا";
                        lblDateFull.Text  = "تعطیل";
                        lbl3.Text         = "است";
                    }
                    else
                    {
                        lblDayofWeek.Text = "فردا";
                        lblDateFull.Text  = "تعطیل";
                        lbl3.Text         = "نیست";
                    }
                }
                else if (part == 3)
                {
                    part = 3;
                    if (monasebat[step] != "")
                    {
                        lblDayofWeek.Text = monasebat[step];
                    }
                    else
                    {
                        step++;
                        if (step >= monasebat.Length)
                        {
                            this.Close();
                            this.Dispose();
                            return;
                        }
                        else
                        {
                            lblDayofWeek.Text = monasebat[step];
                        }
                    }

                    step++; if (step >= monasebat.Length)
                    {
                        this.DialogResult = DialogResult.OK;
                        this.Close();

                        this.Dispose();
                        return;
                    }

                    if (monasebat[step] != "")
                    {
                        lblDateFull.Text = monasebat[step];
                    }
                    else
                    {
                        step++; lblDateFull.Text = monasebat[step];
                    }

                    step++; if (step >= monasebat.Length)
                    {
                        this.Close();
                        this.Dispose();
                    }


                    if (monasebat[step] != "")
                    {
                        lbl3.Text = monasebat[step];
                    }
                    else
                    {
                        step++;
                        lbl3.Text = monasebat[step];
                    }

                    step++;
                    if (step >= monasebat.Length)
                    {
                        this.Close();
                        this.Dispose();
                        return;
                    }
                    if (monasebat[step] != "")
                    {
                        lbl4.Text = monasebat[step];
                    }
                    else
                    {
                        step++;
                        lbl4.Text = monasebat[step];
                    }

                    step++;
                    if (step >= monasebat.Length)
                    {
                        this.Close();
                        this.Dispose();
                    }
                }
            }
        }