示例#1
0
        public DateTime YMDTest01(string eDate)
        {
            DateTime result = DateFC.YMD(eDate);

            return(result);
            // TODO: add assertions to method DateFCTest.YMDTest01(String)
        }
示例#2
0
        public string YMDStrTest(string vDate)
        {
            string result = DateFC.YMDStr(vDate);

            return(result);
            // TODO: add assertions to method DateFCTest.YMDStrTest(String)
        }
示例#3
0
        public string CurrentYearStringTest()
        {
            string result = DateFC.CurrentYearString();

            return(result);
            // TODO: add assertions to method DateFCTest.CurrentYearStringTest()
        }
示例#4
0
        public string YMDTest02(DateTime vDate, string sign)
        {
            string result = DateFC.YMD(vDate, sign);

            return(result);
            // TODO: add assertions to method DateFCTest.YMDTest02(DateTime, String)
        }
示例#5
0
        private void Assemblies_Title()
        {
            string userID = User.Identity.Name;

            LabelSchoolyear.Text     = DateFC.SchoolYearFrom("-", WorkingProfile.SchoolYear);
            LabelSchool.Text         = WorkingProfile.SchoolName;
            LabelPrincipal.Text      = WorkingProfile.SchoolPrincipal;
            LabelSuperintendent.Text = WorkingProfile.UserArea;
            hfSchoolcode.Value       = WorkingProfile.SchoolCode;
            hfSchoolyear.Value       = WorkingProfile.SchoolYear;
            hfUserRole.Value         = WorkingProfile.UserRole;
            hfUserID.Value           = User.Identity.Name;
            hfSignOff.Value          = SignOff.Signature("Result", userID, WorkingProfile.UserRole, WorkingProfile.SchoolYear, WorkingProfile.SchoolCode, "School");
            hfSignOffSO.Value        = SignOff.Signature("Result", userID, WorkingProfile.UserRole, WorkingProfile.SchoolYear, WorkingProfile.SchoolCode, "SO");
            hfPublish.Value          = SignOff.Signature("Result", userID, WorkingProfile.UserRole, WorkingProfile.SchoolYear, WorkingProfile.SchoolCode, "Publish");
            try
            {
                foreach (Control pControl in FormContent.Controls)
                {
                    if (pControl is Label)
                    {
                        string code = pControl.ID.Replace("Label", "");
                        Label  lbl  = (Label)pControl;
                        lbl.Text = FormData.Title(code);
                    }
                }
            }
            catch (Exception ex)
            {
                var ms = ex.Message;
            }
        }
示例#6
0
        public void StartEndDateTest_byType_POP_CheckStartDate()
        {
            //Arrange
            string          action          = "StartDate";
            string          expectStartDate = "2019/09/01";
            DateTime        actinDate       = DateFC.YMD(expectStartDate);
            DateTime        currentDate     = DateTime.Now;
            SearchParameter parameter       = new SearchParameter()
            {
                Operate      = action,
                SchoolYear   = "20192020",
                PositionType = "POP"
            };

            if (currentDate > actinDate)
            {
                expectStartDate = DateFC.YMD(currentDate, "/");
            }

            // Act
            var    myDate    = GeneralExe.StartEndDate(parameter)[0];
            var    startDate = myDate.StartDate;
            string expect    = expectStartDate;
            string result    = DateFC.YMD(startDate);

            //Assert
            Assert.AreEqual(expect, result, $"Start date Value  { result} ");
        }
示例#7
0
        public void LimitedDateTest_afterNewSchoolYearStart()
        {
            //Arrange
            var parameter = new LimitDate()
            {
                SchoolYear   = schoolyear,
                PositionType = "LTO",
                Operate      = "GetDefault",
                DatePublish  = DateFC.YMD(DateTime.Now)
            };
            int    expect  = 1;
            string expect1 = DateFC.YMD(DateTime.Now);
            string expect2 = "2019/06/28";
            string expect3 = DateFC.YMD(getCloseDate(DateTime.Now.AddDays(2)));
            //Act
            var    list        = CommonListExecute.LimitedDate(parameter);
            int    result      = 1;
            int    resultCount = list.Count;
            string result1     = list[0].StartDate;
            string result2     = list[0].EndDate;
            string result3     = list[0].DateApplyClose;

            //Assert
            Assert.AreEqual(expect1, result1, $" Default start Date is { result1}");
            Assert.AreEqual(expect2, result2, $" Default End Date is { result2}");
            Assert.AreEqual(expect3, result3, $" Default Close Date is { result3}");
            Assert.AreEqual(expect, result, $" Default Datetime List is { result}");
            Assert.IsTrue(resultCount >= 0, $" Default Datetime is { result}");
        }
