public async Task <IHttpActionResult> DeleteSuppliers(string id) { var result = Task.Factory.StartNew(() => { IUnitOfWork uow = new UnitOfWorkImp(new IRepositoryConnection[] { SuppliersRepository }); var bo = new BOSuppliers(); bo.Repository = SuppliersRepository; bo.Init(id); uow.Delete(bo); string err; if (!uow.Commit(out err)) { var resp = new HttpResponseMessage(HttpStatusCode.BadRequest) { Content = new StringContent(err) }; throw new HttpResponseException(resp); } return(true); }); await result; if (!result.Result) { return(NotFound()); } return(Ok(result.Result)); }
public IBOSuppliers BOSuppliers() { var boSuppliers = new BOSuppliers() { İd = this.İd, Company = this.Company, LastName = this.LastName, FirstName = this.FirstName, EmailAddress = this.EmailAddress, JobTitle = this.JobTitle, BusinessPhone = this.BusinessPhone, HomePhone = this.HomePhone, MobilePhone = this.MobilePhone, FaxNumber = this.FaxNumber, Address = this.Address, City = this.City, StateProvince = this.StateProvince, ZipPostalCode = this.ZipPostalCode, CountryRegion = this.CountryRegion, WebPage = this.WebPage, Notes = this.Notes, Attachments = this.Attachments != null?Convert.FromBase64String(this.Attachments) : null }; return(boSuppliers); }
public IBOSuppliers BOSuppliers(ISuppliersRepository repo) { BOSuppliers boSuppliers = (BOSuppliers)BOSuppliers(); boSuppliers.Repository = repo; return(boSuppliers); }
public IBOSuppliers BOSuppliers() { var boSuppliers = new BOSuppliers() { SupplierID = this.SupplierID, CompanyName = this.CompanyName, ContactName = this.ContactName, ContactTitle = this.ContactTitle, Address = this.Address, City = this.City, Region = this.Region, PostalCode = this.PostalCode, Country = this.Country, Phone = this.Phone, Fax = this.Fax, HomePage = this.HomePage }; return(boSuppliers); }