public bool SalesPersonDelete(SalesPerson salesperson) { return Execute<bool>(dal => { SalesPerson salespersonDelete = dal.SalesPerson.Where(x => x.BusinessEntityID == salesperson.BusinessEntityID).FirstOrDefault(); if (salespersonDelete != null) { dal.SalesPerson.DeleteOnSubmit(salespersonDelete); dal.SubmitChanges(); return true; } return false; }); }
public bool SalesPersonUpdate(SalesPerson salesperson) { return Execute<bool>(dal => { SalesPerson salespersonUpdate = dal.SalesPerson.Where(x => x.BusinessEntityID == salesperson.BusinessEntityID).FirstOrDefault(); if (salespersonUpdate != null) { salespersonUpdate.BusinessEntityID = salesperson.BusinessEntityID; salespersonUpdate.TerritoryID = salesperson.TerritoryID; salespersonUpdate.SalesQuota = salesperson.SalesQuota; salespersonUpdate.Bonus = salesperson.Bonus; salespersonUpdate.CommissionPct = salesperson.CommissionPct; salespersonUpdate.SalesYTD = salesperson.SalesYTD; salespersonUpdate.SalesLastYear = salesperson.SalesLastYear; salespersonUpdate.rowguid = salesperson.rowguid; salespersonUpdate.ModifiedDate = salesperson.ModifiedDate; dal.SubmitChanges(); return true; } return false; }); }
partial void DeleteSalesPerson(SalesPerson instance);
private void detach_SalesPersons(SalesPerson entity) { this.SendPropertyChanging(); entity.SalesTerritory = null; }
partial void UpdateSalesPerson(SalesPerson instance);
partial void InsertSalesPerson(SalesPerson instance);
public void SalesPersonUpdate(SalesPerson salesperson) { adventureWorks_BC.SalesPersonUpdate(salesperson); }
public void SalesPersonAdd(SalesPerson salesperson) { adventureWorks_BC.SalesPersonAdd(salesperson); }