示例#8
0
        public string YearTOGOTest(string strType, string cSchoolYear)
        {
            string result = DateFC.YearTOGO(strType, cSchoolYear);

            return(result);
            // TODO: add assertions to method DateFCTest.YearTOGOTest(String, String)
        }
示例#9
0
        public void DefaultDateTest_return_runingDateValue_LTO()
        {
            //Arrange
            string          action    = "DefaultDate";
            SearchParameter parameter = new SearchParameter()
            {
                Operate      = action,
                SchoolYear   = "20192020",
                PositionType = "LTO"
            };


            // Act
            var myGridview = new System.Web.UI.WebControls.GridView();


            var myDate = GeneralExe.DefaultDate(parameter)[0];
            //myGridview.AutoGenerateColumns = true;
            //myGridview.DataSource = myDatasource;
            //myGridview.DataBind();

            var startDate   = myDate.StartDate;
            var endDate     = myDate.EndDate;
            var publishDate = myDate.DatePublish;
            var openDate    = myDate.DateApplyOpen;
            var closeDate   = myDate.DateApplyClose;

            string expect = DateFC.YMD(DateTime.Now);
            string result = DateFC.YMD(publishDate);

            //Assert
            Assert.AreEqual(expect, result, $"default publish Date Value  { result}");
        }
示例#10
0
        public int AgeTest(DateTime BirthDate)
        {
            int result = DateFC.Age(BirthDate);

            return(result);
            // TODO: add assertions to method DateFCTest.AgeTest(DateTime)
        }
示例#11
0
        private void CreateReportandSaveToDB(string schoolYear, string schoolCode, string publishCycle, string GoalType, string schoolName, string schoolNameB)
        {
            string reportName = WebConfig.getValuebyKey("PublishDocumentName");

            string userID = WorkingProfile.UserID;


            string publishDate = DateFC.YMD(DateTime.Now);

            Byte[] pdfReport = ReportRender.GetOneReport(reportName, userID, schoolYear, schoolCode, "1");

            string result = PushToSP.PublishPLFtoSharePointSite("SLIP", pdfReport, schoolYear, schoolCode, schoolName, schoolNameB);

            //  UploadFileToSharePointSite.PushToSite("SLIP", pdfReport, schoolYear, schoolCode, schoolName, schoolNameB);
            if (result == "Successful")
            {
                string action        = btnReturn.Text;
                string signOffResult = SignOff.Signature2(action, userID, schoolYear, schoolCode, "Publish", publishDate);
                // SaveSLIPPublishDataToHistoryDirectory(schoolCode + ".PDF", pdfReport);
                errorlabel.Text      = "The School PLF has been published to School Web site.";
                errorlabel.ForeColor = Color.Red;
                //   PushToSP.SaveFileToHistoryFolder(WorkingProfile.SchoolYear, schoolCode + ".PDF", pdfReport);
            }
            else
            {
                errorlabel.Text = "The School PLF published failed to School Web site.";
            }
        }
示例#12
0
        public string FormatTest(DateTime pDate, string pFormat)
        {
            string result = DateFC.Format(pDate, pFormat);

            return(result);
            // TODO: add assertions to method DateFCTest.FormatTest(DateTime, String)
        }
示例#13
0
        public string SchoolYearPreviousTest(string strType, string cSchoolYear)
        {
            string result = DateFC.SchoolYearPrevious(strType, cSchoolYear);

            return(result);
            // TODO: add assertions to method DateFCTest.SchoolYearPreviousTest(String, String)
        }
示例#14
0
        private string Step8_NoticeCandidateToSchoolPrincipal()
        {
            //Arrange

            InterviewNotice interviewNotice = new InterviewNotice()
            {
                Operate     = "Notice Update",
                UserID      = "mif",
                SchoolYear  = _schoolYear,
                PositionID  = _positionId.ToString(),
                NoticeDate  = DateFC.YMD(DateTime.Now),
                PrincipalID = _principalId
            };

            //Act
            string expect = "Successfully";
            string result = SelectCandidateExe.NoticeUpdate(interviewNotice);


            //Assert
            Assert.AreEqual(expect, result, $"Notice position { interviewNotice.PositionID } interview candiates to  School Principal { _principalId } ");


            return("Successfully");
        }
示例#15
0
        public string YMDTest(DateTime vDate)
        {
            string result = DateFC.YMD(vDate);

            return(result);
            // TODO: add assertions to method DateFCTest.YMDTest(DateTime)
        }
示例#16
0
        public int AgeTest01(DateTime birthdate, DateTime comparedate)
        {
            int result = DateFC.Age(birthdate, comparedate);

            return(result);
            // TODO: add assertions to method DateFCTest.AgeTest01(DateTime, DateTime)
        }
