Пример #1
0
        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");
        }
Пример #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;
        }
Пример #3
0
 /// <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}");
 }
Пример #4
0
 public override string TestDataString()
 {
     return("Test of : " + Genre + " Start: " + StartYear.ToString() + " End: " + EndYear.ToString() + " Total Years : " + (EndYear - StartYear + 1));
 }
Пример #5
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);
        }
Пример #6
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());
 }
Пример #7
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);
        }
Пример #8
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();
        }