public void Insert(int EmployeeID, string TerritoryID) { EmployeeTerritory item = new EmployeeTerritory(); item.EmployeeID = EmployeeID; item.TerritoryID = TerritoryID; item.Save(UserName); }
public void Update(int EmployeeID, string TerritoryID) { EmployeeTerritory item = new EmployeeTerritory(); item.MarkOld(); item.IsLoaded = true; item.EmployeeID = EmployeeID; item.TerritoryID = TerritoryID; item.Save(UserName); }
public static void SaveTerritoryMap(int varEmployeeID, string[] itemList) { QueryCommandCollection coll = new SubSonic.QueryCommandCollection(); //delete out the existing QueryCommand cmdDel = new QueryCommand("DELETE FROM [EmployeeTerritories] WHERE [EmployeeTerritories].[EmployeeID] = @EmployeeID", Employee.Schema.Provider.Name); cmdDel.AddParameter("@EmployeeID", varEmployeeID, DbType.Int32); coll.Add(cmdDel); DataService.ExecuteTransaction(coll); foreach (string item in itemList) { EmployeeTerritory varEmployeeTerritory = new EmployeeTerritory(); varEmployeeTerritory.SetColumnValue("EmployeeID", varEmployeeID); varEmployeeTerritory.SetColumnValue("TerritoryID", item); varEmployeeTerritory.Save(); } }
public static void SaveEmployeeMap(string varTerritoryID, EmployeeCollection items) { QueryCommandCollection coll = new SubSonic.QueryCommandCollection(); //delete out the existing QueryCommand cmdDel = new QueryCommand("DELETE FROM [EmployeeTerritories] WHERE [EmployeeTerritories].[TerritoryID] = @TerritoryID", Territory.Schema.Provider.Name); cmdDel.AddParameter("@TerritoryID", varTerritoryID, DbType.String); coll.Add(cmdDel); DataService.ExecuteTransaction(coll); foreach (Employee item in items) { EmployeeTerritory varEmployeeTerritory = new EmployeeTerritory(); varEmployeeTerritory.SetColumnValue("TerritoryID", varTerritoryID); varEmployeeTerritory.SetColumnValue("EmployeeID", item.GetPrimaryKeyValue()); varEmployeeTerritory.Save(); } }
public static void SaveEmployeeMap(string varTerritoryID, System.Web.UI.WebControls.ListItemCollection itemList) { QueryCommandCollection coll = new SubSonic.QueryCommandCollection(); //delete out the existing QueryCommand cmdDel = new QueryCommand("DELETE FROM [EmployeeTerritories] WHERE [EmployeeTerritories].[TerritoryID] = @TerritoryID", Territory.Schema.Provider.Name); cmdDel.AddParameter("@TerritoryID", varTerritoryID, DbType.String); coll.Add(cmdDel); DataService.ExecuteTransaction(coll); foreach (System.Web.UI.WebControls.ListItem l in itemList) { if (l.Selected) { EmployeeTerritory varEmployeeTerritory = new EmployeeTerritory(); varEmployeeTerritory.SetColumnValue("TerritoryID", varTerritoryID); varEmployeeTerritory.SetColumnValue("EmployeeID", l.Value); varEmployeeTerritory.Save(); } } }
public void Update(int EmployeeID,string TerritoryID) { EmployeeTerritory item = new EmployeeTerritory(); item.MarkOld(); item.IsLoaded = true; item.EmployeeID = EmployeeID; item.TerritoryID = TerritoryID; item.Save(UserName); }
public void Insert(int EmployeeID,string TerritoryID) { EmployeeTerritory item = new EmployeeTerritory(); item.EmployeeID = EmployeeID; item.TerritoryID = TerritoryID; item.Save(UserName); }
public bool Destroy(object EmployeeID) { return(EmployeeTerritory.Destroy(EmployeeID) == 1); }
public bool Delete(object EmployeeID) { return(EmployeeTerritory.Delete(EmployeeID) == 1); }
partial void DeleteEmployeeTerritory(EmployeeTerritory instance);
partial void UpdateEmployeeTerritory(EmployeeTerritory instance);
partial void InsertEmployeeTerritory(EmployeeTerritory instance);
private void detach_EmployeeTerritories(EmployeeTerritory entity) { this.SendPropertyChanging(); entity.Territory = null; }
private void attach_EmployeeTerritories(EmployeeTerritory entity) { this.SendPropertyChanging(); entity.Employee = this; }