public void TreatDown() { wgTA.DeleteByCustomCode("55-55"); shiftTA.DeleteByCustomCode("55-54"); shiftTA.DeleteByCustomCode("55-55"); flowTA.DeleteByName("FlowTest"); managerTA.DeleteByBarcode("00001"); accessGroupTA.DeleteByName("AccessGroup1_2"); doctorTA.DeleteByLastName("TestDoctorLastName1"); illnessTA.DeleteByName("TestIllness1"); requestTA.DeleteByPerson(ADOPerson1.ID); requestTA.DeleteByPerson(ADOPerson2.ID); precardTA.DeleteByID("99999999"); dutyPlcTA.DeleteByName("TestDutyPlc1"); dutyPlcTA.DeleteByName("TestDutyPlc2"); BPerson bperson = new BPerson(SysLanguageResource.Parsi, LocalLanguageResource.Parsi); BWorkgroup bworkGroup = new BWorkgroup(); BShift bshift = new BShift(); ClearSession(); assingWorkGrouTA.DeleteByPerson(ADOPerson1.ID); //bshift.SaveChanges(ADOShift1, UIActionType.DELETE); //bshift.SaveChanges(ADOShift2, UIActionType.DELETE); }
public void TestSetup() { wgd_testObject = new WorkGroupDetail(); busCalendar = new BWorkGroupCalendar(SysLanguageResource.Parsi); #region insert workgroup,shift,person BPerson bperson = new BPerson(SysLanguageResource.Parsi, LocalLanguageResource.Parsi); ADOPerson = new Person() { ID = bperson.CreateWorkingPerson2() }; BWorkgroup bworkGroup = new BWorkgroup(); ADOWorkGroup.CustomCode = "55-55"; ADOWorkGroup.Name = "ClanderWorkGroupTest"; bworkGroup.SaveChanges(ADOWorkGroup, UIActionType.ADD); BShift bshift = new BShift(); ADOShift1.Name = "ClanderShiftTest1"; ADOShift1.Person = ADOPerson; ADOShift1.Color = "0xff6512"; ADOShift1.ShiftType = ShiftTypesEnum.WORK; bshift.SaveChanges(ADOShift1, UIActionType.ADD); ADOShift2.Name = "ClanderShiftTest2"; ADOShift2.Color = "0xbbccaa"; ADOShift2.Person = ADOPerson; ADOShift2.ShiftType = ShiftTypesEnum.WORK; bshift.SaveChanges(ADOShift2, UIActionType.ADD); #endregion #region date inti date1 = Utility.ToMildiDate("1390/5/1"); date2 = Utility.ToMildiDate("1390/5/2"); date3 = Utility.ToMildiDate("1390/5/3"); date4 = Utility.ToMildiDate("1390/5/5"); date5 = Utility.ToMildiDate("1390/5/6"); date6 = Utility.ToMildiDate("1390/5/7"); date7 = Utility.ToMildiDate("1390/5/9"); date8 = Utility.ToMildiDate("1390/5/10"); date9 = Utility.ToMildiDate("1390/5/11"); date10 = Utility.ToMildiDate("1389/1/1"); date11 = Utility.ToMildiDate("1391/1/1"); #endregion wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date1); wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date2); wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date3); wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date4); wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date5); wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, date6); wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, date7); wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, date8); wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, date9); wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, date10); wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, date11); ClearSession(); }
public void TreatDown() { BPerson bperson = new BPerson(SysLanguageResource.Parsi, LocalLanguageResource.Parsi); BWorkgroup bworkGroup = new BWorkgroup(); BShift bshift = new BShift(); ClearSession(); bworkGroup.SaveChanges(ADOWorkGroup, UIActionType.DELETE); bshift.SaveChanges(ADOShift1, UIActionType.DELETE); bshift.SaveChanges(ADOShift2, UIActionType.DELETE); bperson.SaveChanges(ADOPerson, UIActionType.DELETE); }
private void CreateShiftsObject() { BShift bshift = new BShift(); IList <MonthlyExceptionShift> MonthlyExceptionShiftList = new List <MonthlyExceptionShift>(); IList <Shift> ShiftList = bshift.GetAll(); foreach (Shift shift in ShiftList) { MonthlyExceptionShift monthlyExceptionShift = new MonthlyExceptionShift(); monthlyExceptionShift.Id = shift.ID; monthlyExceptionShift.Name = shift.Name; monthlyExceptionShift.ShortcutsKey = shift.ShortcutsKey; monthlyExceptionShift.CustomCode = shift.CustomCode; MonthlyExceptionShiftList.Add(monthlyExceptionShift); } this.hfShiftsObject_MonthlyExceptionShifts.Value = JsSerializer.Serialize(MonthlyExceptionShiftList); }
public void TestSetup() { shift_testObject = new Shift(); shiftpair_testObject = new ShiftPair(); businessShift = new BShift(); nobatTA.Insert("NobatKari", "", "0-00"); DatabaseGateway.TA_NobatKariDataTable table = new DatabaseGateway.TA_NobatKariDataTable(); nobatTA.FillByCustomCode(table, "0-00"); ADONobatKari.ID = Convert.ToInt32(table.Rows[0]["nobat_ID"]); ADONobatKari.Name = Convert.ToString(table.Rows[0]["nobat_Name"]); ADONobatKari.CustomCode = Convert.ToString(table.Rows[0]["nobat_CustomCode"]); ADONobatKari.Description = Convert.ToString(table.Rows[0]["nobat_Description"]); shiftTA.Insert("ShiftTest", 1, 11, ADONobatKari.ID, 100, false, false, false, "2", "0-00"); ADOShift = new Shift(); DatabaseGateway.TA_ShiftDataTable shiftTable = new DatabaseGateway.TA_ShiftDataTable(); shiftTA.FillByName(shiftTable, "ShiftTest"); ADOShift.ID = Convert.ToInt32(shiftTable.Rows[0]["shift_ID"]); ADOShift.Name = Convert.ToString(shiftTable.Rows[0]["shift_Name"]); ADOShift.Color = Convert.ToString(shiftTable.Rows[0]["shift_Color"]); ADOShift.NobatKariID = Convert.ToInt32(shiftTable.Rows[0]["shift_Nobatkari"]); ADOShift.CustomCode = Convert.ToString(shiftTable.Rows[0]["shift_CustomCode"]); shiftPairTA.Insert(ADOShift.ID, 100, 200, 0, 0); shiftPairTA.Insert(ADOShift.ID, 300, 500, 0, 0); DatabaseGateway.TA_ShiftPairDataTable shiftpairTable = new DatabaseGateway.TA_ShiftPairDataTable(); shiftPairTA.FillByShiftId(shiftpairTable, ADOShift.ID); ShiftPair pair = new ShiftPair(); pair.ID = Convert.ToInt32(shiftpairTable.Rows[0]["shiftpair_ID"]); pair.From = Convert.ToInt32(shiftpairTable.Rows[0]["shiftpair_From"]); pair.To = Convert.ToInt32(shiftpairTable.Rows[0]["shiftpair_To"]); ADOShift.Pairs.Add(pair); pair = new ShiftPair(); pair.ID = Convert.ToInt32(shiftpairTable.Rows[1]["shiftpair_ID"]); pair.From = Convert.ToInt32(shiftpairTable.Rows[1]["shiftpair_From"]); pair.To = Convert.ToInt32(shiftpairTable.Rows[1]["shiftpair_To"]); ADOShift.Pairs.Add(pair); }
protected void CallBack_ShiftsView_MonthlyExceptionShifts_onCallBack(object sender, CallBackEventArgs e) { string[] retMessage = new string[4]; try { BShift bshift = new BShift(); IList <Shift> shiftList = null; ShiftLoadState State = (ShiftLoadState)Enum.Parse(typeof(ShiftLoadState), this.StringBuilder.CreateString(e.Parameters[0])); switch (State) { case ShiftLoadState.Normal: shiftList = bshift.GetAll(); break; case ShiftLoadState.Search: string searchValue = this.StringBuilder.CreateString(e.Parameters[1]); shiftList = bshift.GetShiftsAccordingToSearch(searchValue); break; } this.GridShiftsView_MonthlyExceptionShifts.DataSource = shiftList; this.GridShiftsView_MonthlyExceptionShifts.DataBind(); } catch (UIValidationExceptions ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage); this.ErrorHiddenField_ShiftsView_MonthlyExceptionShifts.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (UIBaseException ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage); this.ErrorHiddenField_ShiftsView_MonthlyExceptionShifts.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } catch (Exception ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage); this.ErrorHiddenField_ShiftsView_MonthlyExceptionShifts.Value = this.exceptionHandler.CreateErrorMessage(retMessage); } this.ErrorHiddenField_ShiftsView_MonthlyExceptionShifts.RenderControl(e.Output); this.GridShiftsView_MonthlyExceptionShifts.RenderControl(e.Output); }
/// <summary> /// Connect all the Inputs to the Funtions /// </summary> private void CharacterConnect() { //TODO: LOOK INTO THIS BoolEvent BAttack1, BAttack2, BAction, BJump, BShift, BFly, BDown, BUp, BDodge, BDeath, BStun, BDamaged, BSpeed1, BSpeed2, BSpeed3, BSpeedUp, BSpeedDown; if (Inputs.TryGetValue("Attack1", out BAttack1)) { BAttack1.AddListener(value => Attack1 = value); } if (Inputs.TryGetValue("Attack2", out BAttack2)) { BAttack2.AddListener(value => Attack2 = value); } if (Inputs.TryGetValue("Action", out BAction)) { BAction.AddListener(value => Action = value); } if (Inputs.TryGetValue("Jump", out BJump)) { BJump.AddListener(value => Jump = value); } if (Inputs.TryGetValue("Shift", out BShift)) { BShift.AddListener(value => Shift = value); } if (Inputs.TryGetValue("Fly", out BFly)) { BFly.AddListener(value => Fly = value); } if (Inputs.TryGetValue("Down", out BDown)) { BDown.AddListener(value => Down = value); } if (Inputs.TryGetValue("Up", out BUp)) { BUp.AddListener(value => Up = value); } if (Inputs.TryGetValue("Dodge", out BDodge)) { BDodge.AddListener(value => Dodge = value); } if (Inputs.TryGetValue("Death", out BDeath)) { BDeath.AddListener(value => Death = value); } if (Inputs.TryGetValue("Stun", out BStun)) { BStun.AddListener(value => Stun = value); } if (Inputs.TryGetValue("Damaged", out BDamaged)) { BDamaged.AddListener(value => Damaged = value); } if (Inputs.TryGetValue("Speed1", out BSpeed1)) { BSpeed1.AddListener(value => Speed1 = value); } if (Inputs.TryGetValue("Speed2", out BSpeed2)) { BSpeed2.AddListener(value => Speed2 = value); } if (Inputs.TryGetValue("Speed3", out BSpeed3)) { BSpeed3.AddListener(value => Speed3 = value); } if (Inputs.TryGetValue("SpeedUp", out BSpeedUp)) { BSpeedUp.AddListener(value => SpeedUp = value); } if (Inputs.TryGetValue("SpeedDown", out BSpeedDown)) { BSpeedDown.AddListener(value => SpeedDown = value); } }
public void TestSetup() { #region precards DatasetGatewayWorkFlow.TA_PrecardGroupsDataTable precardTable = new DatasetGatewayWorkFlow.TA_PrecardGroupsDataTable(); precardGroupTA.FillByName(precardTable, PrecardGroupsName.overwork.ToString()); ADOPrecardGroup1.ID = Convert.ToInt32(precardTable.Rows[0][0]); ADOPrecardGroup1.Name = "OwerWork"; precardTA.Insert("TestPrecard1", true, ADOPrecardGroup1.ID, true, false, true, "99999999", false); DatasetGatewayWorkFlow.TA_PrecardDataTable pTable = new DatasetGatewayWorkFlow.TA_PrecardDataTable(); pTable = precardTA.GetDataByName("TestPrecard1"); ADOPrecardOverTime1.ID = Convert.ToInt32(pTable.Rows[0][0]); ADOPrecardOverTime1.Name = "TestPrecard1"; pTable = precardTA.GetDataByCode(126.ToString()); ADOPrecardDasturyOverTime.ID = Convert.ToInt32(pTable.Rows[0][0]); #endregion requestTA.Insert(ADOPrecardOverTime1.ID, ADOPerson1.ID, new DateTime(2010, 5, 1), new DateTime(2010, 5, 1), 420, 600, "", DateTime.Now, ADOUser1.ID); DatasetGatewayWorkFlow.TA_RequestDataTable requestTable = new DatasetGatewayWorkFlow.TA_RequestDataTable(); requestTable = requestTA.GetDataByPersonId(ADOPerson1.ID); ADORequestOvertime1.ID = Convert.ToInt32(requestTable.Rows[0][0]); #region Manager Flow managerTA.Insert(ADOPerson1.ID, null); 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; accessGroupTA.Insert("AccessGroup1_2"); DatasetGatewayWorkFlow.TA_PrecardAccessGroupDataTable accessTable = accessGroupTA.GetDataBy1("AccessGroup1_2"); ADOAccessGroup1.ID = Convert.ToInt32(accessTable.Rows[0][0]); ADOAccessGroup1.Name = "AccessGroup1_2"; 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(ADOManager1.ID, 1, 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"]); #endregion requestStatusTA.Insert(ADOManagerFlow1.ID, ADORequestOvertime1.ID, true, false, "", DateTime.Now, false); request_testObject = new Request(); busOverTime = new BRequest(ADOPerson1.ID); #region insert workgroup,shift BWorkgroup bworkGroup = new BWorkgroup(); ADOWorkGroup.CustomCode = "55-55"; ADOWorkGroup.Name = "ClanderWorkGroupTest"; bworkGroup.SaveChanges(ADOWorkGroup, UIActionType.ADD); assingWorkGrouTA.Insert(ADOWorkGroup.ID, ADOPerson1.ID, new DateTime(2000, 1, 1)); BShift bshift = new BShift(); ADOShift1.Name = "ClanderShiftTest1"; ADOShift1.Person = ADOPerson1; ADOShift1.Color = "0xff6512"; ADOShift1.ShiftType = ShiftTypesEnum.WORK; ADOShift1.CustomCode = "55-54"; bshift.SaveChanges(ADOShift1, UIActionType.ADD); ShiftPair pair1 = new ShiftPair(100, 200) { ShiftId = ADOShift1.ID }; ShiftPair pair2 = new ShiftPair(200, 400) { ShiftId = ADOShift1.ID }; bshift.SaveChangesShiftPair(pair1, UIActionType.ADD); bshift.SaveChangesShiftPair(pair2, UIActionType.ADD); ADOShift2.Name = "ClanderShiftTest2"; ADOShift2.Color = "0xbbccaa"; ADOShift2.Person = ADOPerson1; ADOShift2.ShiftType = ShiftTypesEnum.WORK; ADOShift2.CustomCode = "55-55"; bshift.SaveChanges(ADOShift2, UIActionType.ADD); #endregion #region date inti date1 = Utility.ToMildiDate("1390/5/1"); date2 = Utility.ToMildiDate("1390/5/2"); date3 = Utility.ToMildiDate("1390/5/3"); date4 = Utility.ToMildiDate("1390/5/5"); date5 = Utility.ToMildiDate("1390/5/6"); date6 = Utility.ToMildiDate("1390/5/7"); date7 = Utility.ToMildiDate("1390/5/9"); #endregion #region WorkGroup Detail wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date1); wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date2); wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date3); wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date4); wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date5); wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, date6); wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, date7); #endregion ClearSession(); }