public MainPresenter(MainView mainView, BookingRequestFactory bookingFactory, TodayDate todayDate)
 {
     this.mainView       = mainView;
     this.bookingFactory = bookingFactory;
     this.todayDate      = todayDate;
     mainView.BookSeats += OnBookSeats;
 }
        private void ValidateDate(TodayDate today, Notification note)
        {
            if (dateOfThePerformance == null)
            {
                note.AddError("date is missing");
                return;
            }

            DateTime parsedDate;

            try
            {
                parsedDate = DateTime.Parse(dateOfThePerformance);
            }
            catch (System.FormatException e)
            {
                note.AddError("Invalid format for date", e);
                return;
            }

            if (parsedDate.IsBefore(today.Date))
            {
                note.AddError("date cannot be before today");
            }
        }
        public IActionResult Index()
        {
            var model = new TodayDate {
                daynow = DateTime.Today,
            };

            return(View(model));
        }
        public void When_the_number_of_seats_is_not_positive_then_an_ArgumentOutOfRangeException_is_thrown(string seatsNumber)
        {
            TodayDate today = Substitute.For <Today>();

            today.Date.Returns(DateTime.Parse("1111-01-01"));

            SimpleBookingRequest bookingRequest = new SimpleBookingRequest(seatsNumber, bookingDate: "2222-01-01");

            Assert.AreEqual("number of seats must be positive", bookingRequest.Validation(today).ErrorMessage);
        }
        public Notification Validation(TodayDate today)
        {
            Notification note = new Notification();

            ValidateDate(today, note);

            ValidateNumberOfSeats(note);

            return(note);
        }
        public void When_the_number_of_seats_is_null_then_an_ArgumentNullException_is_thrown()
        {
            TodayDate today = Substitute.For <Today>();

            today.Date.Returns(DateTime.Parse("1111-01-01"));

            SimpleBookingRequest bookingRequest = new SimpleBookingRequest(numberOfSeats: string.Empty, bookingDate: "2222-01-01");

            Assert.AreEqual("number of seats cannot be empty", bookingRequest.Validation(today).ErrorMessage);
        }
        public void When_the_booking_date_is_before_today_date_then_an_ArgumentOutOfRangeException_is_thrown()
        {
            TodayDate today = Substitute.For <Today>();

            today.Date.Returns(DateTime.Parse("2222-01-01"));

            SimpleBookingRequest bookingRequest = new SimpleBookingRequest(numberOfSeats: "1", bookingDate: "1111-01-01");

            Assert.AreEqual("date cannot be before today", bookingRequest.Validation(today).ErrorMessage);
        }
        public void When_the_date_is_in_wrong_format_then_an_ArgumentOutOfRangeException_is_thrown()
        {
            TodayDate today = Substitute.For <Today>();

            today.Date.Returns(DateTime.Parse("1111-01-01"));

            SimpleBookingRequest bookingRequest = new SimpleBookingRequest("1", "wrong_format_date");

            Assert.AreEqual("Invalid format for date", bookingRequest.Validation(today).ErrorMessage);
        }
        public void When_the_date_is_missing_then_an_ArgumentNullException_is_thrown()
        {
            TodayDate today = Substitute.For <Today>();

            today.Date.Returns(DateTime.Parse("1111-01-01"));

            SimpleBookingRequest bookingRequest = new SimpleBookingRequest("1", null);

            ;           Assert.AreEqual("date is missing", bookingRequest.Validation(today).ErrorMessage);
        }
