public bool SalesTerritoryUpdate(SalesTerritory salesterritory)
        {
            return Execute<bool>(dal =>
            {
                SalesTerritory salesterritoryUpdate = dal.SalesTerritory.Where(x => x.TerritoryID == salesterritory.TerritoryID).FirstOrDefault();
                if (salesterritoryUpdate != null)
                {
                    salesterritoryUpdate.TerritoryID = salesterritory.TerritoryID;
                    salesterritoryUpdate.Name = salesterritory.Name;
                    salesterritoryUpdate.CountryRegionCode = salesterritory.CountryRegionCode;
                    salesterritoryUpdate.Group = salesterritory.Group;
                    salesterritoryUpdate.SalesYTD = salesterritory.SalesYTD;
                    salesterritoryUpdate.SalesLastYear = salesterritory.SalesLastYear;
                    salesterritoryUpdate.CostYTD = salesterritory.CostYTD;
                    salesterritoryUpdate.CostLastYear = salesterritory.CostLastYear;
                    salesterritoryUpdate.rowguid = salesterritory.rowguid;
                    salesterritoryUpdate.ModifiedDate = salesterritory.ModifiedDate;

                    dal.SubmitChanges();
                    return true;
                }
                return false;

            });
        }
        public bool SalesTerritoryDelete(SalesTerritory salesterritory)
        {
            return Execute<bool>(dal =>
            {
                SalesTerritory salesterritoryDelete = dal.SalesTerritory.Where(x => x.TerritoryID == salesterritory.TerritoryID).FirstOrDefault();
                if (salesterritoryDelete != null)
                {
                    dal.SalesTerritory.DeleteOnSubmit(salesterritoryDelete);
                    dal.SubmitChanges();
                    return true;
                }
                return false;

            });
        }
 partial void DeleteSalesTerritory(SalesTerritory instance);
 partial void UpdateSalesTerritory(SalesTerritory instance);
 partial void InsertSalesTerritory(SalesTerritory instance);
		private void detach_SalesTerritories(SalesTerritory entity)
		{
			this.SendPropertyChanging();
			entity.CountryRegion = null;
		}
 public void SalesTerritoryUpdate(SalesTerritory salesterritory)
 {
     adventureWorks_BC.SalesTerritoryUpdate(salesterritory);
 }
 public void SalesTerritoryAdd(SalesTerritory salesterritory)
 {
     adventureWorks_BC.SalesTerritoryAdd(salesterritory);
 }