Example #1
0
        public EmployeeCollection FetchByQuery(Query qry)
        {
            EmployeeCollection coll = new EmployeeCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Example #2
0
        public EmployeeCollection FetchAll()
        {
            EmployeeCollection coll = new EmployeeCollection();
            Query qry = new Query(Employee.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Example #3
0
        public static AVManager.DAL.EmployeeCollection GetEmployeeCollection(byte varShiftID)
        {
            SubSonic.QueryCommand cmd = new SubSonic.QueryCommand(
                "SELECT * FROM Employee INNER JOIN EmployeeDepartmentHistory ON " +
                "Employee.EmployeeID=EmployeeDepartmentHistory.EmployeeID WHERE EmployeeDepartmentHistory.ShiftID=@ShiftID", Shift.Schema.Provider.Name);

            cmd.AddParameter("@ShiftID", varShiftID, DbType.Byte);
            IDataReader        rdr  = SubSonic.DataService.GetReader(cmd);
            EmployeeCollection coll = new EmployeeCollection();

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }
Example #4
0
        public static AVManager.DAL.EmployeeCollection GetEmployeeCollection(int varAddressID)
        {
            SubSonic.QueryCommand cmd = new SubSonic.QueryCommand(
                "SELECT * FROM Employee INNER JOIN EmployeeAddress ON " +
                "Employee.EmployeeID=EmployeeAddress.EmployeeID WHERE EmployeeAddress.AddressID=@AddressID", Address.Schema.Provider.Name);

            cmd.AddParameter("@AddressID", varAddressID, DbType.Int32);
            IDataReader        rdr  = SubSonic.DataService.GetReader(cmd);
            EmployeeCollection coll = new EmployeeCollection();

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }
Example #5
0
        public static void SaveEmployeeMap(byte varShiftID, EmployeeCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM EmployeeDepartmentHistory WHERE ShiftID=@ShiftID", Shift.Schema.Provider.Name);

            cmdDel.AddParameter("@ShiftID", varShiftID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Employee item in items)
            {
                EmployeeDepartmentHistory varEmployeeDepartmentHistory = new EmployeeDepartmentHistory();
                varEmployeeDepartmentHistory.SetColumnValue("ShiftID", varShiftID);
                varEmployeeDepartmentHistory.SetColumnValue("EmployeeID", item.GetPrimaryKeyValue());
                varEmployeeDepartmentHistory.Save();
            }
        }
Example #6
0
        public static void SaveEmployeeMap(int varAddressID, EmployeeCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM EmployeeAddress WHERE AddressID=@AddressID", Address.Schema.Provider.Name);

            cmdDel.AddParameter("@AddressID", varAddressID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Employee item in items)
            {
                EmployeeAddress varEmployeeAddress = new EmployeeAddress();
                varEmployeeAddress.SetColumnValue("AddressID", varAddressID);
                varEmployeeAddress.SetColumnValue("EmployeeID", item.GetPrimaryKeyValue());
                varEmployeeAddress.Save();
            }
        }
Example #7
0
        public EmployeeCollection FetchByID(object EmployeeID)
        {
            EmployeeCollection coll = new EmployeeCollection().Where("EmployeeID", EmployeeID).Load();

            return(coll);
        }