Exemplo n.º 1
0
 /// <summary>
 /// 修改操作
 /// </summary>
 private void UpdateNewsInfoByID(WSS.Model.Tasks n)
 {
     if (new WSS.BLL.Tasks().Update(n) == true)
     {
         Ext.Msg.Alert(ConfigurationManager.AppSettings["MsgTitle"], "数据已经修改成功!").Show();
         NewsWindow.Hide();
     }
     else
     {
         Ext.Msg.Alert(ConfigurationManager.AppSettings["MsgError"], ConfigurationManager.AppSettings["ErrorMessage"]).Show();
     }
 }
Exemplo n.º 2
0
 private void newsWindow_FormClosed(object sender, FormClosedEventArgs e)
 {
     this.newsWindow = null;
 }
Exemplo n.º 3
0
 private void newsToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     if (this.newsWindow == null)
     {
         this.newsWindow = new NewsWindow();
         this.newsWindow.MdiParent = this;
         this.newsWindow.FormClosed += new FormClosedEventHandler(this.newsWindow_FormClosed);
         this.newsWindow.Show();
     }
     else
     {
         this.chartWindow.Activate();
     }
 }
Exemplo n.º 4
0
        public override void DoSettingsWindowContents(Rect inRect)
        {
            var leftRect  = new Rect(inRect.x, inRect.y, inRect.width * 0.65f, inRect.height);
            var rightRect = new Rect((int)(inRect.x + inRect.width * 0.65f + 30f), inRect.y, inRect.width * 0.35f - 30f,
                                     inRect.height);

            var listing_options = new Listing_Standard();

            listing_options.Begin(leftRect);

            listing_options.CheckboxLabeled("PrisonLabor_ShowNews".Translate(), ref showNews,
                                            "PrisonLabor_ShowNewsDesc".Translate());

            listing_options.GapLine();

            if (listing_options.ButtonTextLabeled("PrisonLabor_DefaultInterMode".Translate(), interactionModeList[defaultInteractionMode].LabelCap))
            {
                defaultInteractionMode = defaultInteractionMode < interactionModeList.Count - 1 ? defaultInteractionMode + 1 : 0;
            }

            listing_options.GapLine();

            listing_options.Label("PrisonLabor_AllowedWorkTypes".Translate(), -1f);
            listing_options.CheckboxLabeled("   " + "PrisonLabor_AllowAll".Translate(), ref allowAllWorktypes, "PrisonLabor_AllowAllWorkTypes".Translate());
            if (!allowAllWorktypes)
            {
                if (listing_options.ButtonTextLabeled("   " + "PrisonLabor_AllowedWorkTypesL".Translate(), "PrisonLabor_Browse".Translate()))
                {
                    Find.WindowStack.Add(new SelectWorkTypesDialog());
                }
            }
            else
            {
                listing_options.Gap();
            }

            listing_options.GapLine();

            listing_options.CheckboxLabeled("PrisonLabor_MotivationMechanics".Translate(), ref enableMotivationMechanics,
                                            "PrisonLabor_MotivationWarning".Translate());

            listing_options.GapLine();

            listing_options.CheckboxLabeled("PrisonLabor_MotivationIcons".Translate(), ref enableMotivationIcons,
                                            "PrisonLabor_MotivationIconsDesc".Translate());

            listing_options.GapLine();

            listing_options.CheckboxLabeled("PrisonLabor_CanGrowAdvanced".Translate(), ref advancedGrowing,
                                            "PrisonLabor_CanGrowAdvancedDesc".Translate());

            listing_options.GapLine();

            listing_options.CheckboxLabeled("PrisonLabor_EnableRevolts".Translate(), ref enableRevolts,
                                            "PrisonLabor_EnableRevoltsDesc".Translate());

            listing_options.GapLine();

            listing_options.CheckboxLabeled("PrisonLabor_EnableSuicide".Translate(), ref enableSuicide,
                                            "PrisonLabor_EnableSuicideDesc".Translate());

            listing_options.CheckboxLabeled("PrisonLabor_EnableFullHealRest".Translate(), ref enableFullHealRest,
                                            "PrisonLabor_EnableFullHealRestDesc".Translate());


            listing_options.GapLine();

            listing_options.CheckboxLabeled("PrisonLabor_ShowTreatmentHappiness".Translate(), ref showTreatmentHappiness,
                                            "PrisonLabor_ShowTreatmentHappinessDesc".Translate());

            listing_options.Gap();
            listing_options.Gap();
            listing_options.Gap();

            if (listing_options.ButtonTextLabeled("PrisonLabor_ButtonRemoveModFromSaveDesc".Translate(), "PrisonLabor_ButtonRemoveModFromSave".Translate()))
            {
                Find.WindowStack.Add(new SelectSaveForCleaningDialog());
            }

            listing_options.End();

            var listing_panel = new Listing_Standard();

            listing_panel.Begin(rightRect);

            var heigh_temp = rightRect.width * 0.56f;

            GUI.DrawTexture(new Rect(0, 0, rightRect.width, heigh_temp), ContentFinder <Texture2D> .Get("Preview", true));
            listing_panel.Gap(heigh_temp);
            listing_panel.Label("Prison Labor", -1f);
            listing_panel.Label("PrisonLabor_Version".Translate() + VersionUtility.versionString, -1f);

            listing_panel.GapLine();

            listing_panel.Label("PrisonLabor_Difficulty".Translate() + difficulty, -1f);

            listing_panel.GapLine();

            if (listing_panel.ButtonText("PrisonLabor_Defaults".Translate()))
            {
                PrisonLaborPrefs.RestoreToDefault();
                Init();
            }

            if (listing_panel.ButtonText("PrisonLabor_ShowNews".Translate()))
            {
                NewsWindow.ShowAll = true;
                NewsWindow.ForceShow();
            }

            if (listing_panel.ButtonText("PrisonLabor_ReplayTurorialsButton".Translate()))
            {
                ReplayTutorialsWindow.Show();
            }

            listing_panel.End();

            Apply();
        }
