Exemplo n.º 1
0
        public void TestSetup()
        {
            workgroup_testObject = new WorkGroup();
            busWorkgroup         = new BWorkgroup();

            personTA.InsertQuery("0000", "ali", true, null);
            int personId = Convert.ToInt32(personTA.GetDataByBarcode("0000")[0][0]);

            workgrpTA.Insert("WorkGroupTest", "0-0", 0);
            workgrpTA.Insert("WorkGroupTest1", "0-1", 0);

            DatabaseGateway.TA_WorkGroupDataTable table = new DatabaseGateway.TA_WorkGroupDataTable();
            workgrpTA.FillByName(table, "WorkGroupTest");
            ADOWorkGroup.ID         = Convert.ToInt32(table.Rows[0]["workgroup_ID"]);
            ADOWorkGroup.Name       = Convert.ToString(table.Rows[0]["workgroup_Name"]);
            ADOWorkGroup.CustomCode = Convert.ToString(table.Rows[0]["workgroup_CustomCode"]);

            shiftTA.Insert("ShiftTest", 1, 11, null, 100, false, false, false, "2", "0-0");

            DatabaseGateway.TA_ShiftDataTable shiftTable = new DatabaseGateway.TA_ShiftDataTable();
            shiftTA.FillByName(shiftTable, "ShiftTest");
            ADOShift.ID = Convert.ToInt32(shiftTable.Rows[0]["shift_ID"]);

            workgrpDtlTA.Insert(ADOWorkGroup.ID, ADOShift.ID, DateTime.Now);

            assignWorkGroupTA.Insert(ADOWorkGroup.ID, personId, DateTime.Now);
        }
Exemplo n.º 2
0
        public void TestSetup()
        {
            busDataAccess = new BDataAccess();

            #region Shift
            shiftTA.Insert("ShiftTest", 1, 11, null, 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.CustomCode = Convert.ToString(shiftTable.Rows[0]["shift_CustomCode"]);

            dataAccessShiftTA.Insert(BUser.CurrentUser.ID, ADOShift.ID, false);
            ADODAShift.ID = (dataAccessShiftTA.GetByShiftId(BUser.CurrentUser.ID, ADOShift.ID).Rows[0] as DatabaseGateway.TA_DataAccessShiftRow).DataAccessShift_ID;
            #endregion

            #region WorkGroup
            workgrpTA.Insert("WorkGroupTest1", "0-1", 0);

            DatabaseGateway.TA_WorkGroupDataTable workGrouptable = new DatabaseGateway.TA_WorkGroupDataTable();
            workgrpTA.FillByName(workGrouptable, "WorkGroupTest1");
            ADOWorkGroup.ID         = Convert.ToInt32(workGrouptable.Rows[0]["workgroup_ID"]);
            ADOWorkGroup.Name       = Convert.ToString(workGrouptable.Rows[0]["workgroup_Name"]);
            ADOWorkGroup.CustomCode = Convert.ToString(workGrouptable.Rows[0]["workgroup_CustomCode"]);

            dataAccessWorkGroupTA.Insert(BUser.CurrentUser.ID, ADOWorkGroup.ID, false);
            ADODAWorkGroup.ID = (dataAccessWorkGroupTA.GetDataByWorkGroupId(ADOWorkGroup.ID, BUser.CurrentUser.ID).Rows[0] as DatabaseGateway.TA_DataAccessWorkGroupRow).DataAccessWorkGrp_ID;
            #endregion

            #region Precard
            groupPrecardTA.Insert("TestPrecardGroup", "TestGroup1");
            DatasetGatewayWorkFlow.TA_PrecardGroupsDataTable groupTable;
            groupTable  = groupPrecardTA.GetDataByName("TestGroup1");
            ADOGroup.ID = Convert.ToDecimal(groupTable.Rows[0][0]);

            precardTA.Insert("TestPish2", true, ADOGroup.ID, false, true, false, "1002", false);

            DatasetGatewayWorkFlow.TA_PrecardDataTable precardTable = new DatasetGatewayWorkFlow.TA_PrecardDataTable();
            precardTable  = precardTA.GetDataByName("TestPish2");
            ADOPrecard.ID = Convert.ToDecimal(precardTable.Rows[0][0]);

            dataAccessPrecardTA.Insert(BUser.CurrentUser.ID, ADOPrecard.ID, false);
            ADODAPrecard.ID = (dataAccessPrecardTA.GetDataByPrecardId(BUser.CurrentUser.ID, ADOPrecard.ID).Rows[0] as DatabaseGateway.TA_DataAccessPrecardRow).DataAccessPreCard_ID;
            #endregion

            #region Station
            dataAccessControlStationTA.Insert(BUser.CurrentUser.ID, ADOStaion1.ID, false);
            ADODACtrlStation.ID = (dataAccessControlStationTA.GetDataByControlIdId(BUser.CurrentUser.ID, ADOStaion1.ID).Rows[0] as DatabaseGateway.TA_DataAccessCtrlStationRow).DataAccessCtrlStation_ID;
            #endregion
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        public void TestSetup()
        {
            busExceptionShift  = new BExceptionShift();
            shiftEx_testobject = new ShiftException();

            #region Shift
            shiftTA.Insert("ShiftTest1", 1, 11, null, 100, false, false, false, "2", "0-00");
            shiftTA.Insert("ShiftTest2", 1, 11, null, 100, false, false, false, "2", "0-00");
            ADOShift1 = new Shift();

            DatabaseGateway.TA_ShiftDataTable shiftTable = new DatabaseGateway.TA_ShiftDataTable();
            shiftTA.FillByName(shiftTable, "ShiftTest1");
            ADOShift1.ID = Convert.ToInt32(shiftTable.Rows[0]["shift_ID"]);
            shiftTA.FillByName(shiftTable, "ShiftTest2");
            ADOShift2.ID = Convert.ToInt32(shiftTable.Rows[0]["shift_ID"]);
            #endregion

            #region WorkGroup & WorkGroup Detail & Assignment
            BWorkgroup bworkGroup = new BWorkgroup();
            ADOWorkGroup.CustomCode = "00-00";
            ADOWorkGroup.Name       = "TestWorkGroup";
            bworkGroup.SaveChanges(ADOWorkGroup, UIActionType.ADD);

            ADOWorkGroup2.CustomCode = "00-01";
            ADOWorkGroup2.Name       = "TestWorkGroup2";
            bworkGroup.SaveChanges(ADOWorkGroup2, UIActionType.ADD);

            wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, Utility.ToMildiDate("1390/10/01"));
            wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, Utility.ToMildiDate("1390/10/03"));
            wgdTA.Insert(ADOWorkGroup2.ID, ADOShift2.ID, Utility.ToMildiDate("1390/10/01"));

            asgWrgTA.Insert(ADOWorkGroup.ID, ADOPerson2.ID, Utility.ToMildiDate("1390/09/15"));
            asgWrgTA.Insert(ADOWorkGroup2.ID, ADOPerson1.ID, Utility.ToMildiDate("1390/09/15"));
            #endregion
            exShiftTA.Insert(ADOPerson1.ID, ADOShift1.ID, Utility.ToMildiDate("1390/10/10"), ADOUser1.ID, DateTime.Now, "");
            DatabaseGateway.TA_ExceptionShiftDataTable exShiftTable = exShiftTA.GetDataByPersonId(ADOPerson1.ID);
            ADOExShift.ID = Convert.ToDecimal(exShiftTable.Rows[0]["ExceptionShift_ID"]);
        }