コード例 #1
0
        public void AgentWhoAlreadyDismissed_CouldNotBeDismissed()
        {
            using (ShimsContext.Create())
            {
                var ag = new Agent("احسان کاظمی", 1, "علی‌اصغر", "1234567890", new DateTime(1397, 1, 1),
                                   "(912)1234567", "(21)12345678", 1, -1);
                ag.Enbl = false;
                data.access.Fakes.ShimRepository <data.model.Agent> .AllInstances.RetExpressionOfFuncOfT0Boolean =
                    delegate { return(ag); };
                data.access.Fakes.ShimRepository <data.model.Session> .AllInstances.RetExpressionOfFuncOfT0Boolean =
                    delegate { return(null); };

                var biz = new BizProvider("lab");
                biz.DismissTheAgent(ag, DateTime.Now.Date.AddDays(14));
            }
        }
コード例 #2
0
        private void btnApply_Click(object sender, EventArgs e)
        {
            if (ag != null)
            {
                var biz = new BizProvider();
                if (Message.SUCC == biz.DismissTheAgent(ag, dPickUntil.Value.Date).Id)
                {
                    clearAll();
                }

                //if (chkGenRpt.Checked)
                /*UNDONE چاپ گزارش پایان با تعداد مرخصی|نهست انتخاب شده*/

                /*UNDONE اطلاع به کاربر در صورت موفق بودن*/
            }
        }
コード例 #3
0
        public void AfterAgentBeingRecepted_CanBeDismissed()
        {
            using (ShimsContext.Create())
            {
                var ag = new Agent("علی علیانی", 1, "اکبر", "1234567890", new DateTime(1397, 1, 1),
                                   "(912)1234567", "(21)12345678", 1, -1);
                data.access.Fakes.ShimRepository <data.model.Agent> .AllInstances.RetExpressionOfFuncOfT0Boolean =
                    delegate { return(ag); };
                data.access.Fakes.ShimRepository <data.model.Session> .AllInstances.RetExpressionOfFuncOfT0Boolean =
                    delegate { return(new Session(1)); };
                data.access.Fakes.ShimRepository <data.model.Agent> .AllInstances.UpdT0 =
                    delegate { return(true); };
                data.access.Fakes.ShimRepository <data.model.Session> .AllInstances.UpdT0 =
                    delegate { return(true); };

                var biz = new BizProvider("lab");
                biz.DismissTheAgent(ag, DateTime.Now.Date.AddDays(14));
            }
        }