Ejemplo n.º 1
0
        public DepartmentCollection FetchByQuery(Query qry)
        {
            DepartmentCollection coll = new DepartmentCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Ejemplo n.º 2
0
        public DepartmentCollection FetchAll()
        {
            DepartmentCollection coll = new DepartmentCollection();
            Query qry = new Query(Department.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Ejemplo n.º 3
0
        public static AVManager.DAL.DepartmentCollection GetDepartmentCollection(byte varShiftID)
        {
            SubSonic.QueryCommand cmd = new SubSonic.QueryCommand(
                "SELECT * FROM Department INNER JOIN EmployeeDepartmentHistory ON " +
                "Department.DepartmentID=EmployeeDepartmentHistory.DepartmentID WHERE EmployeeDepartmentHistory.ShiftID=@ShiftID", Shift.Schema.Provider.Name);

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

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }
Ejemplo n.º 4
0
        public static void SaveDepartmentMap(byte varShiftID, DepartmentCollection 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 (Department item in items)
            {
                EmployeeDepartmentHistory varEmployeeDepartmentHistory = new EmployeeDepartmentHistory();
                varEmployeeDepartmentHistory.SetColumnValue("ShiftID", varShiftID);
                varEmployeeDepartmentHistory.SetColumnValue("DepartmentID", item.GetPrimaryKeyValue());
                varEmployeeDepartmentHistory.Save();
            }
        }
Ejemplo n.º 5
0
        public DepartmentCollection FetchByID(object DepartmentID)
        {
            DepartmentCollection coll = new DepartmentCollection().Where("DepartmentID", DepartmentID).Load();

            return(coll);
        }