protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            //string js=CreateJs();

            SaveJs();

            if (!Page.ClientScript.IsClientScriptIncludeRegistered(jsName + "Include"))
            {
                Page.ClientScript.RegisterClientScriptInclude(jsName + "Include", JsSaver.GetDefualtJsUrl(jsName));
            }
            if (!Page.ClientScript.IsStartupScriptRegistered("Init"))
            {
                string commonPanl = "document.write('<div id=\"calendarPanel\" style=\"position: absolute;visibility: hidden;z-index: 9999;background-color: #FFFFFF;border: 1px solid #CCCCCC;width:175px;font-size:12px;\"></div>');\n";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Init", commonPanl, true);
            }
            string lan = "1";//语言

            if (IsChinese)
            {
                lan = "0";
            }
            string showScript = "new Calendar(" + BeginYear.ToString() + ", " + EndYear.ToString() + ", " + lan + ",'yyyy-MM-dd','" +
                                ContorlCommon.ToColorString(CurWord) + "','" + ContorlCommon.ToColorString(CurBg) + "','" + ContorlCommon.ToColorString(SunWord) + "','" +
                                ContorlCommon.ToColorString(SatWord) + "','" + ContorlCommon.ToColorString(TdWordLight) + "','" + ContorlCommon.ToColorString(TdWordDark) + "','" +
                                ContorlCommon.ToColorString(TdBgOut) + "','" + ContorlCommon.ToColorString(TdBgOver) + "','" + ContorlCommon.ToColorString(TrWord) + "'" +
                                ",'" + ContorlCommon.ToColorString(TrBg) + "','" + ContorlCommon.ToColorString(InputBorder) + "','" + ContorlCommon.ToColorString(InputBg) + "').show(this,null);";

            txtValue.Attributes.Add("onclick", showScript);
            txtValue.Attributes.Add("readonly", "readonly");
        }
Exemple #2
0
        private void UpdateSchoolProfile()
        {
            SessionSch = StartYear.ToString() + "-" + EndYear.ToString();
            SchoolProfileDb db  = new SchoolProfileDb();
            var             tpl = db.GetProfile(StartYear, EndYear);

            GrandTotal = tpl.Item1;
            Count5     = tpl.Item2;
            Count6     = tpl.Item3;
            Count7     = tpl.Item4;
            Count8     = tpl.Item5;
            Count9     = tpl.Item6;
            Count10    = tpl.Item7;
            Count11    = tpl.Item8;
            Count12    = tpl.Item9;

            CountMale    = tpl.Item10;
            CountFemale  = tpl.Item11;
            CountGenNull = tpl.Item12;

            CountGen        = tpl.Item13;
            CountSC         = tpl.Item14;
            CountST         = tpl.Item15;
            CountOBC        = tpl.Item16;
            CountOBC_A      = tpl.Item17;
            CountOBC_B      = tpl.Item18;
            CountSocCatNull = tpl.Item19;

            CountApl = tpl.Item20;
            CountBpl = tpl.Item21;
        }
 /// <summary>
 /// Override of the 'ToString' method
 /// </summary>
 /// <returns></returns>
 public override string ToString()
 {
     return($"Code: {Code}\nTitle Type: {TitleType}\nPrimary Title: {PrimaryTitle}\n" +
            $"Original Title: {OriginalTitle}\nIs Adult: {IsAdult}\n" +
            $"Start Year: {((StartYear == null) ? string.Empty : StartYear.ToString())}\n" +
            $"End Year: {((EndYear == null) ? string.Empty : EndYear.ToString())}\n" +
            $"Runtime Minutes: {((RuntimeMinutes == null) ? string.Empty : RuntimeMinutes.ToString())}\n" +
            $"Genres: {Genres}");
 }
