Exemplo n.º 1
0
        public void SavePostingTest()
        {
            //Arrange
            var parameter = new PositionApprove()
            {
                Operate           = "Update",
                UserID            = "mif",
                SchoolYear        = schoolyear,
                PositionID        = 1660,
                RequestSource     = "Form100",
                SchoolCode        = "0239",
                Comments          = "Postin Comments",
                Description       = "Posting description",
                FTE               = 1.0M,
                FTEPanel          = "Full",
                StartDate         = "",
                EndDate           = "",
                Owner             = "frijiom",
                DatePublish       = "",
                DateApplyOpen     = "",
                DateApplyClose    = "",
                PositionLevel     = "BC708E",
                QualificationCode = "",
                Qualification     = ""
            };
            string expect = "Successfully";

            //Act
            var result = PostingApproveRequestExe.SavePosting(parameter, 1666);

            //Assert
            Assert.AreEqual(expect, result, $"  Save Posting Request { result}");
        }
Exemplo n.º 2
0
 public static string SavePosition(PositionApprove position)
 {
     try
     {
         //  StaffProfile parameter = new StaffProfile { Operate = operate, UserID = userID, CPNum = CPNum, Action = action };
         string paramaters = "@Operate,@UserID,@SchoolYear,@SchoolCode,@PositionID,@PositionType,@PositionTitle,@PositionLevel, @Qualification, @Description,@FTE,@FTEPanel, @StartDate,@EndDate, @DatePublish,@DateApplyStart,@DateDeadline, @Comments, @ReplaceTeacherID, @ReplaceTeacher";
         string sp         = "dbo.tcdsb_LTO_PositionDetails_Approve " + paramaters;
         string result     = GeneralDataAccess.TextValue(sp, position);
         //  return SignatureProcess.SignoffResult(operate, userID, userRole, schoolYear, schoolCode, actionType, actionDate);
         return(result);
     }
     catch (Exception ex)
     {
         var exm = ex.Message;
         return("Failed");
     }
 }
Exemplo n.º 3
0
        public void CommonExcuteTest_ApprovePosition_RejectRequest_Return_Successfully()
        {
            //Arrange
            string action    = "Reject";
            var    parameter = new PositionApprove()
            {
                Operate    = action,
                SchoolYear = "20192020",
                PositionID = 11532
            };
            //Act
            string expect = "Successfully";
            string SP     = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string result = CommonExcute <PositionApprove> .GeneralValue(SP, parameter);

            //Assert
            Assert.AreEqual(expect, result, $" Reject Posting request on {parameter.PositionID}  { result}");
        }
Exemplo n.º 4
0
        public void CommonExcuteTest_ApprovePosition_PostingForm100Request_Return_NewPostingNumber()
        {
            //Arrange
            string action    = "Posting";
            string source    = "Form100";
            var    parameter = new PositionApprove()
            {
                Operate           = action,
                UserID            = "mif",
                SchoolYear        = "20192020",
                PositionID        = 1660,
                SchoolCode        = "0239",
                Comments          = "Posting Comments",
                Description       = "Posting description",
                FTE               = 1.0M,
                FTEPanel          = "Full",
                StartDate         = "",
                EndDate           = "",
                Owner             = "frijiom",
                DatePublish       = "",
                DateApplyOpen     = "",
                DateApplyClose    = "",
                PositionLevel     = "BC708E",
                QualificationCode = "",
                Qualification     = "",
                CPNum             = "",
                RequestSource     = source,
                ReplaceTeacherID  = "Test Teacher",
            };

            string expect = "Successfully";
            string SP     = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string result = CommonExcute <PositionApprove> .GeneralValue(SP, parameter);

            int positionID = Int32.Parse(result);

            parameter.PositionID = positionID;
            parameter.Operate    = "PostingNumber";
            string PostingNumber = CommonOperationExcute.ApproveOperation(parameter, "Property");

            Assert.AreEqual(expect, result, $"  REquest Posting position  New Posting Number { PostingNumber }");
        }
