示例#1
0
        public void SetStatus_ConfirmEnflow_UniquePermitCheck_Test()
        {
            busKartabl = new BKartabl(ADOPerson1.ID, ADOUser1.ID, ADOUser1.UserName);

            KartableSetStatusProxy         proxy = new KartableSetStatusProxy(ADORequestHourlyDuty2.ID, ADOManagerFlow2.ID);
            IList <KartableSetStatusProxy> list  = new List <KartableSetStatusProxy>();

            list.Add(proxy);
            bool result = busKartabl.SetStatusOfRequest(list, RequestState.Confirmed, "");

            ClearSession();

            proxy = new KartableSetStatusProxy(ADORequestHourlyDuty3.ID, ADOManagerFlow2.ID);
            list  = new List <KartableSetStatusProxy>();
            list.Add(proxy);
            result = busKartabl.SetStatusOfRequest(list, RequestState.Confirmed, "");

            DatasetGatewayWorkFlow.TA_PermitPairDataTable table = permitPairTA.GetDataByRequestId(ADORequestHourlyDuty2.ID);
            decimal firstPErmitID = Convert.ToDecimal(table.Rows[0]["permit_ID"]);

            Assert.AreEqual(ADORequestHourlyDuty2.FromDate, Convert.ToDateTime(table.Rows[0]["permit_fromdate"]));
            Assert.AreEqual(1, table.Rows.Count);

            table = permitPairTA.GetDataByRequestId(ADORequestHourlyDuty3.ID);
            decimal secondPErmitID = Convert.ToDecimal(table.Rows[0]["permit_ID"]);

            Assert.AreEqual(1, table.Rows.Count);
            Assert.AreEqual(firstPErmitID, secondPErmitID);
        }
示例#2
0
        public void SetStatus_ConfirmNotEnflow_PermitCheck_Test()
        {
            busKartabl = new BKartabl(ADOPerson1.ID, ADOUser1.ID, ADOUser1.UserName);

            KartableSetStatusProxy         proxy = new KartableSetStatusProxy(ADORequestTraffic1.ID, ADOManagerFlow1.ID);
            IList <KartableSetStatusProxy> list  = new List <KartableSetStatusProxy>();

            list.Add(proxy);
            bool result = busKartabl.SetStatusOfRequest(list, RequestState.Confirmed, "");

            DatasetGatewayWorkFlow.TA_PermitPairDataTable table = permitPairTA.GetDataByRequestId(ADORequestDailyLeave1.ID);
            Assert.AreEqual(0, table.Rows.Count);
        }
示例#3
0
        public void SetStatusBySubstitute_ConfirmEnflow_PermitCheck_Test()
        {
            busKartabl = new BKartabl(ADOPerson6.ID, ADOUser6.ID, ADOUser6.UserName);

            KartableSetStatusProxy         proxy = new KartableSetStatusProxy(ADORequestDailyLeave1.ID, ADOManagerFlow3.ID);
            IList <KartableSetStatusProxy> list  = new List <KartableSetStatusProxy>();

            list.Add(proxy);
            bool result = busKartabl.SetStatusOfRequest(list, RequestState.Confirmed, "");

            DatasetGatewayWorkFlow.TA_PermitPairDataTable table = permitPairTA.GetDataByRequestId(ADORequestDailyLeave1.ID);
            Assert.AreEqual(ADORequestDailyLeave1.FromDate, Convert.ToDateTime(table.Rows[0]["permit_fromdate"]));
            Assert.AreEqual(1, table.Rows.Count);
        }
示例#4
0
        public void SetStatus_ConfirmTest()
        {
            busKartabl = new BKartabl(ADOPerson1.ID, ADOUser1.ID, ADOUser1.UserName);
            int count1 = busKartabl.GetRequestCount(RequestType.None, 1389, 2);
            IList <KartablProxy> list = busKartabl.GetAllRequests(RequestType.None, 1389, 2, 0, 10, KartablOrderBy.RegisteredBy);

            Assert.AreEqual(1, count1);
            Assert.AreEqual(1, list.Count);
            var reqList = from o in list
                          select new KartableSetStatusProxy(o.RequestID, o.ManagerFlowID);
            bool result = busKartabl.SetStatusOfRequest(reqList.ToList <KartableSetStatusProxy>(), RequestState.Confirmed, "");

            Assert.IsTrue(result);
            count1 = busKartabl.GetRequestCount(RequestType.None, 1389, 2);
            list   = busKartabl.GetAllRequests(RequestType.None, 1389, 2, 0, 10, KartablOrderBy.RegisteredBy);
            Assert.AreEqual(0, count1);
            Assert.AreEqual(0, list.Count);
        }
示例#5
0
        public void DeleteRequest_PermitCheck()
        {
            UpdateCurrentUserPersonId(ADOPerson1.ID);
            busKartabl = new BKartabl();

            KartableSetStatusProxy         proxy = new KartableSetStatusProxy(ADORequestDailyLeave1.ID, ADOManagerFlow3.ID);
            IList <KartableSetStatusProxy> list  = new List <KartableSetStatusProxy>();

            list.Add(proxy);
            bool result = busKartabl.SetStatusOfRequest(list, RequestState.Confirmed, "");

            DatasetGatewayWorkFlow.TA_PermitPairDataTable table = permitPairTA.GetDataByRequestId(ADORequestDailyLeave1.ID);
            Assert.AreEqual(1, table.Rows.Count);
            ClearSession();
            busReviewd.DeleteRequst(ADORequestDailyLeave1.ID, "");

            table = permitPairTA.GetDataByRequestId(ADORequestDailyLeave1.ID);
            Assert.AreEqual(0, table.Rows.Count);
        }
示例#6
0
        public void SetStatus_UnConfirmTest()
        {
            busKartabl = new BKartabl(ADOPerson1.ID, ADOUser1.ID, ADOUser1.UserName);
            int count1 = busKartabl.GetRequestCount(RequestType.None, 1389, 2);
            IList <KartablProxy> list = busKartabl.GetAllRequests(RequestType.None, 1389, 2, 0, 10, KartablOrderBy.RegisteredBy);

            Assert.AreEqual(1, count1);
            Assert.AreEqual(1, list.Count);
            var reqList = from o in list
                          select new KartableSetStatusProxy(o.RequestID, o.ManagerFlowID);
            bool result = busKartabl.SetStatusOfRequest(reqList.ToList <KartableSetStatusProxy>(), RequestState.Unconfirmed, "");

            Assert.IsTrue(result);
            count1 = busKartabl.GetRequestCount(RequestType.None, 1389, 2);

            DatasetGatewayWorkFlow.TA_PermitPairDataTable table = permitPairTA.GetDataByRequestId(list[0].ID);
            Assert.AreEqual(0, table.Rows.Count);

            list = busKartabl.GetAllRequests(RequestType.None, 1389, 2, 0, 10, KartablOrderBy.RegisteredBy);
            Assert.AreEqual(0, count1);
            Assert.AreEqual(0, list.Count);
        }