protected void Button11_Click(object sender, EventArgs e) { BWorkedTime bus = new BWorkedTime(); bus.GetUnderManagmentByDepartment(2, 57, 0, 30, GridOrderFields.NONE, GridOrderFieldType.asc); bus.GetUnderManagmentBySearch(2, "3551329", GridSearchFields.PersonCode, 0, 30, GridOrderFields.NONE, GridOrderFieldType.asc); bus.GetUnderManagmentBySearchCount(2, "3551329", GridSearchFields.PersonCode); }
public void GetDepartmentTree_PersonNotManagerTest() { try { bussWorkTime = new BWorkedTime(ADOUser4.UserName); Department dep = bussWorkTime.GetManagerDepartmentTree(); Assert.Fail("فقط مدیران میتوانند به این سرویس دسترسی داشته باشند"); } catch (IllegalServiceAccess ex) { Assert.Pass(ex.Message); } }
public void GetDepartmentTree_DepartmentNullTest() { try { bussWorkTime = new BWorkedTime(ADOUser3.UserName); Department dep = bussWorkTime.GetManagerDepartmentTree(); Assert.Fail("بخش برای افراد تحت مدیریت نباید تهی باشد"); } catch (InvalidDatabaseStateException ex) { Assert.AreEqual(ex.FatalExceptionIdentifier, UIFatalExceptionIdentifiers.UnderManagmentDepartmentNull); } }
public void GetUnderManagmentBySearch_BarcodeTest22222() { try { base.UpdateCurrentUserPersonId(32678); bussWorkTime = new BWorkedTime(); Department dep = bussWorkTime.GetManagerDepartmentTree(); IList <UnderManagementPerson> list1 = bussWorkTime.GetUnderManagmentByDepartment(9, dep.ID, 0, 20, GridOrderFields.gridFields_BarCode, GridOrderFieldType.asc); } catch (Exception ex) { string s = ex.Message; } }
protected void Button48_Click(object sender, EventArgs e) { BWorkedTime bus = new BWorkedTime(); bus.GetManagerDepartmentTree(); }
protected void Button35_Click(object sender, EventArgs e) { BWorkedTime bus = new BWorkedTime(); bus.GetUnderManagmentBySearchCount(10, "رضایی", GridSearchFields.NONE); }
protected void Button25_Click(object sender, EventArgs e) { BWorkedTime s = new BWorkedTime(); s.GetUnderManagmentBySearch(8, "کریمی", GridSearchFields.NONE, 0, 10, GridOrderFields.NONE, GridOrderFieldType.asc); }
protected void Button15_Click(object sender, EventArgs e) { BWorkedTime bus = new BWorkedTime(); IList <UnderManagementPerson> list = bus.GetUnderManagmentBySearch(0, "2197", GridSearchFields.NONE, 0, 10, GridOrderFields.NONE, GridOrderFieldType.asc); }
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() { #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 }