Exemple #4
0
        public void InitializeDdlSettingWindow(Ddl ddl)
        {
            InitializeComponent();

            DdlNameTextBox.Text = ddl.Name;
            DdlPriority.Value   = ddl.Priority;

            InitializeStartTime(ddl.StartTime);
            ChineseCheckbox.IsChecked = ddl.IsChineseCalender;
            InitializeEndTime(ddl.EndTime);

            var format = System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern;

            if (format == "M/d/yyyy")
            {
                StartMonth.SetValue(Grid.ColumnProperty, 0);
                StartDay.SetValue(Grid.ColumnProperty, 1);
                StartYear.SetValue(Grid.ColumnProperty, 2);

                EndMonth.SetValue(Grid.ColumnProperty, 0);
                EndDay.SetValue(Grid.ColumnProperty, 1);
                EndYear.SetValue(Grid.ColumnProperty, 2);
            }
            else if (format == "d/M/yyyy")
            {
                StartDay.SetValue(Grid.ColumnProperty, 0);
                StartMonth.SetValue(Grid.ColumnProperty, 1);
                StartYear.SetValue(Grid.ColumnProperty, 2);

                EndDay.SetValue(Grid.ColumnProperty, 0);
                EndMonth.SetValue(Grid.ColumnProperty, 1);
                EndYear.SetValue(Grid.ColumnProperty, 2);
            }


            LoopCheckbox.IsChecked = ddl.IsLoop;
            if (ddl.IsLoop)
            {
                InitializeLoopinterval(ddl.LoopInterval);
            }

            NoticeCheckbox.IsChecked = (ddl.Inform[0] == '1');
            WindowCheckbox.IsChecked = (ddl.Inform[1] == '1');
            SoundCheckbox.IsChecked  = (ddl.Inform[2] == '1');

            RemindCheckbox.IsChecked = ddl.IsRemind != -1;
            if (ddl.IsRemind != -1)
            {
                InitializeRemind(ddl.RemindInterval, ddl.RemindTime);
            }

            if (System.Threading.Thread.CurrentThread.CurrentUICulture.Name != "zh-CN")
            {
                ChineseCheckbox.Visibility = Visibility.Hidden;
                ChineseCheckbox.IsEnabled  = false;
            }
        }
Exemple #5
0
        public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
        {
            if (!IsNumberOfShipmentsValid())
            {
                yield return(new ValidationResult(ShipmentResources.NumberOfShipmentsValid, new[] { "NumberOfShipments" }));
            }

            if (!IsQuantityValid() && Units.HasValue)
            {
                yield return(new ValidationResult(string.Format(ShipmentResources.DecimalPlacesValid,
                                                                ShipmentQuantityUnitsMetadata.Precision[Units.Value]), new[] { "Quantity" }));
            }

            DateTime startDate;
            bool     isValidStartDate = SystemTime.TryParse(StartYear.GetValueOrDefault(), StartMonth.GetValueOrDefault(), StartDay.GetValueOrDefault(), out startDate);

            if (!isValidStartDate)
            {
                yield return(new ValidationResult(ShipmentResources.FirstDepartureValid, new[] { "StartDay" }));
            }

            DateTime endDate;
            bool     isValidEndDate = SystemTime.TryParse(EndYear.GetValueOrDefault(), EndMonth.GetValueOrDefault(), EndDay.GetValueOrDefault(), out endDate);

            if (!isValidEndDate)
            {
                yield return(new ValidationResult(ShipmentResources.LastDepartureValid, new[] { "EndDay" }));
            }

            if (!(isValidStartDate && isValidEndDate))
            {
                // Stop further validation if either date is not a valid date
                yield break;
            }

            if (startDate < SystemTime.Now.Date && Status == NotificationStatus.NotSubmitted)
            {
                yield return(new ValidationResult(ShipmentResources.FirstDeparturePastDate, new[] { "StartDay" }));
            }

            if (startDate > endDate)
            {
                yield return(new ValidationResult(ShipmentResources.FirstDepartureBeforeLastDate, new[] { "StartYear" }));
            }

            var monthPeriodLength = IsPreconsentedRecoveryFacility ? 36 : 12;

            if (endDate >= startDate.AddMonths(monthPeriodLength))
            {
                yield return(new ValidationResult(string.Format(ShipmentResources.DepartureDateRange, monthPeriodLength), new[] { "EndYear" }));
            }
        }
Exemple #6
0
        public override int GetHashCode()
        {
            int result = 1;

            result = (result * 397) ^ (CreatedOn != null ? CreatedOn.GetHashCode() : 0);
            result = (result * 397) ^ (EndDate != null ? EndDate.GetHashCode() : 0);
            result = (result * 397) ^ EndYear.GetHashCode();
            result = (result * 397) ^ Id.GetHashCode();
            result = (result * 397) ^ (IsDefaultAcademicYear != null ? IsDefaultAcademicYear.GetHashCode() : 0);
            result = (result * 397) ^ (Name != null ? Name.GetHashCode() : 0);
            result = (result * 397) ^ (StartDate != null ? StartDate.GetHashCode() : 0);
            result = (result * 397) ^ StartYear.GetHashCode();
            return(result);
        }
