예제 #1
0
        public void Update(int EmployeeID, int AddressID, Guid Rowguid, DateTime ModifiedDate)
        {
            EmployeeAddress item = new EmployeeAddress();

            item.EmployeeID = EmployeeID;

            item.AddressID = AddressID;

            item.Rowguid = Rowguid;

            item.ModifiedDate = ModifiedDate;

            item.MarkOld();
            item.Save(UserName);
        }
예제 #2
0
        public static void SaveAddressMap(int varEmployeeID, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM EmployeeAddress WHERE EmployeeID=@EmployeeID", Employee.Schema.Provider.Name);

            cmdDel.AddParameter("@EmployeeID", varEmployeeID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                EmployeeAddress varEmployeeAddress = new EmployeeAddress();
                varEmployeeAddress.SetColumnValue("EmployeeID", varEmployeeID);
                varEmployeeAddress.SetColumnValue("AddressID", item);
                varEmployeeAddress.Save();
            }
        }
예제 #3
0
        public static void SaveEmployeeMap(int varAddressID, System.Web.UI.WebControls.ListItemCollection itemList)
        {
            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 (System.Web.UI.WebControls.ListItem l in itemList)
            {
                if (l.Selected)
                {
                    EmployeeAddress varEmployeeAddress = new EmployeeAddress();
                    varEmployeeAddress.SetColumnValue("AddressID", varAddressID);
                    varEmployeeAddress.SetColumnValue("EmployeeID", l.Value);
                    varEmployeeAddress.Save();
                }
            }
        }
예제 #4
0
 public bool Destroy(object EmployeeID)
 {
     return(EmployeeAddress.Destroy(EmployeeID) == 1);
 }
예제 #5
0
 public bool Delete(object EmployeeID)
 {
     return(EmployeeAddress.Delete(EmployeeID) == 1);
 }