示例#17
0
        public void DefaultDateTest()
        {
            //Arrange
            string          action    = "DefaultDate";
            SearchParameter parameter = new SearchParameter()
            {
                Operate      = action,
                SchoolYear   = "20192020",
                PositionType = "LTO"
            };

            // Act

            List <PositionPublish> myDate = PublishPositionExe.DefaultDate(parameter);

            //myGridview.AutoGenerateColumns = true;
            //myGridview.DataSource = myDatasource;
            //myGridview.DataBind();

            var startDate   = myDate[0].StartDate;
            var endDate     = myDate[0].EndDate;
            var publishDate = myDate[0].DatePublish;
            var openDate    = myDate[0].DateApplyOpen;
            var closeDate   = myDate[0].DateApplyClose;

            string expect = DateFC.YMD(DateTime.Now);
            string result = publishDate;

            //Assert
            Assert.AreEqual(expect, result, $"default publish Date Value  { result}");
        }
示例#18
0
        public void DefaultDateTest_return_runingDateValue_POP()
        {
            //Arrange
            string          action    = "DefaultDate";
            SearchParameter parameter = new SearchParameter()
            {
                Operate      = action,
                SchoolYear   = "20192020",
                PositionType = "POP"
            };

            // Act
            var myDate      = GeneralExe.DefaultDate(parameter)[0];
            var startDate   = myDate.StartDate;
            var endDate     = myDate.EndDate;
            var publishDate = myDate.DatePublish;
            var openDate    = myDate.DateApplyOpen;
            var closeDate   = myDate.DateApplyClose;

            string expect = DateFC.YMD(DateTime.Now);
            string result = DateFC.YMD(publishDate);

            //Assert
            Assert.AreEqual(expect, result, $"default publish Date Value  { result}");
        }
示例#19
0
        public void Date_Format_EnterDate_Return_MMDDYYYY_Test()
        {   //Arrange
            string   iDate  = "12/08/2018";
            DateTime tDate  = Convert.ToDateTime(iDate);
            var      expect = "12/08/2018";
            // Act
            var result = DateFC.Format(tDate, "MMDDYYYY");

            //Assert
            Assert.AreEqual(expect, result, $"Format the date in 12/08/2018, {result}");
        }
示例#20
0
        protected void btnReturn_Click(object sender, EventArgs e)
        {
            string userID     = User.Identity.Name;
            string schoolyear = Page.Request.QueryString["yID"];
            string schoolcode = Page.Request.QueryString["sID"];
            string signType   = Page.Request.QueryString["tID"];

            string action        = btnReturn.Text;
            string vDate         = DateFC.YMD(DateTime.Now);
            string signOffResult = SignOff.Signature2(action, userID, schoolyear, schoolcode, "Publish", vDate);

            CreateReportandSaveToDB(schoolyear, schoolcode, "1", "All", WorkingProfile.SchoolName, WorkingProfile.SchoolNameB);
        }
示例#21
0
        public void Date_Format_YMD_withLinkSignSlish_Test()
        {
            //Arrange
            string   iDate  = "12/08/2018";
            DateTime tDate  = Convert.ToDateTime(iDate);
            var      expect = "2018/12/08";

            // Act
            var result = DateFC.YMD(tDate, "/");

            //Assert
            Assert.AreEqual(expect, result, $"Format the date YMD method 2018/12/08, {result}");
        }
示例#22
0
        public void YearTOGOTest_Previous()
        {
            //Arrange
            string cschoolyear = "20182019";

            string expect = "20172018";

            // Act
            var result = DateFC.YearTOGO("Pre", 10, cschoolyear);

            //Assert
            Assert.AreEqual(expect, result, $"school year Go Previous, {result}");
        }
示例#23
0
        public void YearTOGOTest_Next()
        {
            //Arrange
            string cschoolyear = "20182019";

            string expect = "20192020";

            // Act
            var result = DateFC.YearTOGO("Next", 10, cschoolyear);

            //Assert
            Assert.AreEqual(expect, result, $"school year Go Next, {result}");
        }
示例#24
0
        public void SchoolYearPreviousTest()
        {
            //Arrange
            string cschoolyear = "20172018";

            string expect = "2016-2017";

            // Act
            var result = DateFC.SchoolYearPrevious("-", cschoolyear);

            //Assert
            Assert.AreEqual(expect, result, $"school year previous school year format, {result}");
        }
示例#25
0
        public void SchoolYearNextTest()
        {
            //Arrange
            string cschoolyear = "20172018";

            string expect = "2018-2019";

            // Act
            var result = DateFC.SchoolYearNext("-", cschoolyear);

            //Assert
            Assert.AreEqual(expect, result, $"Next school year format, {result}");
        }
示例#26
0
        public void Age_GetAgebyCurrentDate_Test()
        {
            //Arrange
            string   iDate  = "12/08/2010";
            DateTime tDate  = Convert.ToDateTime(iDate);
            string   expect = "10";

            // Act
            var result = DateFC.Age(tDate).ToString();

            //Assert
            Assert.AreEqual(expect, result, $"Get Age by current date 8, {result}");
        }
