Exemplo n.º 1
0
        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;

            });
        }
Exemplo n.º 2
0
        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);
Exemplo n.º 7
0
 public void SalesPersonUpdate(SalesPerson salesperson)
 {
     adventureWorks_BC.SalesPersonUpdate(salesperson);
 }
Exemplo n.º 8
0
 public void SalesPersonAdd(SalesPerson salesperson)
 {
     adventureWorks_BC.SalesPersonAdd(salesperson);
 }