Ejemplo n.º 1
0
        public static void SaveEmployeeMap(byte varShiftID, byte[] itemList)
        {
            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 (byte item in itemList)
            {
                EmployeeDepartmentHistory varEmployeeDepartmentHistory = new EmployeeDepartmentHistory();
                varEmployeeDepartmentHistory.SetColumnValue("ShiftID", varShiftID);
                varEmployeeDepartmentHistory.SetColumnValue("EmployeeID", item);
                varEmployeeDepartmentHistory.Save();
            }
        }
Ejemplo n.º 2
0
        public static void SaveShiftMap(int varEmployeeID, ShiftCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM EmployeeDepartmentHistory WHERE EmployeeID=@EmployeeID", Employee.Schema.Provider.Name);

            cmdDel.AddParameter("@EmployeeID", varEmployeeID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Shift item in items)
            {
                EmployeeDepartmentHistory varEmployeeDepartmentHistory = new EmployeeDepartmentHistory();
                varEmployeeDepartmentHistory.SetColumnValue("EmployeeID", varEmployeeID);
                varEmployeeDepartmentHistory.SetColumnValue("ShiftID", item.GetPrimaryKeyValue());
                varEmployeeDepartmentHistory.Save();
            }
        }
Ejemplo n.º 3
0
        public void Update(int EmployeeID, short DepartmentID, byte ShiftID, DateTime StartDate, DateTime?EndDate, DateTime ModifiedDate)
        {
            EmployeeDepartmentHistory item = new EmployeeDepartmentHistory();

            item.EmployeeID = EmployeeID;

            item.DepartmentID = DepartmentID;

            item.ShiftID = ShiftID;

            item.StartDate = StartDate;

            item.EndDate = EndDate;

            item.ModifiedDate = ModifiedDate;

            item.MarkOld();
            item.Save(UserName);
        }
Ejemplo n.º 4
0
        public static void SaveDepartmentMap(byte varShiftID, System.Web.UI.WebControls.ListItemCollection itemList)
        {
            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 (System.Web.UI.WebControls.ListItem l in itemList)
            {
                if (l.Selected)
                {
                    EmployeeDepartmentHistory varEmployeeDepartmentHistory = new EmployeeDepartmentHistory();
                    varEmployeeDepartmentHistory.SetColumnValue("ShiftID", varShiftID);
                    varEmployeeDepartmentHistory.SetColumnValue("DepartmentID", l.Value);
                    varEmployeeDepartmentHistory.Save();
                }
            }
        }