Ejemplo n.º 1
0
        public void ChangeInfo_All_Test()
        {
            infoProxy.DepartmentID     = ADODepartment2.ID;
            infoProxy.EmploymentTypeID = ADOEmploymentType2.ID;

            infoProxy.RuleGroupID       = ADORuleCat2.ID;
            infoProxy.RuleGroupFromDate = Utility.ToPersianDate(new DateTime(2012, 01, 01));
            infoProxy.RuleGroupToDate   = Utility.ToPersianDate(new DateTime(2012, 05, 01));

            infoProxy.DateRangeID       = ADOGroup2.ID;
            infoProxy.DateRangeFromDate = Utility.ToPersianDate(new DateTime(2011, 02, 01));

            infoProxy.WorkGroupID       = ADOWorkGroup2.ID;
            infoProxy.WorkGroupFromDate = Utility.ToPersianDate(new DateTime(2011, 02, 01));

            bool result = busChnageInfo.ChangeInfo(ADOPerson1.PersonCode, infoProxy, out errorList);

            Assert.IsTrue(result);

            ClearSession();

            Person p = new BPerson().GetByID(ADOPerson1.ID);

            p.InitializeForExecuteRule(new DateTime(2010, 1, 1), new DateTime(2013, 1, 1), new DateTime(2010, 1, 1), new DateTime(2013, 1, 1));
            Assert.AreEqual(2, p.PersonRuleCatAssignList.Count);
            Assert.AreEqual(2, p.PersonRangeAssignList.Count);
            Assert.AreEqual(2, p.AssignedWorkGroupList.Count);
            Assert.AreEqual(ADOEmploymentType2.ID, p.EmploymentType.ID);
            Assert.AreEqual(ADODepartment2.ID, p.Department.ID);
        }
Ejemplo n.º 2
0
        public void ChangeInfo_AsgRuleGrp_Test()
        {
            ClearSession();

            infoProxy.RuleGroupID       = ADORuleCat2.ID;
            infoProxy.RuleGroupFromDate = Utility.ToPersianDate(new DateTime(2012, 01, 01));
            infoProxy.RuleGroupToDate   = Utility.ToPersianDate(new DateTime(2012, 05, 01));

            bool result = busChnageInfo.ChangeInfo(ADOPerson1.PersonCode, infoProxy, out errorList);

            Assert.IsTrue(result);

            ClearSession();

            Person p = new BPerson().GetByID(ADOPerson1.ID);

            p.InitializeForExecuteRule(new DateTime(2010, 1, 1), new DateTime(2013, 1, 1), new DateTime(2010, 1, 1), new DateTime(2013, 1, 1));
            Assert.AreEqual(2, p.PersonRuleCatAssignList.Count);
        }