Exemple #7
0
        public SetIntendedShipmentInfoForNotification ToRequest(Guid notificationId)
        {
            DateTime startDate;

            SystemTime.TryParse(StartYear.GetValueOrDefault(), StartMonth.GetValueOrDefault(), StartDay.GetValueOrDefault(), out startDate);

            DateTime endDate;

            SystemTime.TryParse(EndYear.GetValueOrDefault(), EndMonth.GetValueOrDefault(), EndDay.GetValueOrDefault(), out endDate);

            return(new SetIntendedShipmentInfoForNotification(
                       notificationId,
                       int.Parse(NumberOfShipments, NumberStyles.AllowThousands),
                       Convert.ToDecimal(Quantity),
                       Units.GetValueOrDefault(),
                       startDate,
                       endDate));
        }
Exemple #8
0
 public override string TestDataString()
 {
     return("Test of : " + Genre + " Start: " + StartYear.ToString() + " End: " + EndYear.ToString() + " Total Years : " + (EndYear - StartYear + 1));
 }
Exemple #9
0
        public override string ToLink(bool link = true, DwarfObject pov = null, WorldEvent worldEvent = null)
        {
            if (link)
            {
                string title = Type;
                title += "&#13";
                title += Attacker.PrintEntity(false) + " (Attacker)";
                title += "&#13";
                title += Defender.PrintEntity(false) + " (Defender)";
                title += "&#13";
                title += "Deaths: " + DeathCount + " | (" + StartYear + " - " + (EndYear == -1 ? "Present" : EndYear.ToString()) + ")";

                string linkedString = "";
                if (pov != this)
                {
                    linkedString = Icon + "<a href = \"collection#" + Id + "\" title=\"" + title + "\"><font color=\"#6E5007\">" + Name + "</font></a>";
                }
                else
                {
                    linkedString = Icon + "<a title=\"" + title + "\">" + HtmlStyleUtil.CurrentDwarfObject(Name) + "</a>";
                }
                return(linkedString);
            }
            return(Name);
        }
Exemple #10
0
 private void SetRecommendationProperties()
 {
     GUIUtils.SetProperty("#Trakt.Recommendations.Genre", TraktGenres.Translate(CurrentGenre));
     GUIUtils.SetProperty("#Trakt.Recommendations.HideCollected", HideCollected.ToString());
     GUIUtils.SetProperty("#Trakt.Recommendations.HideWatchlisted", HideWatchlisted.ToString());
     GUIUtils.SetProperty("#Trakt.Recommendations.StartYear", StartYear == 0 ? "1919" : StartYear.ToString());
     GUIUtils.SetProperty("#Trakt.Recommendations.EndYear", EndYear == 0 ? DateTime.Now.AddYears(3).Year.ToString() : EndYear.ToString());
 }
