コード例 #1
0
        /// <summary>
        /// Handles the creation of a summon report using the field text from the view
        /// </summary>
        /// <param name="newSummon">Contains the report information given by the user</param>
        public void PostCreateSummon(ISummon newSummon)
        {
            Summon summon = newSummon.Summon;

            summon.ReportedDate = DateTime.Now.Date;

            List <Summon> summons = dbEnt.Summon.Summons();

            summon.SummonId  = summons.Count > 0 ? summons.Max(m => m.SummonId) + 1 : 1;
            summon.AccountId = UserSession.User.AccountId;

            bool status = dbEnt.Summon.InsertSummon(summon);

            if (status)
            {
                MessageBox.Show("New summon report created successfully.", "New Summon Report", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ViewContext.Dispose();
                // go back to landing page
                /* Audit TRAIL RECORD and System PROMPT */
                AuditTrailHelper.RecordAction("New summon created with Id " + summon.SummonId);
                MenuHelper.MenuInput();
            }
            else
            {
                MessageBox.Show("Unavailable to create new summon report.", "New Summon Report", MessageBoxButtons.OK, MessageBoxIcon.Error);
                // reload view
                new SummonPresenter().GetCreateSummon();
            }
        }
コード例 #2
0
ファイル: Setting.cs プロジェクト: rsfc/LemonadeWin
        /// <summary>
        /// 启动守护线程
        /// </summary>
        /// <returns></returns>
        protected virtual INazgul LaunchSummon()
        {
            ISummon summon = null;
            string  s      = Lemon.GetCSFRootDirectory();

            summon = Lemon.FindInstanceFromDirectory <ISummon>(s);
            if (summon != null)
            {
                INazgul nazgul = summon.RingtoWear();
                nazgul.LoadNazgulSkill();
                nazgul.UseAllSkill();
                return(nazgul);
            }
            else
            {
                return(null);
            }
        }
コード例 #3
0
ファイル: Summon.cs プロジェクト: kmimimi/shooting_game
 public Summon(ISummon iSummon, float cooltime) : base(cooltime)
 {
     this.summonInterface = iSummon;
 }