Exemple #10
0
        public void TestContent()
        {
            CastDate currentDate = new CastDate {
                Time = 1484953200000
            };
            ReportData reportData = TestUtility.PrepareApplicationReportData("ReportGenerator",
                                                                             null, @".\Data\CurrentBCresults.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2", currentDate,
                                                                             null, null, null, null, null, null);

            var component = new TodayDate();
            Dictionary <string, string> config = new Dictionary <string, string>();
            var str       = component.Content(reportData, config);
            var todaydate = DateTime.Now.ToString("MMM dd yyyy");

            Assert.AreEqual(todaydate, str);
        }
    private void LoadData()
    {
        try
        {
            TodayDate = System.DateTime.Now.ToLongDateString();
            DataTable dtDet = new DataTable();
            _obj_Smhr_joboffers = new SMHR_JOBOFFERS();
            _obj_Smhr_joboffers.APPLICANT_ID = Convert.ToInt32(Session["Applicant"].ToString());
            dtDet = BLL.GetApplicantDetails(_obj_Smhr_joboffers);
            if (dtDet.Rows.Count != 0)
            {
                AppName = dtDet.Rows[0][2].ToString() + " " + dtDet.Rows[0][3].ToString() + " " + dtDet.Rows[0][4].ToString() + " " + dtDet.Rows[0][5].ToString();
                Name    = dtDet.Rows[0][3].ToString();
            }
            body = "<html> " +
                   "<head> " +
                   "</head> " +
                   "<body> " +
                   "<table style='width: 640px' border='0' cellspacing='0' cellpadding='0'> " +
                   "<tr> " +
                   "<td colspan='3'> " +
                   "     <strong><span style='font-size: 10pt; font-family: Arial'>Ph no: 040 30586061 &nbsp; " +
                   "         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; " +
                   "         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; " +
                   "         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; " +
                   "        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Fax No : 040 30586064</span></strong></td> " +
                   "</tr> " +
                   "<tr> " +
                   "<td style='width: 95px'> " +
                   "</td> " +
                   "<td rowspan='2' style='width: 9px; text-align: left'> " +
                   "<img src='EmpUploads/54_LOGO_DHANUSH.png' /></td> " +
                   "<td> " +
                   "</td> " +
                   "</tr> " +
                   "<tr> " +
                   "<td style='width: 95px'> " +
                   "</td> " +
                   "<td> " +
                   "</td> " +
                   "</tr> " +
                   "<tr> " +
                   "<td colspan='3'> " +
                   "<hr /> " +
                   "</td> " +
                   "</tr> " +
                   "<tr> " +
                   "<td style='width: 95px'> " +
                   "</td> " +
                   "<td style='width: 9px'> " +
                   "</td> " +
                   "<td> " +
                   "</td> " +
                   "</tr> " +
                   "<tr> " +
                   " <td colspan='2'> " +
                   "     <span style='font-size: 10pt; font-family: Arial'><strong>&nbsp;Date : " + TodayDate.ToString() + " </strong></span></td> " +
                   " <td> " +
                   " </td> " +
                   " </tr> " +
                   " <tr> " +
                   "    <td style='width: 95px'> " +
                   "   </td> " +
                   "   <td style='width: 9px'> " +
                   "   </td> " +
                   "   <td> " +
                   "   </td> " +
                   "</tr> " +
                   " <tr> " +
                   "    <td style='width: 95px'> " +
                   "        <strong><span style='font-size: 10pt; font-family: Arial'>&nbsp;To,</span></strong></td> " +
                   "    <td> " +

                   "    </td> " +
                   "    <td> " +

                   "    </td> " +
                   "</tr> " +
                   "<tr> " +
                   "   <td colspan='2' rowspan='4'> " +
                   "<strong><span style='font-size: 10pt; font-family: Arial'> " + AppName.ToString() + "<br/> " +
                   " Hyderabad, Andhra Pradesh. <br/><br/><br/> </span></strong>" +
                   "   </td> " +
                   "  <td>" +
                   "  </td> " +
                   "</tr> " +
                   "<tr> " +
                   "    <td> " +
                   "   </td> " +
                   " </tr> " +
                   " <tr> " +
                   "    <td> " +
                   "    </td> " +
                   "</tr> " +
                   "<tr> " +
                   "   <td> " +
                   "    </td> " +
                   "</tr> " +
                   "<tr> " +
                   "    <td style='width: 95px'> " +
                   "    </td> " +
                   "    <td style='width: 9px'> " +
                   "    </td> " +
                   "    <td> " +
                   "    </td> " +
                   "</tr> " +
                   "<tr> " +
                   "   <td colspan='2'> " +
                   "        <strong><span style='font-size: 10pt; font-family: Arial'>&nbsp;Dear " + Name.ToString() + " </span></strong> " +
                   "   </td> " +
                   "   <td> " +
                   "   </td> " +
                   "</tr> " +
                   "<tr> " +
                   "   <td colspan='2'> " +
                   "      <strong><span style='font-size: 10pt; font-family: Arial'>&nbsp;Sub : Offer Letter</span></strong></td> " +
                   "  <td> " +
                   "  </td> " +
                   "</tr> " +
                   "<tr> " +
                   "   <td colspan='2' rowspan='2'> " +
                   "      <br /> " +
                   "     <br /> " +
                   " </td> " +
                   " <td> " +
                   " </td> " +
                   "</tr> " +
                   "<tr> " +
                   "   <td> " +
                   "  </td> " +
                   "</tr> " +
                   "<tr> " +
                   "<td colspan='3' rowspan='2' style='height: 186px; text-align: justify'> " +
                   "   <strong><span style='font-size: 10pt; font-family: Arial'>It is our pleasure to extend " +
                   "      a job offer to you as an Associate Consultant. Your Monthly CTC will be in Indian " +
                   "     Rupees Rs. 10000 only and is subject to all required taxes and withholding.<br /> " +
                   "    <br /> " +
                   "    You will also be entitled to benefits extended by Dhanush InfoTech Pvt Ltd.<br /> " +
                   "    <br /> " +
                   "    We would like you to start work from&nbsp; onwards. You will be workin from our " +
                   "     Hyderabad Office.<br /> " +
                   "    <br /> " +
                   "   Please review the job offer letter, and if you decide to accept the offer, give " +
                   "  us a signed " +
                   "   <br /> " +
                   "    acknowledgement of your acceptance. Before you begin work, you will also be required " +
                   "     to sign a<br /> " +
                   "          Standard employment letter.<br /> " +
                   "         <br /> " +
                   "        We Look forward to you joining the company and become a productive member of the " +
                   "     team.</span></strong></td> " +
                   "  </tr> " +
                   "  <tr> " +
                   "  </tr> " +
                   "  <tr> " +
                   " <td style='width: 95px'> " +
                   "   <br /> " +
                   "    <br /> " +
                   " </td> " +
                   " <td style='width: 9px'> " +
                   "  </td> " +
                   "   <td> " +
                   "    </td> " +
                   " </tr> " +
                   "<tr> " +
                   " <td style='width: 95px'> " +
                   "     <strong><span style='font-size: 10pt; font-family: Arial'>Sincerely,</span></strong></td> " +
                   " <td style='width: 9px'> " +
                   " </td> " +
                   "  <td> " +
                   "   </td> " +
                   "</tr> " +
                   "<tr> " +
                   " <td style='width: 95px'> " +
                   " </td> " +
                   " <td style='width: 9px'> " +
                   " </td> " +
                   "  <td> " +
                   "   </td> " +
                   "</tr> " +
                   "<tr> " +
                   "    <td style='width: 95px'> " +
                   "         <strong><span style='font-size: 10pt; font-family: Arial'>HR Manager</span></strong></td> " +
                   "      <td style='width: 9px'> " +
                   "       </td> " +
                   "        <td> " +
                   "         </td> " +
                   "      </tr> " +
                   "   </table> " +
                   "</div> " +
                   "</body> " +
                   "</html>";
            EditorOffer.Content = body;

            //  ContentBody.InnerHtml = body;
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_recruit_offerletter", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Exemple #12
0
        // ---------------------------------------------------------------------
        protected override void OnPaint(PaintEventArgs pe)
        {
            var month       = FirstOfMonth(firstMonth);
            var coordinates = border.ToPointF();

            Brush textBrush             = new SolidBrush(ForeColor);
            Brush backBrush             = new SolidBrush(BackColor);
            Brush titleTextBrush        = new SolidBrush(TitleForeColor);
            Brush titleBackBrush        = new SolidBrush(TitleBackColor);
            Brush weekdayTextBrush      = new SolidBrush(WeekdayForeColor);
            Brush weekdayBackBrush      = new SolidBrush(WeekdayBackColor);
            Brush trailingTextBrush     = new SolidBrush(TrailingForeColor);
            Brush highlightDayTextBrush = new SolidBrush(HighlightDayTextColor);
            Brush weeknumberTextBrush   = new SolidBrush(WeeknumberForeColor);
            Brush weeknumberBackBrush   = new SolidBrush(WeeknumberBackColor);
            var   boldFont = new Font(Font, FontStyle.Bold);
            var   divider  = new Pen(WeekdayBarColor);
            var   weekdays = AbbreviatedDayNames();

            var cellMiddle  = cellSize.Width * 0.5F;
            var cellMiddles = new float[weekdays.Length];

            for (var w = 0; w < weekdays.Length; ++w)
            {
                cellMiddles[w] = cellMiddle;
                cellMiddle    += cellSize.Width;
            }

            for (var y = 0; y < months.Height; ++y)
            {
                for (var x = 0; x < months.Width; ++x)
                {
                    var drawTrailing = Trailing.None;

                    if (months.Width * months.Height == 1)
                    {
                        drawTrailing = Trailing.Both;
                    }
                    else if (y == 0 && x == 0)
                    {
                        drawTrailing = Trailing.First;
                    }
                    else if (y == (months.Height - 1) &&
                             x == (months.Width - 1))
                    {
                        drawTrailing = Trailing.Last;
                    }

                    DrawMonth(
                        pe.Graphics,
                        month,
                        coordinates,
                        weekdays,
                        boldFont,
                        textBrush,
                        backBrush,
                        titleTextBrush,
                        titleBackBrush,
                        weekdayTextBrush,
                        weekdayBackBrush,
                        trailingTextBrush,
                        highlightDayTextBrush,
                        weeknumberTextBrush,
                        weeknumberBackBrush,
                        drawTrailing,
                        divider,
                        cellMiddles);

                    coordinates.X += SingleMonthSize.Width;
                    month          = month.AddMonths(1);
                }

                coordinates.X  = border.Width;
                coordinates.Y += SingleMonthSize.Height;
            }

            // Draw today string at bottom of calendar
            if (ShowToday)
            {
                displayTodayRectangle = todayRectangle;

                displayTodayRectangle.Offset(0,
                                             (months.Height - 1) * SingleMonthSize.Height);

                var todayFormat = new StringFormat();
                todayFormat.Alignment     = StringAlignment.Center;
                todayFormat.LineAlignment = StringAlignment.Center;

                pe.Graphics.DrawString(
                    "Today: " + TodayDate.ToShortDateString(),
                    boldFont, textBrush, displayTodayRectangle, todayFormat);
            }
            else
            {
                displayTodayRectangle = RectangleF.Empty;
            }

            // Dispose of resources
            textBrush.Dispose();
            backBrush.Dispose();
            titleTextBrush.Dispose();
            titleBackBrush.Dispose();
            weekdayTextBrush.Dispose();
            weekdayBackBrush.Dispose();
            trailingTextBrush.Dispose();
            highlightDayTextBrush.Dispose();
            weeknumberTextBrush.Dispose();
            weeknumberBackBrush.Dispose();
            boldFont.Dispose();
            divider.Dispose();

            base.OnPaint(pe);
        }
Exemple #13
0
        public void GetBossNextTime(string todayyear, string todaymonth, string todayday, string todayhour, string todayminute, string todayweek)
        {
            int      BTS = 0, BWS = 0;
            int      tHM  = Convert.ToInt16(thour + tminute);
            DateTime tYMD = Convert.ToDateTime(tyear + "-" + tmonth + "-" + tday);

            label1.Text = "更新時間:" + tyear + "/" + tmonth + "/" + tday + " " + thour + ":" + tminute + " " + GetWeekCht(tweek);

            //出現時間
            int[] allbosstime = { 0015, 0200, 1100, 1500, 1900, 2330 };
            string[,] bosstimecht = new string[, ]
            {
                { "00", "02", "11", "15", "19", "23" },
                { "15", "00", "00", "00", "00", "30" }
            };

            //世界王名字及圖片
            string b0 = null;
            string b1 = World_Boss_Next_Time.Properties.Settings.Default.BossName1;
            string b2 = World_Boss_Next_Time.Properties.Settings.Default.BossName2;
            string b3 = World_Boss_Next_Time.Properties.Settings.Default.BossName3;
            string b4 = World_Boss_Next_Time.Properties.Settings.Default.BossName4;
            string b5 = World_Boss_Next_Time.Properties.Settings.Default.BossName5;
            string b6 = World_Boss_Next_Time.Properties.Settings.Default.BossName6;
            string b7 = World_Boss_Next_Time.Properties.Settings.Default.BossName7;
            string b8 = World_Boss_Next_Time.Properties.Settings.Default.BossName8;
            string b9 = World_Boss_Next_Time.Properties.Settings.Default.BossName9;

            BossFilter(ref b1, ref b2, ref b3, ref b4, ref b5, ref b6, ref b7, ref b8, ref b9);

            //各時段出現種類名稱及圖片 array[出現時段,星期,王1王2]
            //BOSS:1克價卡,2庫屯,3羅裴勒,4卡嵐達,5奧平,6木拉卡,7肯恩特,8貝爾,9卡莫斯
            string[,,] bossname = new string[, , ]
            {
                //星期:日,一,二,三,四,五,六
                { { b0, b0 }, { b6, b7 }, { b0, b0 }, { b0, b0 }, { b0, b0 }, { b0, b0 }, { b9, b0 } },   //0015
                { { b3, b4 }, { b1, b2 }, { b3, b0 }, { b4, b0 }, { b2, b0 }, { b1, b3 }, { b1, b2 } },   //0200
                { { b1, b3 }, { b4, b0 }, { b1, b2 }, { b1, b3 }, { b2, b4 }, { b2, b5 }, { b2, b4 } },   //1100
                { { b8, b0 }, { b1, b2 }, { b3, b4 }, { b9, b0 }, { b1, b3 }, { b3, b4 }, { b5, b0 } },   //1500
                { { b2, b4 }, { b9, b0 }, { b8, b0 }, { b1, b2 }, { b3, b0 }, { b1, b2 }, { b1, b3 } },   //1900
                { { b5, b0 }, { b1, b2 }, { b1, b3 }, { b3, b4 }, { b2, b4 }, { b6, b7 }, { b0, b0 } }    //2330
            };
            BossStage(ref tYMD, ref BTS, ref BWS);
            BossStageAddChk(ref tYMD, ref BTS, ref BWS);
            BossListView(tYMD, BTS, BWS);
            ViewBossData(tYMD, bosstimecht[0, BTS], bosstimecht[1, BTS], BWS, bossname[BTS, BWS, 0], bossname[BTS, BWS, 1]);
            GC.Collect();


            void BossListView(DateTime lvDate, int lvBTS, int lvBWS)
            {
                listView1.Items.Clear();
                //第一項
                BossStageLess(ref lvDate, ref lvBTS, ref lvBWS);
                var    lvi = new ListViewItem(lvDate.ToString("yyyy/MM/dd"));
                string st1 = bosstimecht[0, lvBTS] + ":" + bosstimecht[1, lvBTS];
                string st2 = bossname[lvBTS, lvBWS, 0] + " " + bossname[lvBTS, lvBWS, 1];

                lvi.SubItems.Add(st1.Trim());
                lvi.SubItems.Add(st2.Trim());
                listView1.Items.Add(lvi);

                //第二項
                BossStageAdd(ref lvDate, ref lvBTS, ref lvBWS);
                lvi           = new ListViewItem(lvDate.ToString("yyyy/MM/dd"));
                st1           = bosstimecht[0, lvBTS] + ":" + bosstimecht[1, lvBTS];
                st2           = bossname[lvBTS, lvBWS, 0] + " " + bossname[lvBTS, lvBWS, 1];
                lvi.BackColor = Color.YellowGreen;
                lvi.SubItems.Add(st1.Trim());
                lvi.SubItems.Add(st2.Trim());
                listView1.Items.Add(lvi);
                listView1.Items[1].Selected = true;

                //後n項
                for (int n = 1; n <= 4; n++)
                {
                    BossStageAdd(ref lvDate, ref lvBTS, ref lvBWS);
                    lvi = new ListViewItem(lvDate.ToString("yyyy/MM/dd"));
                    st1 = bosstimecht[0, lvBTS] + ":" + bosstimecht[1, lvBTS];
                    st2 = bossname[lvBTS, lvBWS, 0] + " " + bossname[lvBTS, lvBWS, 1];
                    lvi.SubItems.Add(st1.Trim());
                    lvi.SubItems.Add(st2.Trim());
                    listView1.Items.Add(lvi);
                }
            }

            void ViewBossData(DateTime TodayDate, string bth, string btm, int week, string bn1, string bn2)
            {
                if (bn1 == null & bn2 == null)
                {
                    settingmark    = "1";
                    groupBox1.Text = null;
                }
                else
                {
                    settingmark = "0";
                    string startstring = World_Boss_Next_Time.Properties.Settings.Default.StartString;
                    string st1         = startstring + bth + btm + " " + bn1 + " " + bn2;
                    groupBox1.Text = "下次世界王時間:" + TodayDate.ToString("yyyy/MM/dd") + " " + bth + ":" + btm + " " + GetWeekCht(week.ToString());
                    textBox1.Text  = st1.Trim();
                }
            }

            void BossStage(ref DateTime TodayDate, ref int BossTimeStage, ref int BossWeekStage)
            {
                //取得日期及時段
                int TC = allbosstime.Count() - 1;

                for (int t = 1; t <= TC; t++)
                {
                    if (tHM <= allbosstime[t] && tHM > allbosstime[t - 1])
                    {
                        BossTimeStage = t;
                    }
                }
                if (tHM <= allbosstime[0])
                {
                    BossTimeStage = 0;
                }
                if (tHM > allbosstime[TC])
                {
                    TodayDate = TodayDate.AddDays(1); BossTimeStage = 0;
                }

                //取得星期
                int weeknumber = Convert.ToInt16(tweek);

                if (tHM <= allbosstime[TC])
                {
                    BossWeekStage = weeknumber;
                }
                if (tHM > allbosstime[TC])
                {
                    if (weeknumber >= 6)
                    {
                        BossWeekStage = 0;
                    }
                    else
                    {
                        BossWeekStage = weeknumber + 1;
                    }
                }
            }

            void BossStageAddChk(ref DateTime TodayDate, ref int BossTimeStage, ref int BossWeekStage)
            {
                int TC   = allbosstime.Count() - 1;
                int BNTC = (bossname.Length) / 2;

                for (int temp = 1; temp <= BNTC; temp++)
                {
                    if (bossname[BossTimeStage, BossWeekStage, 0] == null && bossname[BossTimeStage, BossWeekStage, 1] == null)
                    {
                        if (BossTimeStage >= TC)
                        {
                            TodayDate     = TodayDate.AddDays(1);
                            BossTimeStage = 0;
                            if (BossWeekStage >= 6)
                            {
                                BossWeekStage = 0;
                            }
                            else
                            {
                                BossWeekStage += 1;
                            }
                        }
                        else
                        {
                            BossTimeStage += 1;
                        }
                    }
                    if (bossname[BossTimeStage, BossWeekStage, 0] == null && bossname[BossTimeStage, BossWeekStage, 1] != null)
                    {
                        bossname[BossTimeStage, BossWeekStage, 0] = bossname[BossTimeStage, BossWeekStage, 1];
                        bossname[BossTimeStage, BossWeekStage, 1] = null;
                    }
                }
            }

            void BossStageLessChk(ref DateTime TodayDate, ref int BossTimeStage, ref int BossWeekStage)
            {
                int TC   = allbosstime.Count() - 1;
                int BNTC = (bossname.Length) / 2;

                for (int temp = 1; temp <= BNTC; temp++)
                {
                    if (bossname[BossTimeStage, BossWeekStage, 0] == null && bossname[BossTimeStage, BossWeekStage, 1] == null)
                    {
                        if (BossTimeStage == 0)
                        {
                            TodayDate     = TodayDate.AddDays(-1);
                            BossTimeStage = TC;
                            if (BossWeekStage == 0)
                            {
                                BossWeekStage = 6;
                            }
                            else
                            {
                                BossWeekStage -= 1;
                            }
                        }
                        else
                        {
                            BossTimeStage -= 1;
                        }
                    }
                    if (bossname[BossTimeStage, BossWeekStage, 0] == null && bossname[BossTimeStage, BossWeekStage, 1] != null)
                    {
                        bossname[BossTimeStage, BossWeekStage, 0] = bossname[BossTimeStage, BossWeekStage, 1];
                        bossname[BossTimeStage, BossWeekStage, 1] = null;
                    }
                }
            }

            void BossStageAdd(ref DateTime TodayDate, ref int BossTimeStage, ref int BossWeekStage)
            {
                int TC = allbosstime.Count() - 1;

                if (BossTimeStage >= TC)
                {
                    TodayDate     = TodayDate.AddDays(1);
                    BossTimeStage = 0;
                    if (BossWeekStage < 6)
                    {
                        BossWeekStage += 1;
                    }
                    else
                    {
                        BossWeekStage = 0;
                    }
                    BossStageAddChk(ref TodayDate, ref BossTimeStage, ref BossWeekStage);
                }
                else
                {
                    BossTimeStage += 1;
                    BossStageAddChk(ref TodayDate, ref BossTimeStage, ref BossWeekStage);
                }
            }

            void BossStageLess(ref DateTime TodayDate, ref int BossTimeStage, ref int BossWeekStage)
            {
                int TC = allbosstime.Count() - 1;

                if (BossTimeStage == 0)
                {
                    TodayDate     = TodayDate.AddDays(-1);
                    BossTimeStage = TC;
                    if (BossWeekStage == 0)
                    {
                        BossWeekStage = 6;
                    }
                    else
                    {
                        BossWeekStage -= 1;
                    }
                    BossStageLessChk(ref TodayDate, ref BossTimeStage, ref BossWeekStage);
                }
                else
                {
                    BossTimeStage -= 1;
                    BossStageLessChk(ref TodayDate, ref BossTimeStage, ref BossWeekStage);
                }
            }

            void BossFilter(ref string boss1, ref string boss2, ref string boss3, ref string boss4, ref string boss5, ref string boss6, ref string boss7, ref string boss8, ref string boss9)
            {
                if (b1chkbox.Checked == false)
                {
                    b1 = null;
                }
                if (b2chkbox.Checked == false)
                {
                    b2 = null;
                }
                if (b3chkbox.Checked == false)
                {
                    b3 = null;
                }
                if (b4chkbox.Checked == false)
                {
                    b4 = null;
                }
                if (b5chkbox.Checked == false)
                {
                    b5 = null;
                }
                if (b6chkbox.Checked == false)
                {
                    b6 = null;
                }
                if (b7chkbox.Checked == false)
                {
                    b7 = null;
                }
                if (b8chkbox.Checked == false)
                {
                    b8 = null;
                }
                if (b9chkbox.Checked == false)
                {
                    b9 = null;
                }
            }
        }
Exemple #14
0
        private void SetTheme()
        {
            if (IsDark)
            {
                CurrentThemeThemeNoiseColor      = Theme.WhiteTheme.ThemeColor;
                CurrentThemeThemeNoiseOpacity    = Theme.WhiteTheme.ThemeBlurinessOpacity;
                CurrentThemeThemeNoiseRatioInt   = Theme.WhiteTheme.ThemeBlurinessRatio;
                CurrentThemeHasEventDayBackColor = Theme.WhiteTheme.HasEventDayBackColor;
                CurrentThemeDayLeadForecolor     = Theme.WhiteTheme.DayLeadColor;
                CurrentThemePersianDayForecolor  = Theme.WhiteTheme.PersianDayColor;
                CurrentThemeGregHijrForecolor    = Theme.WhiteTheme.GregorianHijriColor;
                CurrentThemeTodayForecolor       = Theme.WhiteTheme.TodayForecolor;
                CurrentThemeSeparator            = Theme.WhiteTheme.Separator;
                CurrentThemeChangeMonthForecolor = Theme.WhiteTheme.ChangeMonth;
                IsDark = false;
            }
            else
            {
                CurrentThemeThemeNoiseColor      = Theme.DarkTheme.ThemeColor;
                CurrentThemeThemeNoiseOpacity    = Theme.DarkTheme.ThemeBlurinessOpacity;
                CurrentThemeThemeNoiseRatioInt   = Theme.DarkTheme.ThemeBlurinessRatio;
                CurrentThemeHasEventDayBackColor = Theme.DarkTheme.HasEventDayBackColor;
                CurrentThemeDayLeadForecolor     = Theme.DarkTheme.DayLeadColor;
                CurrentThemePersianDayForecolor  = Theme.DarkTheme.PersianDayColor;
                CurrentThemeGregHijrForecolor    = Theme.DarkTheme.GregorianHijriColor;
                CurrentThemeTodayForecolor       = Theme.DarkTheme.TodayForecolor;
                CurrentThemeSeparator            = Theme.DarkTheme.Separator;
                CurrentThemeChangeMonthForecolor = Theme.DarkTheme.ChangeMonth;
                IsDark = true;
            }

            var animationDuration = TimeSpan.FromMilliseconds(300);

            ThemeNoise.CreateStoryBoard(CurrentThemeThemeNoiseColor, "(Border.Background).(SolidColorBrush.Color)");
            PersianTitle.CreateStoryBoard(CurrentThemeDayLeadForecolor, "(TextBlock.Foreground).(SolidColorBrush.Color)");
            GregorianTitle.CreateStoryBoard(CurrentThemeDayLeadForecolor, "(TextBlock.Foreground).(SolidColorBrush.Color)");
            HijriTitle.CreateStoryBoard(CurrentThemeDayLeadForecolor, "(TextBlock.Foreground).(SolidColorBrush.Color)");
            TodayDate.CreateStoryBoard(CurrentThemeTodayForecolor, "(Button.Foreground).(SolidColorBrush.Color)");
            Separator.CreateStoryBoard(CurrentThemeSeparator, "Background.Color");
            BtnPrevMonth.CreateStoryBoard(CurrentThemeChangeMonthForecolor, "(Button.Foreground).(SolidColorBrush.Color)");
            BtnNextMonth.CreateStoryBoard(CurrentThemeChangeMonthForecolor, "(Button.Foreground).(SolidColorBrush.Color)");

            DesignCalendar(NowDateTime);

            foreach (var day in CalendarDays.Children)
            {
                var dayDetails = ((day as Button)?.Content as Grid)?.Children;
                if (dayDetails == null)
                {
                    continue;
                }

                foreach (var dayDetail in dayDetails)
                {
                    switch (dayDetail)
                    {
                    case TextBlock persianDay:
                        persianDay.CreateStoryBoard(CurrentThemePersianDayForecolor, "(TextBlock.Foreground).(SolidColorBrush.Color)");
                        break;

                    case Grid customDays:
                        foreach (var cusDay in customDays.Children)
                        {
                            if (cusDay is TextBlock customDay)
                            {
                                customDay.CreateStoryBoard(CurrentThemeGregHijrForecolor,
                                                           "(TextBlock.Foreground).(SolidColorBrush.Color)");
                            }
                        }
                        break;
                    }
                }
            }

            ThemeNoise.BeginAnimation(OpacityProperty, new DoubleAnimation(ThemeNoise.Opacity, CurrentThemeThemeNoiseOpacity, animationDuration));
            ThemeNoiseRatio.Ratio = CurrentThemeThemeNoiseRatioInt;
            DesignCalendar(NowDateTime);
        }