public void TestSetup() { return; busPerson = new BPerson(SysLanguageResource.English, LocalLanguageResource.English); searchTool = new BPerson(); person_testObject = new Person(); 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, 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)); 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(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)); 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(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/02", "2010/12/01", null); prsRleCatAsgTA.Insert(ADOPerson2.ID, ADORuleCat1.ID, "2010/12/02", "2011/03/01", null); prsRleCatAsgTA.Insert(ADOPerson2.ID, ADORuleCat2.ID, "2011/03/02", "2015/03/01", null); validationGroupTA.InsertQuery("TestGroup00"); DatabaseGateway.TA_UIValidationGroupDataTable uiValGroupTable = validationGroupTA.GetDataByName("TestGroup00"); ADOUIValidationGroup1.ID = (uiValGroupTable.Rows[0] as DatabaseGateway.TA_UIValidationGroupRow).UIValGrp_ID; }
/// <summary> /// Constructor injection /// </summary> /// <param name="searchPerson"></param> public PersonPresenter(ISearchPerson searchPerson) { searchPerson.Search += new VoidHandler(_Search); _View = searchPerson; }
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 }