Exemplo n.º 5
0
        public void RejectRequestTest()
        {
            //Arrange
            var parameter = new PositionApprove()
            {
                Operate       = "Reject",
                UserID        = "mif",
                SchoolYear    = schoolyear,
                PositionID    = 1666,
                RequestSource = "Form100",
                SchoolCode    = "0419"
            };
            string expect = "Successfully";

            //Act
            var result = PostingApproveRequestExe.RejectRequest(parameter, 1666);

            //Assert
            Assert.AreEqual(expect, result, $"  Reject Posting Request e{ result}");
        }
Exemplo n.º 6
0
        public void CommonExcuteTest_ApprovePosition_Save_Return_Successfully()
        {
            //Arrange
            int ids = 0;

            string action    = "Save";
            var    parameter = new PositionApprove()
            {
                Operate           = action,
                UserID            = "mif",
                SchoolYear        = schoolyear,
                SchoolCode        = "0549",
                PositionID        = ids,
                PositionType      = "LTO",
                PositionTitle     = "Position Title for Test ",
                PositionLevel     = "BC012E",
                Qualification     = "",
                QualificationCode = "",
                Description       = "Posiition descriptiion for test",
                FTE              = 0.50M,
                FTEPanel         = "AM",
                Comments         = "Test posting update function comments",
                StartDate        = "",
                EndDate          = "",
                Owner            = "mif",
                ReplaceTeacherID = "0000000"
            };
            string expect = "Successfully";

            //Act

            string SP     = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string result = CommonExcute <PositionApprove> .GeneralValue(SP, parameter);

            //Assert
            Assert.AreEqual(expect, result, $"  Update Posting position Content { result}");
        }
Exemplo n.º 7
0
        public void CommonExcuteTest_ApprovePosition_PostingPrincipalRequest_Return_NewPostingNumber()
        {
            //Arrange
            int    requestid = getNewRequestID("LTO");
            string action    = "Posting";
            string source    = "Principal";
            var    parameter = new PositionApprove()
            {
                Operate    = action,
                UserID     = "mif",
                SchoolYear = schoolyear,
                SchoolCode = "0546",

                PositionID       = requestid,
                Comments         = "Posting comments",
                StartDate        = DateFC.YMD2(DateTime.Now.ToShortDateString()),
                EndDate          = DateFC.YMD2(DateTime.Now.ToShortDateString()),
                DatePublish      = DateFC.YMD2(DateTime.Now.ToShortDateString()),
                DateApplyOpen    = DateFC.YMD2(DateTime.Now.ToShortDateString()),
                DateApplyClose   = DateFC.YMD2(DateTime.Now.ToShortDateString()),
                CPNum            = "0000000",
                RequestSource    = source,
                ReplaceTeacherID = "00000000"
            };

            string expect = "Successfully";
            string SP     = CommonExcute.SPNameAndParameters(SPFile, cPage, action);
            string result = CommonExcute <PositionApprove> .GeneralValue(SP, parameter);

            int positionID = Int32.Parse(result);

            parameter.PositionID = positionID;
            parameter.Operate    = "PostingNumber";
            string PostingNumber = CommonOperationExcute.ApproveOperation(parameter, "Property");

            Assert.AreEqual(expect, result, $"  REquest Posting position  New Posting Number { PostingNumber }");
        }
Exemplo n.º 8
0
        public static string TestCount(PositionApprove position, int positonID)
        {
            var myval = new PostingApproveRequest();

            return(myval.TestCount(position, positonID));
        }
Exemplo n.º 9
0
        public static string SavePosting(PositionApprove position, int positonID)
        {
            var myval = new PostingApproveRequest();

            return(myval.SavePosting(position, positonID));
        }
Exemplo n.º 10
0
        //public static string UpdatePosting(PositionApprove position, int positonID)
        //{
        //    var myval = new PostingApproveRequest();
        //    return myval.UpdatePosting(position, positonID);
        //}
        public static string DeletePosting(PositionApprove operation, int positonID)
        {
            var myval = new PostingApproveRequest();

            return(myval.DeletePosting(operation, positonID));
        }
Exemplo n.º 11
0
        public static string RejectRequest(PositionApprove operation, int positonID)
        {
            var myval = new PostingApproveRequest();

            return(myval.RejectRequestPosting(operation, positonID));
        }
Exemplo n.º 12
0
 public static string ApproveOperation(PositionApprove operation, string action)
 {
     return(Operation(operation, action));
 }