public void TestSetup() { Convert.ToInt32(personTA.InsertQuery("0000", "Ali", true, null)); int personId = Convert.ToInt32(personTA.GetDataByBarcode("0000").Rows[0]["prs_ID"]); organ_testObject = new OrganizationUnit(); busOrgan = new BOrganizationUnit(); table = organTA.GetDataByParent(); ADOOrganParent.ID = Convert.ToInt32(table.Rows[0]["organ_ID"]); ADOOrganParent.Name = Convert.ToString(table.Rows[0]["organ_Name"]); ADOOrganParent.CustomCode = Convert.ToString(table.Rows[0]["organ_CustomCode"]); organTA.InsertQuery("Level2_1", "0-1", personId, ADOOrganParent.ID, String.Format(",{0},", ADOOrganParent.ID)); organTA.InsertQuery("Level2_2", "0-2", personId, ADOOrganParent.ID, String.Format(",{0},", ADOOrganParent.ID)); table = organTA.GetDataByCustomCode("0-1"); ADOOrgan.ID = Convert.ToInt32(table.Rows[0]["organ_ID"]); ADOOrgan.ParentID = Convert.ToInt32(table.Rows[0]["organ_ParentID"]); ADOOrgan.Name = Convert.ToString(table.Rows[0]["organ_Name"]); ADOOrgan.CustomCode = Convert.ToString(table.Rows[0]["organ_CustomCode"]); ADOOrgan.PersonID = Convert.ToInt32(table.Rows[0]["organ_PersonID"]); table = organTA.GetDataByCustomCode("0-2"); ADOOrgan2.ID = Convert.ToInt32(table.Rows[0]["organ_ID"]); ADOOrgan2.ParentID = Convert.ToInt32(table.Rows[0]["organ_ParentID"]); ADOOrgan2.Name = Convert.ToString(table.Rows[0]["organ_Name"]); ADOOrgan2.CustomCode = Convert.ToString(table.Rows[0]["organ_CustomCode"]); ADOOrgan2.PersonID = Convert.ToInt32(table.Rows[0]["organ_PersonID"]); organTA.Insert("Level3_1", "0-3", personId, ADOOrgan.ID, String.Format(",{0},{1}", ADOOrganParent.ID, ADOOrgan.ID)); table = organTA.GetDataByCustomCode("0-3"); ADOOrgan3.ID = Convert.ToInt32(table.Rows[0]["organ_ID"]); ADOOrgan3.ParentID = Convert.ToInt32(table.Rows[0]["organ_ParentID"]); ADOOrgan3.Name = Convert.ToString(table.Rows[0]["organ_Name"]); ADOOrgan3.CustomCode = Convert.ToString(table.Rows[0]["organ_CustomCode"]); ADOOrgan3.PersonID = Convert.ToInt32(table.Rows[0]["organ_PersonID"]); }
public void TestSetup() { #region organization unit DatabaseGateway.TA_OrganizationUnitDataTable organTable = new DatabaseGateway.TA_OrganizationUnitDataTable(); organTable = organTA.GetDataByParent(); ADOOrganRoot.ID = Convert.ToInt32(organTable.Rows[0]["organ_ID"]); ADOOrganRoot.Name = Convert.ToString(organTable.Rows[0]["organ_Name"]); ADOOrganRoot.CustomCode = Convert.ToString(organTable.Rows[0]["organ_CustomCode"]); organTA.Insert("Level2_1", "2020_11", ADOPerson2.ID, ADOOrganRoot.ID, String.Format(",{0},", ADOOrganRoot.ID)); organTable = organTA.GetDataByCustomCode("2020_11"); ADOOrgan.ID = Convert.ToInt32(organTable.Rows[0]["organ_ID"]); ADOOrgan.Name = Convert.ToString(organTable.Rows[0]["organ_Name"]); ADOOrgan.CustomCode = Convert.ToString(organTable.Rows[0]["organ_CustomCode"]); #endregion #region managers managerTA.Insert(ADOPerson1.ID, null); DatasetGatewayWorkFlow.TA_ManagerDataTable masterTable = managerTA.GetDataByPersonID(ADOPerson1.ID); ADOManager1.ID = Convert.ToInt32(masterTable.Rows[0]["MasterMng_ID"]); ADOManager1.Person = ADOPerson1; ADOManager1.OrganizationUnit = null; managerTA.Insert(null, ADOOrgan.ID); masterTable = managerTA.GetDataByOrganID(ADOOrgan.ID); ADOManager2.ID = Convert.ToInt32(masterTable.Rows[0]["MasterMng_ID"]); ADOManager2.Person = null; ADOManager2.OrganizationUnit = ADOOrgan; managerTA.Insert(ADOPerson3.ID, null); masterTable = managerTA.GetDataByPersonID(ADOPerson3.ID); ADOManager3.ID = Convert.ToInt32(masterTable.Rows[0]["MasterMng_ID"]); ADOManager3.Person = ADOPerson3; ADOManager3.OrganizationUnit = null; #endregion #region pishcart access group precardAccessGroupTA.Insert("PrecardAccessGroupTest"); DatasetGatewayWorkFlow.TA_PrecardAccessGroupDataTable accessTable = precardAccessGroupTA.GetDataBy1("PrecardAccessGroupTest"); ADOaccessGroup.ID = Convert.ToInt32(accessTable.Rows[0]["accessGrp_ID"]); ADOaccessGroup.Name = Convert.ToString(accessTable.Rows[0]["accessGrp_Name"]); #endregion #region Flow flowTA.Insert(ADOaccessGroup.ID, false, false, "FlowTest1"); DatasetGatewayWorkFlow.TA_FlowDataTable flowTable = flowTA.GetDataByName("FlowTest1"); ADOFlow1.ID = Convert.ToInt32(flowTable.Rows[0]["flow_ID"]); ADOFlow1.AccessGroup = ADOaccessGroup; ADOFlow1.ActiveFlow = false; ADOFlow1.WorkFlow = false; ADOFlow1.FlowName = "FlowTest1"; flowTA.Insert(ADOaccessGroup.ID, false, false, "FlowTest2"); flowTable = flowTA.GetDataByName("FlowTest2"); ADOFlow2.ID = Convert.ToInt32(flowTable.Rows[0]["flow_ID"]); ADOFlow2.AccessGroup = ADOaccessGroup; ADOFlow2.ActiveFlow = false; ADOFlow2.WorkFlow = false; ADOFlow2.FlowName = "FlowTest2"; flowTA.Insert(ADOaccessGroup.ID, false, false, "FlowTest3"); flowTable = flowTA.GetDataByName("FlowTest3"); ADOFlow3.ID = Convert.ToInt32(flowTable.Rows[0]["flow_ID"]); ADOFlow3.AccessGroup = ADOaccessGroup; ADOFlow3.ActiveFlow = false; ADOFlow3.WorkFlow = false; ADOFlow3.FlowName = "FlowTest3"; #endregion #region manager Flow managerFlowTA.Insert(ADOManager1.ID, 1, ADOFlow1.ID, true); managerFlowTA.Insert(ADOManager1.ID, 2, ADOFlow2.ID, true); managerFlowTA.Insert(ADOManager3.ID, 2, ADOFlow3.ID, true); #endregion #region under managment undermanagmentTA.Insert(ADOFlow1.ID, ADOPerson2.ID, ADODepartment1.ID, false, true); undermanagmentTA.Insert(ADOFlow1.ID, ADOPerson5.ID, ADODepartment1.ID, false, true); DatasetGatewayWorkFlow.TA_UnderManagmentDataTable underManagmentTable = new DatasetGatewayWorkFlow.TA_UnderManagmentDataTable(); underManagmentTable = undermanagmentTA.GetDataByManagmentID(ADOFlow1.ID); ADOUnderManagment.ID = Convert.ToInt32(underManagmentTable.Rows[0]["underMng_ID"]); ADOUnderManagment.Contains = true; ADOUnderManagment.ContainInnerChilds = false; ADOUnderManagment.Person = ADOPerson2; ADOUnderManagment.Flow = ADOFlow1; undermanagmentTA.Insert(ADOFlow2.ID, ADOPerson4.ID, ADODepartment1.ID, false, true); undermanagmentTA.Insert(ADOFlow3.ID, ADOPerson5.ID, null, false, true); #endregion bussWorkTime = new BWorkedTime(ADOUser1.UserName); }
public void TestSetup() { manager_testObject = new Manager(); busManager = new BManager(); userTA.InsertQuery(ADOPerson1.ID, "TestADOPerson1"); userTA.InsertQuery(ADOPerson3.ID, "TestADOPerson3"); DatabaseGateway.TA_SecurityUserDataTable userTable = new DatabaseGateway.TA_SecurityUserDataTable(); userTable = userTA.GetDataByUserName("TestADOPerson1"); ADOUser1.ID = Convert.ToInt32(userTable.Rows[0]["user_ID"]); ADOUser1.UserName = "******"; userTable = userTA.GetDataByUserName("TestADOPerson3"); ADOUser2.ID = Convert.ToInt32(userTable.Rows[0]["user_ID"]); ADOUser2.UserName = "******"; DatabaseGateway.TA_OrganizationUnitDataTable table = organTA.GetDataByParent(); ADOOrganParent.ID = Convert.ToInt32(table.Rows[0]["organ_ID"]); ADOOrganParent.CustomCode = Convert.ToString(table.Rows[0]["organ_CustomCode"]); organTA.Insert("TestLevel2_1", "0-1", ADOPerson2.ID, ADOOrganParent.ID, String.Format(",{0},", ADOOrganParent.ID)); table = organTA.GetDataByCustomCode("0-1"); ADOOrgan.ID = Convert.ToInt32(table.Rows[0]["organ_ID"]); ADOOrgan.ParentID = Convert.ToInt32(table.Rows[0]["organ_ParentID"]); ADOOrgan.Name = Convert.ToString(table.Rows[0]["organ_Name"]); ADOOrgan.CustomCode = Convert.ToString(table.Rows[0]["organ_CustomCode"]); ADOOrgan.PersonID = Convert.ToInt32(table.Rows[0]["organ_PersonID"]); organTA.Insert("TestLevel2_2", "0-2", ADOPerson1.ID, ADOOrganParent.ID, String.Format(",{0},", ADOOrganParent.ID)); table = organTA.GetDataByCustomCode("0-2"); ADOOrgan2.ID = Convert.ToInt32(table.Rows[0]["organ_ID"]); ADOOrgan2.ParentID = Convert.ToInt32(table.Rows[0]["organ_ParentID"]); ADOOrgan2.Name = Convert.ToString(table.Rows[0]["organ_Name"]); ADOOrgan2.CustomCode = Convert.ToString(table.Rows[0]["organ_CustomCode"]); ADOOrgan2.PersonID = Convert.ToInt32(table.Rows[0]["organ_PersonID"]); organTA.Insert("TestLevel2_3", "0-3", ADOPerson3.ID, ADOOrganParent.ID, String.Format(",{0},", ADOOrganParent.ID)); table = organTA.GetDataByCustomCode("0-3"); ADOOrgan3.ID = Convert.ToInt32(table.Rows[0]["organ_ID"]); ADOOrgan3.ParentID = Convert.ToInt32(table.Rows[0]["organ_ParentID"]); ADOOrgan3.Name = Convert.ToString(table.Rows[0]["organ_Name"]); ADOOrgan3.CustomCode = Convert.ToString(table.Rows[0]["organ_CustomCode"]); ADOOrgan3.PersonID = Convert.ToInt32(table.Rows[0]["organ_PersonID"]); managerTA.Insert(ADOPerson1.ID, null); managerTA.Insert(null, ADOOrgan.ID); DatasetGatewayWorkFlow.TA_ManagerDataTable managetTable = new DatasetGatewayWorkFlow.TA_ManagerDataTable(); managerTA.FillByPersonID(managetTable, ADOPerson1.ID); ADOManager1.ID = Convert.ToInt32(managetTable.Rows[0]["MasterMng_ID"]); ADOManager1.Person = ADOPerson1; managerTA.FillByOrganID(managetTable, ADOOrgan.ID); ADOManager2.ID = Convert.ToInt32(managetTable.Rows[0]["MasterMng_ID"]); ADOManager2.OrganizationUnit = ADOOrgan; accessGroupTA.Insert("AccessGroup1_2"); accessGroupTA.Insert("AccessGroup1_3"); DatasetGatewayWorkFlow.TA_PrecardAccessGroupDataTable accessTable = accessGroupTA.GetDataBy1("AccessGroup1_2"); ADOAccessGroup1.ID = Convert.ToInt32(accessTable.Rows[0][0]); ADOAccessGroup1.Name = "AccessGroup1_2"; accessTable = accessGroupTA.GetDataBy1("AccessGroup1_3"); ADOAccessGroup2.ID = Convert.ToInt32(accessTable.Rows[0][0]); ADOAccessGroup2.Name = "AccessGroup1_3"; flowTA.Insert(ADOAccessGroup1.ID, false, false, "FlowTest"); DatasetGatewayWorkFlow.TA_FlowDataTable mangTAble = flowTA.GetDataByName("FlowTest"); ADOFlow1.ID = Convert.ToInt32(mangTAble.Rows[0][0]); ADOFlow1.FlowName = "FlowTest"; ADOFlow1.ActiveFlow = false; ADOFlow1.WorkFlow = false; mangFlowTA.Insert(ADOManager2.ID, 1, ADOFlow1.ID, true); mangFlowTA.Insert(ADOManager1.ID, 2, ADOFlow1.ID, true); undermanagmentTA.Insert(ADOFlow1.ID, ADOPerson3.ID, ADODepartment1.ID, false, true); undermanagmentTA.Insert(ADOFlow1.ID, ADOPerson5.ID, ADODepartment2.ID, false, false); dataAccessMngTA.Insert(BUser.CurrentUser.ID, ADOManager1.ID, false); dataAccessMngTA.Insert(BUser.CurrentUser.ID, ADOManager2.ID, false); }
public void TestSetup() { #region organization unit DatabaseGateway.TA_OrganizationUnitDataTable organTable = new DatabaseGateway.TA_OrganizationUnitDataTable(); organTable = organTA.GetDataByParent(); ADOOrganRoot.ID = Convert.ToInt32(organTable.Rows[0]["organ_ID"]); ADOOrganRoot.Name = Convert.ToString(organTable.Rows[0]["organ_Name"]); ADOOrganRoot.CustomCode = Convert.ToString(organTable.Rows[0]["organ_CustomCode"]); organTA.Insert("Level2_1", "2020_11", ADOPerson2.ID, ADOOrganRoot.ID, String.Format(",{0},", ADOOrganRoot.ID)); organTable = organTA.GetDataByCustomCode("2020_11"); ADOOrgan.ID = Convert.ToInt32(organTable.Rows[0]["organ_ID"]); ADOOrgan.Name = Convert.ToString(organTable.Rows[0]["organ_Name"]); ADOOrgan.CustomCode = Convert.ToString(organTable.Rows[0]["organ_CustomCode"]); #endregion #region managers managerTA.Insert(ADOPerson1.ID, null); DatasetGatewayWorkFlow.TA_ManagerDataTable masterTable = managerTA.GetDataByPersonID(ADOPerson1.ID); ADOManager1.ID = Convert.ToInt32(masterTable.Rows[0]["MasterMng_ID"]); ADOManager1.Person = ADOPerson1; ADOManager1.OrganizationUnit = null; managerTA.Insert(null, ADOOrgan.ID); masterTable = managerTA.GetDataByOrganID(ADOOrgan.ID); ADOManager2.ID = Convert.ToInt32(masterTable.Rows[0]["MasterMng_ID"]); ADOManager2.Person = null; ADOManager2.OrganizationUnit = ADOOrgan; managerTA.Insert(ADOPerson3.ID, null); masterTable = managerTA.GetDataByPersonID(ADOPerson3.ID); ADOManager3.ID = Convert.ToInt32(masterTable.Rows[0]["MasterMng_ID"]); ADOManager3.Person = ADOPerson3; ADOManager3.OrganizationUnit = null; #endregion #region pishcart access group precardAccessGroupTA.Insert("PrecardAccessGroupTest"); DatasetGatewayWorkFlow.TA_PrecardAccessGroupDataTable accessTable = precardAccessGroupTA.GetDataBy1("PrecardAccessGroupTest"); ADOaccessGroup.ID = Convert.ToInt32(accessTable.Rows[0]["accessGrp_ID"]); ADOaccessGroup.Name = Convert.ToString(accessTable.Rows[0]["accessGrp_Name"]); #endregion #region Flow flowTA.Insert(ADOaccessGroup.ID, false, false, "FlowTest1"); DatasetGatewayWorkFlow.TA_FlowDataTable flowTable = flowTA.GetDataByName("FlowTest1"); ADOFlow1.ID = Convert.ToInt32(flowTable.Rows[0]["flow_ID"]); ADOFlow1.AccessGroup = ADOaccessGroup; ADOFlow1.ActiveFlow = false; ADOFlow1.WorkFlow = false; ADOFlow1.FlowName = "FlowTest1"; flowTA.Insert(ADOaccessGroup.ID, false, false, "FlowTest2"); flowTable = flowTA.GetDataByName("FlowTest2"); ADOFlow2.ID = Convert.ToInt32(flowTable.Rows[0]["flow_ID"]); ADOFlow2.AccessGroup = ADOaccessGroup; ADOFlow2.ActiveFlow = false; ADOFlow2.WorkFlow = false; ADOFlow2.FlowName = "FlowTest2"; flowTA.Insert(ADOaccessGroup.ID, false, false, "FlowTest3"); flowTable = flowTA.GetDataByName("FlowTest3"); ADOFlow3.ID = Convert.ToInt32(flowTable.Rows[0]["flow_ID"]); ADOFlow3.AccessGroup = ADOaccessGroup; ADOFlow3.ActiveFlow = false; ADOFlow3.WorkFlow = false; ADOFlow3.FlowName = "FlowTest3"; #endregion #region manager Flow managerFlowTA.Insert(ADOManager1.ID, 1, ADOFlow1.ID, true); managerFlowTA.Insert(ADOManager1.ID, 2, ADOFlow2.ID, true); managerFlowTA.Insert(ADOManager3.ID, 2, ADOFlow3.ID, true); #endregion #region under managment undermanagmentTA.Insert(ADOFlow1.ID, ADOPerson2.ID, ADODepartment1.ID, false, true); undermanagmentTA.Insert(ADOFlow1.ID, ADOPerson5.ID, ADODepartment1.ID, false, true); DatasetGatewayWorkFlow.TA_UnderManagmentDataTable underManagmentTable = new DatasetGatewayWorkFlow.TA_UnderManagmentDataTable(); underManagmentTable = undermanagmentTA.GetDataByManagmentID(ADOFlow1.ID); ADOUnderManagment.ID = Convert.ToInt32(underManagmentTable.Rows[0]["underMng_ID"]); ADOUnderManagment.Contains = true; ADOUnderManagment.ContainInnerChilds = false; ADOUnderManagment.Person = ADOPerson2; ADOUnderManagment.Flow = ADOFlow1; undermanagmentTA.Insert(ADOFlow2.ID, ADOPerson4.ID, ADODepartment1.ID, false, true); undermanagmentTA.Insert(ADOFlow3.ID, ADOPerson5.ID, null, false, true); #endregion bussWorkTime = new BWorkedTime(ADOUser1.UserName); #region date range init businessDateRange = new BDateRange(); dateRange_testObject = new CalculationDateRange(); group_testObject = new CalculationRangeGroup(); dateRangList_testObject = new List <CalculationDateRange>(); groupTA.Insert("TestRangeGroup", "", 1); DatabaseGateway.TA_CalculationRangeGroupDataTable groupTable = new DatabaseGateway.TA_CalculationRangeGroupDataTable(); groupTA.FillByGroupName(groupTable, "TestRangeGroup"); ADOGroup.ID = Convert.ToDecimal(groupTable.Rows[0]["CalcRangeGroup_ID"]); ADOGroup.Name = Convert.ToString(groupTable.Rows[0]["CalcRangeGroup_Name"]); ADOGroup.Description = Convert.ToString(groupTable.Rows[0]["CalcRangeGroup_Des"]); assinTA.Insert(ADOPerson3.ID, ADOGroup.ID, Utility.ToMildiDate("1390/05/01")); assinTA.Insert(ADOPerson4.ID, ADOGroup.ID, Utility.ToMildiDate("1389/01/01")); DatabaseGateway.TA_ConceptTemplateDataTable concepts = new DatabaseGateway.TA_ConceptTemplateDataTable(); concepts = conceptTA.GetDataByyRanglyConceptsNotNullKeys(); ADOConcept1.ID = Convert.ToDecimal(concepts.Rows[0]["concepttmp_ID"]); ADOConcept2.ID = Convert.ToDecimal(concepts.Rows[1]["concepttmp_ID"]); ADOConcept3.ID = Convert.ToDecimal(concepts.Rows[2]["concepttmp_ID"]); dateRangeTA.Insert(ADOConcept1.ID, ADOGroup.ID, 15, 1, 14, 2, 1); dateRangeTA.Insert(ADOConcept1.ID, ADOGroup.ID, 15, 2, 14, 3, 2); dateRangeTA.Insert(ADOConcept1.ID, ADOGroup.ID, 15, 3, 14, 4, 3); dateRangeTA.Insert(ADOConcept1.ID, ADOGroup.ID, 15, 4, 14, 5, 4); dateRangeTA.Insert(ADOConcept1.ID, ADOGroup.ID, 15, 5, 14, 6, 5); dateRangeTA.Insert(ADOConcept1.ID, ADOGroup.ID, 15, 6, 14, 7, 6); dateRangeTA.Insert(ADOConcept1.ID, ADOGroup.ID, 15, 7, 14, 8, 7); dateRangeTA.Insert(ADOConcept1.ID, ADOGroup.ID, 15, 8, 14, 9, 8); dateRangeTA.Insert(ADOConcept1.ID, ADOGroup.ID, 15, 9, 14, 10, 9); dateRangeTA.Insert(ADOConcept1.ID, ADOGroup.ID, 15, 10, 14, 11, 10); dateRangeTA.Insert(ADOConcept1.ID, ADOGroup.ID, 15, 11, 14, 12, 11); dateRangeTA.Insert(ADOConcept1.ID, ADOGroup.ID, 15, 12, 14, 1, 12); DatabaseGateway.TA_CalculationDateRangeDataTable rangeTable = new DatabaseGateway.TA_CalculationDateRangeDataTable(); dateRangeTA.FillByGroup(rangeTable, ADOGroup.ID); ADODateRange1.ID = Convert.ToDecimal(rangeTable.Rows[0]["CalcDateRange_ID"]); ADODateRange2.ID = Convert.ToDecimal(rangeTable.Rows[1]["CalcDateRange_ID"]); dateRangList_testObject.Add(new CalculationDateRange() { FromDay = 1, FromMonth = 1, ToDay = 31, ToMonth = 1, Order = CalculationDateRangeOrder.Month1 }); dateRangList_testObject.Add(new CalculationDateRange() { FromDay = 1, FromMonth = 2, ToDay = 31, ToMonth = 2, Order = CalculationDateRangeOrder.Month2 }); dateRangList_testObject.Add(new CalculationDateRange() { FromDay = 1, FromMonth = 3, ToDay = 31, ToMonth = 3, Order = CalculationDateRangeOrder.Month3 }); dateRangList_testObject.Add(new CalculationDateRange() { FromDay = 1, FromMonth = 4, ToDay = 31, ToMonth = 4, Order = CalculationDateRangeOrder.Month4 }); dateRangList_testObject.Add(new CalculationDateRange() { FromDay = 1, FromMonth = 5, ToDay = 31, ToMonth = 5, Order = CalculationDateRangeOrder.Month5 }); dateRangList_testObject.Add(new CalculationDateRange() { FromDay = 1, FromMonth = 6, ToDay = 31, ToMonth = 6, Order = CalculationDateRangeOrder.Month6 }); dateRangList_testObject.Add(new CalculationDateRange() { FromDay = 1, FromMonth = 7, ToDay = 31, ToMonth = 7, Order = CalculationDateRangeOrder.Month7 }); dateRangList_testObject.Add(new CalculationDateRange() { FromDay = 1, FromMonth = 8, ToDay = 31, ToMonth = 8, Order = CalculationDateRangeOrder.Month8 }); dateRangList_testObject.Add(new CalculationDateRange() { FromDay = 1, FromMonth = 9, ToDay = 31, ToMonth = 9, Order = CalculationDateRangeOrder.Month9 }); dateRangList_testObject.Add(new CalculationDateRange() { FromDay = 1, FromMonth = 10, ToDay = 31, ToMonth = 10, Order = CalculationDateRangeOrder.Month10 }); dateRangList_testObject.Add(new CalculationDateRange() { FromDay = 1, FromMonth = 11, ToDay = 31, ToMonth = 11, Order = CalculationDateRangeOrder.Month11 }); dateRangList_testObject.Add(new CalculationDateRange() { FromDay = 1, FromMonth = 12, ToDay = 29, ToMonth = 12, Order = CalculationDateRangeOrder.Month12 }); #endregion }
public void TestSetup() { busflow = new BFlow(); flow_testObject = new Flow(); #region Flow Entry personTA.UpdateDepartmentId(ADODepartment1.ID, ADOPerson3.ID); personTA.UpdateDepartmentId(ADODepartment1.ID, ADOPerson4.ID); personTA.UpdateDepartmentId(ADODepartment2.ID, ADOPerson5.ID); personTA.UpdateDepartmentId(ADODepartment2.ID, ADOPerson6.ID); DatabaseGateway.TA_OrganizationUnitDataTable table = organTA.GetDataByParent(); ADOOrganParent.ID = Convert.ToInt32(table.Rows[0]["organ_ID"]); ADOOrganParent.CustomCode = Convert.ToString(table.Rows[0]["organ_CustomCode"]); organTA.Insert("TestLevel2_1", "0-1", ADOPerson2.ID, ADOOrganParent.ID, String.Format(",{0},", ADOOrganParent.ID)); table = organTA.GetDataByCustomCode("0-1"); ADOOrgan.ID = Convert.ToInt32(table.Rows[0]["organ_ID"]); ADOOrgan.ParentID = Convert.ToInt32(table.Rows[0]["organ_ParentID"]); ADOOrgan.Name = Convert.ToString(table.Rows[0]["organ_Name"]); ADOOrgan.CustomCode = Convert.ToString(table.Rows[0]["organ_CustomCode"]); ADOOrgan.PersonID = Convert.ToInt32(table.Rows[0]["organ_PersonID"]); organTA.Insert("TestLevel2_2", "0-2", ADOPerson1.ID, ADOOrganParent.ID, String.Format(",{0},", ADOOrganParent.ID)); table = organTA.GetDataByCustomCode("0-2"); ADOOrgan2.ID = Convert.ToInt32(table.Rows[0]["organ_ID"]); ADOOrgan2.ParentID = Convert.ToInt32(table.Rows[0]["organ_ParentID"]); ADOOrgan2.Name = Convert.ToString(table.Rows[0]["organ_Name"]); ADOOrgan2.CustomCode = Convert.ToString(table.Rows[0]["organ_CustomCode"]); ADOOrgan2.PersonID = Convert.ToInt32(table.Rows[0]["organ_PersonID"]); managerTA.Insert(ADOPerson1.ID, null); managerTA.Insert(null, ADOOrgan.ID);//ADOPerson2 DatasetGatewayWorkFlow.TA_ManagerDataTable managetTable = new DatasetGatewayWorkFlow.TA_ManagerDataTable(); managerTA.FillByPersonID(managetTable, ADOPerson1.ID); ADOManager1.ID = Convert.ToInt32(managetTable.Rows[0]["MasterMng_ID"]); ADOManager1.Person = ADOPerson1; managerTA.FillByOrganID(managetTable, ADOOrgan.ID); ADOManager2.ID = Convert.ToInt32(managetTable.Rows[0]["MasterMng_ID"]); ADOManager2.OrganizationUnit = ADOOrgan; #region precards DatasetGatewayWorkFlow.TA_PrecardGroupsDataTable precardTable = new DatasetGatewayWorkFlow.TA_PrecardGroupsDataTable(); precardGroupTA.FillByName(precardTable, PrecardGroupsName.leave.ToString()); ADOPrecardGroup1.ID = Convert.ToInt32(precardTable.Rows[0][0]); ADOPrecardGroup1.Name = "HourlyLeave"; precardGroupTA.FillByName(precardTable, PrecardGroupsName.duty.ToString()); ADOPrecardGroup2.ID = Convert.ToInt32(precardTable.Rows[0][0]); ADOPrecardGroup2.Name = "HourlyDuty"; precardGroupTA.FillByName(precardTable, PrecardGroupsName.leaveestelajy.ToString()); ADOPrecardGroup3.ID = Convert.ToInt32(precardTable.Rows[0][0]); ADOPrecardGroup3.Name = "Estelaji"; precardGroupTA.FillByName(precardTable, PrecardGroupsName.traffic.ToString()); ADOPrecardGroup4.ID = Convert.ToInt32(precardTable.Rows[0][0]); ADOPrecardGroup4.Name = "Traffic"; precardGroupTA.FillByName(precardTable, PrecardGroupsName.overwork.ToString()); ADOPrecardGroup5.ID = Convert.ToInt32(precardTable.Rows[0][0]); ADOPrecardGroup5.Name = "OwerWork"; precardTA.Insert("TestPrecard1", true, ADOPrecardGroup1.ID, true, false, true, "99999999", false); precardTA.Insert("TestPrecard4", true, ADOPrecardGroup1.ID, false, true, true, "99999999", false); precardTA.Insert("TestPrecard6", true, ADOPrecardGroup1.ID, false, true, true, "99999999", false); precardTA.Insert("TestPrecard7", true, ADOPrecardGroup2.ID, false, true, true, "99999999", false); precardTA.Insert("TestPrecard2", true, ADOPrecardGroup2.ID, true, false, true, "99999999", false); precardTA.Insert("TestPrecard3", true, ADOPrecardGroup3.ID, true, false, true, "99999999", false); precardTA.Insert("TestPrecard5", true, ADOPrecardGroup4.ID, true, false, true, "99999999", false); precardTA.Insert("TestPrecard8", true, ADOPrecardGroup5.ID, true, false, true, "99999999", false); DatasetGatewayWorkFlow.TA_PrecardDataTable pTable = new DatasetGatewayWorkFlow.TA_PrecardDataTable(); pTable = precardTA.GetDataByName("TestPrecard1"); ADOPrecardHourlyLeave1.ID = Convert.ToInt32(pTable.Rows[0][0]); ADOPrecardHourlyLeave1.Name = "TestPrecard1"; pTable = precardTA.GetDataByName("TestPrecard2"); ADOPrecardHourlyDuty1.ID = Convert.ToInt32(pTable.Rows[0][0]); ADOPrecardHourlyDuty1.Name = "TestPrecard2"; pTable = precardTA.GetDataByName("TestPrecard3"); ADOPrecardHourlyEstelji1.ID = Convert.ToInt32(pTable.Rows[0][0]); ADOPrecardHourlyEstelji1.Name = "TestPrecard3"; pTable = precardTA.GetDataByName("TestPrecard4"); ADOPrecardHourlyLeave2.ID = Convert.ToInt32(pTable.Rows[0][0]); ADOPrecardHourlyLeave2.Name = "TestPrecard4"; pTable = precardTA.GetDataByName("TestPrecard5"); ADOPrecardTraffic1.ID = Convert.ToInt32(pTable.Rows[0][0]); ADOPrecardTraffic1.Name = "TestPrecard6"; pTable = precardTA.GetDataByName("TestPrecard6"); ADOPrecardDailyLeave1.ID = Convert.ToInt32(pTable.Rows[0][0]); ADOPrecardDailyLeave1.Name = "TestPrecard7"; pTable = precardTA.GetDataByName("TestPrecard7"); ADOPrecardDailyDuty1.ID = Convert.ToInt32(pTable.Rows[0][0]); ADOPrecardDailyDuty1.Name = "TestPrecard7"; pTable = precardTA.GetDataByName("TestPrecard8"); ADOPrecardOverTime1.ID = Convert.ToInt32(pTable.Rows[0][0]); ADOPrecardOverTime1.Name = "TestPrecard8"; #endregion accessGroupTA.Insert("AccessGroup1_2"); accessGroupTA.Insert("AccessGroup1_3"); DatasetGatewayWorkFlow.TA_PrecardAccessGroupDataTable accessTable = accessGroupTA.GetDataBy1("AccessGroup1_2"); ADOAccessGroup1.ID = Convert.ToInt32(accessTable.Rows[0][0]); ADOAccessGroup1.Name = "AccessGroup1_2"; accessTable = accessGroupTA.GetDataBy1("AccessGroup1_3"); ADOAccessGroup2.ID = Convert.ToInt32(accessTable.Rows[0][0]); ADOAccessGroup2.Name = "AccessGroup1_3"; accessGroupDtlTA.Insert(ADOAccessGroup1.ID, ADOPrecardHourlyDuty1.ID); accessGroupDtlTA.Insert(ADOAccessGroup1.ID, ADOPrecardHourlyLeave1.ID); accessGroupDtlTA.Insert(ADOAccessGroup1.ID, ADOPrecardHourlyLeave2.ID); accessGroupDtlTA.Insert(ADOAccessGroup2.ID, ADOPrecardDailyLeave1.ID); accessGroupDtlTA.Insert(ADOAccessGroup2.ID, ADOPrecardDailyDuty1.ID); flowTA.Insert(ADOAccessGroup1.ID, false, false, "FlowTest1"); flowTA.Insert(ADOAccessGroup2.ID, false, false, "FlowTest2"); DatasetGatewayWorkFlow.TA_FlowDataTable mangTAble = flowTA.GetDataByName("FlowTest1"); ADOFlow1.ID = Convert.ToInt32(mangTAble.Rows[0][0]); ADOFlow1.FlowName = "FlowTest1"; ADOFlow1.ActiveFlow = false; ADOFlow1.WorkFlow = false; mangTAble = flowTA.GetDataByName("FlowTest2"); ADOFlow2.ID = Convert.ToInt32(mangTAble.Rows[0][0]); ADOFlow2.FlowName = "FlowTest2"; ADOFlow2.ActiveFlow = false; ADOFlow2.WorkFlow = false; mangFlowTA.Insert(ADOManager1.ID, 1, ADOFlow1.ID, true); //مدیر اولیه mangFlowTA.Insert(ADOManager2.ID, 2, ADOFlow1.ID, true); //مدیر ثانویه mangFlowTA.Insert(ADOManager1.ID, 1, ADOFlow2.ID, true); //مدیر اولیه DatasetGatewayWorkFlow.TA_ManagerFlowDataTable nbgFlowTable = mangFlowTA.GetDataByFlowID(ADOFlow1.ID); ADOManagerFlow1.ID = Convert.ToInt32(nbgFlowTable.Rows[0]["mngrFlow_ID"]); ADOManagerFlow1.Level = Convert.ToInt32(nbgFlowTable.Rows[0]["mngrFlow_LEVEL"]); ADOManagerFlow2.ID = Convert.ToInt32(nbgFlowTable.Rows[1]["mngrFlow_ID"]); ADOManagerFlow2.Level = Convert.ToInt32(nbgFlowTable.Rows[1]["mngrFlow_LEVEL"]); nbgFlowTable = mangFlowTA.GetDataByFlowID(ADOFlow2.ID); ADOManagerFlow3.ID = Convert.ToInt32(nbgFlowTable.Rows[0]["mngrFlow_ID"]); ADOManagerFlow3.Level = Convert.ToInt32(nbgFlowTable.Rows[0]["mngrFlow_LEVEL"]); undermanagmentTA.Insert(ADOFlow1.ID, ADOPerson3.ID, ADODepartment1.ID, false, true); undermanagmentTA.Insert(ADOFlow1.ID, ADOPerson4.ID, ADODepartment1.ID, false, false); undermanagmentTA.Insert(ADOFlow2.ID, null, ADODepartment2.ID, true, true);//ADOPerson4,ADOPerson5 #endregion #region Request Entry requestTA.Insert(ADOPrecardHourlyLeave1.ID, ADOPerson3.ID, new DateTime(2010, 5, 1), new DateTime(2010, 5, 1), 420, 600, "", DateTime.Now, ADOUser1.ID); requestTA.Insert(ADOPrecardHourlyLeave1.ID, ADOPerson3.ID, new DateTime(2010, 5, 2), new DateTime(2010, 5, 2), 900, 1020, "", DateTime.Now, ADOUser1.ID); requestTA.Insert(ADOPrecardHourlyDuty1.ID, ADOPerson3.ID, new DateTime(2010, 5, 2), new DateTime(2010, 5, 2), 700, 800, "", DateTime.Now, ADOUser1.ID); requestTA.Insert(ADOPrecardTraffic1.ID, ADOPerson4.ID, new DateTime(2010, 5, 3), new DateTime(2010, 5, 3), 900, 1020, "", DateTime.Now, ADOUser1.ID); requestTA.Insert(ADOPrecardHourlyDuty1.ID, ADOPerson3.ID, new DateTime(2010, 5, 10), new DateTime(2010, 5, 10), 700, 800, "", DateTime.Now, ADOUser1.ID); requestTA.Insert(ADOPrecardHourlyDuty1.ID, ADOPerson3.ID, new DateTime(2010, 5, 10), new DateTime(2010, 5, 10), 1000, 1100, "", DateTime.Now, ADOUser1.ID); requestTA.Insert(ADOPrecardDailyLeave1.ID, ADOPerson5.ID, new DateTime(2010, 5, 4), new DateTime(2010, 5, 5), 0, 0, "", DateTime.Now, ADOUser1.ID); requestTA.Insert(ADOPrecardDailyDuty1.ID, ADOPerson6.ID, new DateTime(2010, 5, 6), new DateTime(2010, 5, 7), 0, 0, "", DateTime.Now, ADOUser1.ID); DatasetGatewayWorkFlow.TA_RequestDataTable requestTable = new DatasetGatewayWorkFlow.TA_RequestDataTable(); requestTable = requestTA.GetDataByPersonId(ADOPerson3.ID); ADORequestHourlyLeave1.ID = Convert.ToInt32(requestTable.Rows[0][0]); ADORequestHourlyLeave2.ID = Convert.ToInt32(requestTable.Rows[1][0]); ADORequestHourlyDuty1.ID = Convert.ToInt32(requestTable.Rows[2][0]); ADORequestHourlyDuty2.ID = Convert.ToInt32(requestTable.Rows[3][0]); ADORequestHourlyDuty2.FromDate = Convert.ToDateTime(requestTable.Rows[3]["request_fromdate"]); ADORequestHourlyDuty3.ID = Convert.ToInt32(requestTable.Rows[4][0]); requestTable = requestTA.GetDataByPersonId(ADOPerson4.ID); ADORequestTraffic1.ID = Convert.ToInt32(requestTable.Rows[0][0]); requestTable = requestTA.GetDataByPersonId(ADOPerson5.ID); ADORequestDailyLeave1.ID = Convert.ToInt32(requestTable.Rows[0][0]); ADORequestDailyLeave1.FromDate = Convert.ToDateTime(requestTable.Rows[0]["request_fromdate"]); requestTable = requestTA.GetDataByPersonId(ADOPerson6.ID); ADORequestDailyDuty1.ID = Convert.ToInt32(requestTable.Rows[0][0]); #region Request Status requestStatusTA.Insert(ADOManagerFlow1.ID, ADORequestHourlyDuty1.ID, false, true, "", DateTime.Now, false); requestStatusTA.Insert(ADOManagerFlow1.ID, ADORequestHourlyLeave2.ID, true, false, "", DateTime.Now, false); requestStatusTA.Insert(ADOManagerFlow2.ID, ADORequestHourlyLeave2.ID, true, true, "", DateTime.Now, false); requestStatusTA.Insert(ADOManagerFlow1.ID, ADORequestHourlyLeave1.ID, true, false, "", DateTime.Now, false); requestStatusTA.Insert(ADOManagerFlow2.ID, ADORequestHourlyLeave1.ID, false, true, "", DateTime.Now, false); requestStatusTA.Insert(ADOManagerFlow3.ID, ADORequestDailyDuty1.ID, true, true, "", DateTime.Now, false); requestStatusTA.Insert(ADOManagerFlow1.ID, ADORequestHourlyDuty2.ID, true, false, "", DateTime.Now, false); requestStatusTA.Insert(ADOManagerFlow1.ID, ADORequestHourlyDuty3.ID, true, false, "", DateTime.Now, false); //requestStatusTA.Insert(ADOManagerFlow1.ID, ADORequestTraffic1.ID, true, false, "", DateTime.Now, false); #endregion #endregion }
public void TestSetup() { busflow = new BFlow(); flow_testObject = new Flow(); DatabaseGateway.TA_OrganizationUnitDataTable table = organTA.GetDataByParent(); ADOOrganParent.ID = Convert.ToInt32(table.Rows[0]["organ_ID"]); ADOOrganParent.CustomCode = Convert.ToString(table.Rows[0]["organ_CustomCode"]); organTA.Insert("TestLevel2_1", "0-1", ADOPerson2.ID, ADOOrganParent.ID, String.Format(",{0},", ADOOrganParent.ID)); table = organTA.GetDataByCustomCode("0-1"); ADOOrgan.ID = Convert.ToInt32(table.Rows[0]["organ_ID"]); ADOOrgan.ParentID = Convert.ToInt32(table.Rows[0]["organ_ParentID"]); ADOOrgan.Name = Convert.ToString(table.Rows[0]["organ_Name"]); ADOOrgan.CustomCode = Convert.ToString(table.Rows[0]["organ_CustomCode"]); ADOOrgan.PersonID = Convert.ToInt32(table.Rows[0]["organ_PersonID"]); organTA.Insert("TestLevel2_2", "0-2", ADOPerson1.ID, ADOOrganParent.ID, String.Format(",{0},", ADOOrganParent.ID)); table = organTA.GetDataByCustomCode("0-2"); ADOOrgan2.ID = Convert.ToInt32(table.Rows[0]["organ_ID"]); ADOOrgan2.ParentID = Convert.ToInt32(table.Rows[0]["organ_ParentID"]); ADOOrgan2.Name = Convert.ToString(table.Rows[0]["organ_Name"]); ADOOrgan2.CustomCode = Convert.ToString(table.Rows[0]["organ_CustomCode"]); ADOOrgan2.PersonID = Convert.ToInt32(table.Rows[0]["organ_PersonID"]); managerTA.Insert(ADOPerson1.ID, null); managerTA.Insert(null, ADOOrgan.ID); DatasetGatewayWorkFlow.TA_ManagerDataTable managetTable = new DatasetGatewayWorkFlow.TA_ManagerDataTable(); managerTA.FillByPersonID(managetTable, ADOPerson1.ID); ADOManager1.ID = Convert.ToInt32(managetTable.Rows[0]["MasterMng_ID"]); ADOManager1.Person = ADOPerson1; managerTA.FillByOrganID(managetTable, ADOOrgan.ID); ADOManager2.ID = Convert.ToInt32(managetTable.Rows[0]["MasterMng_ID"]); ADOManager2.OrganizationUnit = ADOOrgan; accessGroupTA.Insert("AccessGroup1_2"); accessGroupTA.Insert("AccessGroup1_3"); DatasetGatewayWorkFlow.TA_PrecardAccessGroupDataTable accessTable = accessGroupTA.GetDataBy1("AccessGroup1_2"); ADOAccessGroup1.ID = Convert.ToInt32(accessTable.Rows[0][0]); ADOAccessGroup1.Name = "AccessGroup1_2"; accessTable = accessGroupTA.GetDataBy1("AccessGroup1_3"); ADOAccessGroup2.ID = Convert.ToInt32(accessTable.Rows[0][0]); ADOAccessGroup2.Name = "AccessGroup1_3"; flowTA.Insert(ADOAccessGroup1.ID, false, false, "FlowTest"); DatasetGatewayWorkFlow.TA_FlowDataTable mangTAble = flowTA.GetDataByName("FlowTest"); ADOFlow1.ID = Convert.ToInt32(mangTAble.Rows[0][0]); ADOFlow1.FlowName = "FlowTest"; ADOFlow1.ActiveFlow = false; ADOFlow1.WorkFlow = false; mangFlowTA.Insert(ADOManager2.ID, 1, ADOFlow1.ID, true); mangFlowTA.Insert(ADOManager1.ID, 2, ADOFlow1.ID, true); DatasetGatewayWorkFlow.TA_ManagerFlowDataTable nbgFlowTable = mangFlowTA.GetDataByFlowID(ADOFlow1.ID); ADOManagerFlow1.ID = Convert.ToInt32(nbgFlowTable.Rows[0]["mngrFlow_ID"]); ADOManagerFlow1.Level = Convert.ToInt32(nbgFlowTable.Rows[0]["mngrFlow_LEVEL"]); ADOManagerFlow2.ID = Convert.ToInt32(nbgFlowTable.Rows[1]["mngrFlow_ID"]); ADOManagerFlow2.Level = Convert.ToInt32(nbgFlowTable.Rows[1]["mngrFlow_LEVEL"]); undermanagmentTA.Insert(ADOFlow1.ID, ADOPerson3.ID, ADODepartment1.ID, false, true); undermanagmentTA.Insert(ADOFlow1.ID, ADOPerson5.ID, ADODepartment2.ID, false, false); }
public void TestSetup() { searchTool = new BPerson(); bPerson = new BPerson(); person_testObject = new Person(); #region Workgroup workgrpTA.Insert("WorkGroupTest1", "0-0", 0); workgrpTA.Insert("WorkGroupTest2", "0-1", 0); DatabaseGateway.TA_WorkGroupDataTable table = new DatabaseGateway.TA_WorkGroupDataTable(); workgrpTA.FillByName(table, "WorkGroupTest1"); ADOWorkGroup1.ID = Convert.ToInt32(table.Rows[0]["workgroup_ID"]); ADOWorkGroup1.Name = Convert.ToString(table.Rows[0]["workgroup_Name"]); ADOWorkGroup1.CustomCode = Convert.ToString(table.Rows[0]["workgroup_CustomCode"]); workgrpTA.FillByName(table, "WorkGroupTest2"); ADOWorkGroup2.ID = Convert.ToInt32(table.Rows[0]["workgroup_ID"]); ADOWorkGroup2.Name = Convert.ToString(table.Rows[0]["workgroup_Name"]); ADOWorkGroup2.CustomCode = Convert.ToString(table.Rows[0]["workgroup_CustomCode"]); assignWorkGroupTA.Insert(ADOWorkGroup1.ID, ADOPerson1.ID, new DateTime(2007, 4, 5)); assignWorkGroupTA.Insert(ADOWorkGroup1.ID, ADOPerson2.ID, new DateTime(2007, 4, 5)); assignWorkGroupTA.Insert(ADOWorkGroup1.ID, ADOPerson2.ID, new DateTime(2012, 5, 5)); assignWorkGroupTA.Insert(ADOWorkGroup2.ID, ADOPerson2.ID, new DateTime(2010, 11, 6)); assignWorkGroupTA.Insert(ADOWorkGroup1.ID, ADOPerson2.ID, new DateTime(2009, 6, 15)); assignWorkGroupTA.Insert(ADOWorkGroup1.ID, ADOPerson2.ID, new DateTime(2010, 8, 5)); #endregion #region Calculation DateRange groupTA.Insert("RangeGroup1", "", 1); groupTA.Insert("RangeGroup2", "", 1); DatabaseGateway.TA_CalculationRangeGroupDataTable groupTable = new DatabaseGateway.TA_CalculationRangeGroupDataTable(); groupTA.FillByGroupName(groupTable, "RangeGroup1"); ADOGroup1.ID = Convert.ToDecimal(groupTable.Rows[0]["CalcRangeGroup_ID"]); ADOGroup1.Name = Convert.ToString(groupTable.Rows[0]["CalcRangeGroup_Name"]); ADOGroup1.Description = Convert.ToString(groupTable.Rows[0]["CalcRangeGroup_Des"]); groupTA.FillByGroupName(groupTable, "RangeGroup2"); ADOGroup2.ID = Convert.ToDecimal(groupTable.Rows[0]["CalcRangeGroup_ID"]); ADOGroup2.Name = Convert.ToString(groupTable.Rows[0]["CalcRangeGroup_Name"]); ADOGroup2.Description = Convert.ToString(groupTable.Rows[0]["CalcRangeGroup_Des"]); assinTA.Insert(ADOPerson1.ID, ADOGroup1.ID, new DateTime(2010, 2, 14)); assinTA.Insert(ADOPerson2.ID, ADOGroup1.ID, new DateTime(2010, 2, 14)); assinTA.Insert(ADOPerson2.ID, ADOGroup1.ID, new DateTime(2005, 5, 14)); assinTA.Insert(ADOPerson2.ID, ADOGroup1.ID, new DateTime(2007, 11, 5)); assinTA.Insert(ADOPerson2.ID, ADOGroup2.ID, new DateTime(2010, 9, 14)); assinTA.Insert(ADOPerson2.ID, ADOGroup1.ID, new DateTime(2012, 9, 14)); assinTA.Insert(ADOPerson2.ID, ADOGroup1.ID, new DateTime(2008, 3, 1)); #endregion #region RuleGroup ruleCatTA.Insert("RuleGroupTest1", "0000", false, "00-00test1"); ruleCatTA.Insert("RuleGroupTest2", "0000", false, "00-00test1"); DatabaseGateway.TA_RuleCategoryDataTable ruleTable = ruleCatTA.GetDataByName("RuleGroupTest1"); ADORuleCat1.ID = (Decimal)ruleTable[0]["RuleCat_ID"]; ADORuleCat1.Name = (String)ruleTable[0]["RuleCat_Name"]; ruleTable = ruleCatTA.GetDataByName("RuleGroupTest2"); ADORuleCat2.ID = (Decimal)ruleTable[0]["RuleCat_ID"]; ADORuleCat2.Name = (String)ruleTable[0]["RuleCat_Name"]; prsRleCatAsgTA.Insert(ADOPerson1.ID, ADORuleCat1.ID, "2005/05/15", "2007/05/08", null); prsRleCatAsgTA.Insert(ADOPerson2.ID, ADORuleCat1.ID, "2005/05/15", "2007/05/08", null); prsRleCatAsgTA.Insert(ADOPerson2.ID, ADORuleCat1.ID, "2008/01/01", "2010/01/01", null); prsRleCatAsgTA.Insert(ADOPerson2.ID, ADORuleCat1.ID, "2010/01/01", "2010/12/01", null); prsRleCatAsgTA.Insert(ADOPerson2.ID, ADORuleCat1.ID, "2010/12/01", "2011/03/01", null); prsRleCatAsgTA.Insert(ADOPerson2.ID, ADORuleCat2.ID, "2011/03/02", "2015/03/01", null); #endregion #region OrganizationUnit DatabaseGateway.TA_OrganizationUnitDataTable organtable = organTA.GetDataByParent(); ADOOrganParent.ID = Convert.ToInt32(organtable.Rows[0]["organ_ID"]); ADOOrganParent.CustomCode = Convert.ToString(organtable.Rows[0]["organ_CustomCode"]); organTA.Insert("TestLevel2_1", "0-1", ADOPerson2.ID, ADOOrganParent.ID, String.Format(",{0},", ADOOrganParent.ID)); organtable = organTA.GetDataByCustomCode("0-1"); ADOOrgan.ID = Convert.ToInt32(organtable.Rows[0]["organ_ID"]); ADOOrgan.ParentID = Convert.ToInt32(organtable.Rows[0]["organ_ParentID"]); ADOOrgan.Name = Convert.ToString(organtable.Rows[0]["organ_Name"]); ADOOrgan.CustomCode = Convert.ToString(organtable.Rows[0]["organ_CustomCode"]); ADOOrgan.PersonID = Convert.ToInt32(organtable.Rows[0]["organ_PersonID"]); #endregion #region Manager managerTA.Insert(ADOPerson1.ID, null); managerTA.Insert(null, ADOOrgan.ID); DatasetGatewayWorkFlow.TA_ManagerDataTable managetTable = new DatasetGatewayWorkFlow.TA_ManagerDataTable(); managerTA.FillByPersonID(managetTable, ADOPerson1.ID); ADOManager1.ID = Convert.ToInt32(managetTable.Rows[0]["MasterMng_ID"]); ADOManager1.Person = ADOPerson1; managerTA.FillByOrganID(managetTable, ADOOrgan.ID); ADOManager2.ID = Convert.ToInt32(managetTable.Rows[0]["MasterMng_ID"]); ADOManager2.OrganizationUnit = ADOOrgan; #endregion }