Exemple #11
0
        protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            // wait for any background action to finish
            if (GUIBackgroundTask.Instance.IsBusy)
            {
                return;
            }

            switch (controlId)
            {
            // Facade
            case (50):
                if (actionType == Action.ActionType.ACTION_SELECT_ITEM)
                {
                    if (TraktSettings.EnableJumpToForTVShows)
                    {
                        CheckAndPlayEpisode(true);
                    }
                    else
                    {
                        GUIListItem selectedItem = this.Facade.SelectedListItem;
                        if (selectedItem == null)
                        {
                            return;
                        }
                        TraktShow selectedShow = (TraktShow)selectedItem.TVTag;
                        GUIWindowManager.ActivateWindow((int)TraktGUIWindows.ShowSeasons, selectedShow.ToJSON());
                    }
                }
                break;

            // Layout Button
            case (2):
                CurrentLayout = GUICommon.ShowLayoutMenu(CurrentLayout, PreviousSelectedIndex);
                break;

            // Genre Button
            case (3):
                ShowGenreMenu();
                break;

            // Hide Collected Toggle Button
            case (4):
                HideCollected = hideCollectedButton.Selected;
                ReloadRecommendations();
                break;

            // Hide Watchlisted Toggle Button
            case (5):
                HideWatchlisted = hideWatchlistedButton.Selected;
                ReloadRecommendations();
                break;

            // Start Year Button
            case (6):
                string startYear = StartYear.ToString();
                if (startYear == "0")
                {
                    startYear = "1919";
                }
                if (GUIUtils.GetStringFromKeyboard(ref startYear))
                {
                    int result;
                    if (startYear.Length == 4 && int.TryParse(startYear, out result) && !startYear.Equals(StartYear.ToString()))
                    {
                        StartYear = result;
                        GUIControl.SetControlLabel(GetID, startYearButton.GetID, GetStartYearTitle(StartYear));
                        ReloadRecommendations();
                    }
                }
                break;

            // End Year Button
            case (7):
                string endYear = EndYear.ToString();
                if (endYear == "0")
                {
                    endYear = DateTime.Now.AddYears(3).Year.ToString();
                }
                if (GUIUtils.GetStringFromKeyboard(ref endYear))
                {
                    int result;
                    if (endYear.Length == 4 && int.TryParse(endYear, out result) && !endYear.Equals(EndYear.ToString()))
                    {
                        EndYear = result;
                        GUIControl.SetControlLabel(GetID, endYearButton.GetID, GetEndYearTitle(EndYear));
                        ReloadRecommendations();
                    }
                }
                break;

            // Sort Button
            case (8):
                var newSortBy = GUICommon.ShowSortMenu(TraktSettings.SortByRecommendedShows);
                if (newSortBy != null)
                {
                    if (newSortBy.Field != TraktSettings.SortByRecommendedShows.Field)
                    {
                        TraktSettings.SortByRecommendedShows = newSortBy;
                        PreviousSelectedIndex = 0;
                        UpdateButtonState();
                        LoadRecommendedShows();
                    }
                }
                break;

            default:
                break;
            }
            base.OnClicked(controlId, control, actionType);
        }
Exemple #12
0
        void ReleaseDesignerOutlets()
        {
            if (DatePickerBar != null)
            {
                DatePickerBar.Dispose();
                DatePickerBar = null;
            }

            if (DatePickerVacation != null)
            {
                DatePickerVacation.Dispose();
                DatePickerVacation = null;
            }

            if (DateToolBar != null)
            {
                DateToolBar.Dispose();
                DateToolBar = null;
            }

            if (DoneButton != null)
            {
                DoneButton.Dispose();
                DoneButton = null;
            }

            if (EndDay != null)
            {
                EndDay.Dispose();
                EndDay = null;
            }

            if (EndMonth != null)
            {
                EndMonth.Dispose();
                EndMonth = null;
            }

            if (EndYear != null)
            {
                EndYear.Dispose();
                EndYear = null;
            }

            if (Page != null)
            {
                Page.Dispose();
                Page = null;
            }

            if (PageImage != null)
            {
                PageImage.Dispose();
                PageImage = null;
            }

            if (StartDay != null)
            {
                StartDay.Dispose();
                StartDay = null;
            }

            if (StartMonth != null)
            {
                StartMonth.Dispose();
                StartMonth = null;
            }

            if (StartYear != null)
            {
                StartYear.Dispose();
                StartYear = null;
            }

            if (StatusSegment != null)
            {
                StatusSegment.Dispose();
                StatusSegment = null;
            }

            if (TypeImageView != null)
            {
                TypeImageView.Dispose();
                TypeImageView = null;
            }

            if (TypeText != null)
            {
                TypeText.Dispose();
                TypeText = null;
            }

            if (DatePickerToolbar != null)
            {
                DatePickerToolbar.Dispose();
                DatePickerToolbar = null;
            }
        }