Exemplo n.º 5
0
 static void Postfix()
 {
     NewsWindow.TryShow();
 }
        private void UpdateNewsInfoByID(WSS.Model.Tasks n)//修改操作
        {
            if (new WSS.BLL.Tasks().Update(n) == true)
            {
                WSS.BLL.T_TasksLog TLoglist = new WSS.BLL.T_TasksLog();

                TLoglist.F_ID = TList.F_ID;

                if (n.F_Note.Trim().Length != 0)
                {
                    TLoglist.F_Note = n.F_Note;
                }
                if (n.F_Title != TList.F_Title)
                {
                    TLoglist.F_Title = n.F_Title;
                }
                if (n.F_DateTime != TList.F_DateTime)
                {
                    TLoglist.F_DateTime = n.F_DateTime;
                }
                if (n.F_DutyMan != TList.F_DutyMan)
                {
                    TLoglist.F_DutyMan = n.F_DutyMan;
                }

                TLoglist.F_EditMan = TList.F_EditMan;
                if (n.F_From != TList.F_From)
                {
                    TLoglist.F_From = n.F_From;
                }
                if (n.F_GameName != TList.F_GameName)
                {
                    TLoglist.F_GameName = n.F_GameName;
                }
                if (n.F_JinjiLevel != TList.F_JinjiLevel)
                {
                    TLoglist.F_JinjiLevel = n.F_JinjiLevel;
                }
                if (n.F_PreDutyMan != TList.F_PreDutyMan)
                {
                    TLoglist.F_PreDutyMan = n.F_PreDutyMan;
                }
                if (n.F_Rowtype != TList.F_Rowtype)
                {
                    TLoglist.F_Rowtype = n.F_Rowtype;
                }
                if (n.F_State != TList.F_State)
                {
                    TLoglist.F_State = n.F_State;
                }
                if (n.F_Telphone != TList.F_Telphone)
                {
                    TLoglist.F_Telphone = n.F_Telphone;
                }
                if (n.F_Type != TList.F_Type)
                {
                    TLoglist.F_Type = n.F_Type;
                }

                TLoglist.Add();
                GridPanelNewsList.Reload();
                Ext.Msg.Alert(ConfigurationManager.AppSettings["MsgTitle"], "数据已经修改成功!").Show();
                NewsWindow.Hide();
            }
            else
            {
                Ext.Msg.Alert(ConfigurationManager.AppSettings["MsgError"], ConfigurationManager.AppSettings["ErrorMessage"]).Show();
            }
        }