示例#27
0
        public void Age_GetAgebyGivenDate_Test()
        {
            //Arrange
            string   iDate         = "12/08/2005";
            DateTime tDate         = Convert.ToDateTime(iDate);
            string   compaireDate  = "2020/12/08";
            DateTime tCompaireDate = Convert.ToDateTime(compaireDate);
            string   expect        = "15";

            // Act
            var result = DateFC.Age(tDate, tCompaireDate).ToString();

            //Assert
            Assert.AreEqual(expect, result, $"get Age by given date 15, {result}");
        }
示例#28
0
        private string Step10_RecommendForHire()
        {
            // 10 Recommend one interview candidate for hire
            //Arrange

            //Arrange
            string          result  = "";
            InterviewResult outcome = new InterviewResult()
            {
                Operate        = "Recommend",
                SchoolYear     = _schoolYear,
                PositionID     = _positionId.ToString(),
                UserID         = _principalId,
                CPNum          = _cpNum,
                Acceptance     = "1",
                OutCome        = "6", // interview
                Recommendation = "Principal interview comments from full testing process interview step 9",
                InterviewDate  = DateFC.YMD(DateTime.Now),
                EffectiveDate  = DateFC.YMD(DateTime.Now),
            };

            var parameter = new
            {
                Operate    = "",
                SchoolYear = _schoolYear,
                PositionID = _positionId
            };

            //Act
            string expect = "Successfully";
            List <ApplicantListSelect> interviewlist = SelectCandidateExe.Applicants(parameter);

            foreach (ApplicantListSelect applicant in interviewlist)
            {
                string teachername = applicant.TeacherName;
                outcome.CPNum = applicant.CPNum;

                if (outcome.Acceptance == "1" && outcome.OutCome == "6")
                {
                    result      = InterviewProcessExe.Recommend(outcome);
                    _hiredCpNum = outcome.CPNum;
                    break;
                }
            }
            //Assert
            Assert.AreEqual(expect, result, $" Recommented for hire of { outcome.CPNum } ");
            return(result);
        }
示例#29
0
        private void Assemblies_Title()
        {
            string userID = User.Identity.Name;

            LabelSchoolyear.Text     = DateFC.SchoolYearFrom("-", schoolYear);
            LabelSchool.Text         = WorkingProfile.SchoolName;
            LabelPrincipal.Text      = WorkingProfile.SchoolPrincipal;
            LabelSuperintendent.Text = WorkingProfile.UserAreaSuperintendent;
            hfSchoolcode.Value       = schoolCode;
            hfSchoolyear.Value       = schoolYear;
            hfUserRole.Value         = WorkingProfile.UserRole;
            hfUserID.Value           = User.Identity.Name;
            hfSignOff.Value          = SignOff.Signature("Result", userID, "", schoolYear, schoolCode, "School");
            hfSignOffSO.Value        = SignOff.Signature("Result", userID, "", schoolYear, schoolCode, "SO");
            hfPublish.Value          = SignOff.Signature("Result", userID, "", schoolYear, schoolCode, "Publish");
            hfComplete.Value         = SignOff.Signature("Result", userID, "", schoolYear, schoolCode, "Complete");
        }
示例#30
0
        private string Step11_ConfirmHire()
        {
            // 11. HR staff confirm hire
            //Arrange
            var parameter = new
            {
                SchoolYear = _schoolYear,
                PositionID = _positionId,
                CPNum      = _hiredCpNum
            };


            List <PositionHire> hirePositionlist = ConfirmHireExe.Position(parameter);
            PositionHire        position         = hirePositionlist[0];

            //Act
            ParametersForOperationHire goHire = new ParametersForOperationHire()
            {
                Operate        = "ConfirmHire",
                UserID         = "mif",
                SchoolYear     = _schoolYear,
                Comments       = $"Auto testing Hired the person { position.TeacherName  } to this { position.PositionTitle } by Full test process ",
                PositionID     = position.PositionID,
                PositionType   = position.PositionType,
                CPNum          = _hiredCpNum,
                DateConfirm    = DateFC.YMD(DateTime.Now),
                DateEffective  = position.DateEffective,
                DateEnd        = position.EndDate,
                Acceptance     = "1",
                PrincipalEmail = "1",
                OfficerEmail   = "0",
                PayStatus      = "9",
                Action         = "ConfirmHire"
            };

            string result = ConfirmHireExe.Confirm(goHire);
            string expect = "Successfully";

            //Assert
            Assert.AreEqual(expect, result, $"Hired { position.TeacherName } on  { position.PositionTitle } . ");


            return("Successfully");
        }