Exemple #13
0
 protected override void OnEndYearChanged()
 {
     NewSessionEndYear = EndYear + 1;
     PrevSessionHeader = "Previous Session : " + StartYear.ToString() + "-" + EndYear.ToString();
 }
        protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            // wait for any background action to finish
            if (GUIBackgroundTask.Instance.IsBusy)
            {
                return;
            }

            switch (controlId)
            {
            // Facade
            case (50):
                if (actionType == Action.ActionType.ACTION_SELECT_ITEM)
                {
                    CheckAndPlayMovie(true);
                }
                break;

            // Layout Button
            case (2):
                CurrentLayout = GUICommon.ShowLayoutMenu(CurrentLayout);
                break;

            // Genre Button
            case (3):
                ShowGenreMenu();
                break;

            // Hide Collected Toggle Button
            case (4):
                HideCollected = hideCollectedButton.Selected;
                ReloadRecommendations();
                break;

            // Hide Watchlisted Toggle Button
            case (5):
                HideWatchlisted = hideWatchlistedButton.Selected;
                ReloadRecommendations();
                break;

            // Start Year Button
            case (6):
                string startYear = StartYear.ToString();
                if (startYear == "0")
                {
                    startYear = "1888";
                }
                if (GUIUtils.GetStringFromKeyboard(ref startYear))
                {
                    int result;
                    if (startYear.Length == 4 && int.TryParse(startYear, out result))
                    {
                        StartYear = result;
                        GUIControl.SetControlLabel(GetID, startYearButton.GetID, GetStartYearTitle(StartYear));
                        ReloadRecommendations();
                    }
                }
                break;

            // End Year Button
            case (7):
                string endYear = EndYear.ToString();
                if (endYear == "0")
                {
                    endYear = DateTime.Now.AddYears(3).Year.ToString();
                }
                if (GUIUtils.GetStringFromKeyboard(ref endYear))
                {
                    int result;
                    if (endYear.Length == 4 && int.TryParse(endYear, out result))
                    {
                        EndYear = result;
                        GUIControl.SetControlLabel(GetID, endYearButton.GetID, GetEndYearTitle(EndYear));
                        ReloadRecommendations();
                    }
                }
                break;

            // Sort Button
            case (8):
                var newSortBy = GUICommon.ShowSortMenu(TraktSettings.SortByRecommendedMovies);
                if (newSortBy != null)
                {
                    if (newSortBy.Field != TraktSettings.SortByRecommendedMovies.Field)
                    {
                        TraktSettings.SortByRecommendedMovies = newSortBy;
                        PreviousSelectedIndex = 0;
                        UpdateButtonState();
                        LoadRecommendedMovies();
                    }
                }
                break;

            default:
                break;
            }
            base.OnClicked(controlId, control, actionType);
        }
        /// <summary>
        /// Routine to save the selected values and return the result back to frmTableDetails
        /// </summary>
        private void SaveData()
        {
            if (lstValues.Items.Count == 0)
            {
                UtilGeneral.ShowMessage("No value selected. Please select the split values.");
                return;
            }

            string colName     = (string)cmbColumns.SelectedItem;
            string colDataType = lblColType.Text;
            string strDataType = "";

            // Chose the data type
            if (optSplitTimePeriod.Checked)
            {
                if (optTPYear.Checked)
                {
                    if (colDataType == Constants.DATA_TYPE_INT)
                    {
                        strDataType = Constants.BCP_SPLIT_TYPE_TIME_INT_YEAR;
                    }
                    else
                    {
                        strDataType = Constants.BCP_SPLIT_TYPE_TIME_YEAR;
                    }
                }
                else if (optTPMonth.Checked)
                {
                    if (colDataType == Constants.DATA_TYPE_INT)
                    {
                        strDataType = Constants.BCP_SPLIT_TYPE_TIME_INT_MONTH;
                    }
                    else
                    {
                        strDataType = Constants.BCP_SPLIT_TYPE_TIME_INT_MONTH;
                    }
                }
                else
                {
                    if (colDataType == Constants.DATA_TYPE_INT)
                    {
                        strDataType = Constants.BCP_SPLIT_TYPE_TIME_INT_DATE;
                    }
                    else
                    {
                        strDataType = Constants.BCP_SPLIT_TYPE_TIME_DATE;
                    }
                }
            }
            else
            {
                strDataType = Constants.BCP_SPLIT_TYPE_VALUE;
            }

            List <string> values = new List <string>();


            if (optTPMonth.Checked)
            {
                // If month, then add the previous year as a failsafe to chose all data for this and prior period
                int StartYear;
                StartYear = Int32.Parse(lstValues.Items[0].ToString().Substring(0, 4)) - 1;
                values.Add(StartYear.ToString());
            }
            for (int i = 0; i < lstValues.Items.Count; i++)
            {
                values.Add(lstValues.Items[i].ToString());
            }
            if (optTPMonth.Checked)
            {
                // If month, then add the next year as a failsafe to chose all data for this and later period
                int EndYear;
                EndYear = Int32.Parse(lstValues.Items[lstValues.Items.Count - 1].ToString().Substring(0, 4)) + 1;
                values.Add(EndYear.ToString());
            }
            string result = String.Join(",", values);

            // Update the BCP Data back to frmTableDetails
            frmParent.UpdateBCPSelection(colName, result, strDataType);
            this.Close();
        }