///<Summary> ///SaveNew ///This method persists a new Suppliers record to the store ///</Summary> ///<returns> ///void ///</returns> ///<parameters> /// ///</parameters> public virtual void SaveNew() { Doing(this); IDAOSuppliers daoSuppliers = _iSuppliersRepository.New(); RegisterDataObject(_iSuppliersRepository, _iSuppliersRepository.BaseData(daoSuppliers)); BeginTransaction(_iSuppliersRepository, "savenewBOSuppliers"); try { daoSuppliers.Company = _company; daoSuppliers.LastName = _lastName; daoSuppliers.FirstName = _firstName; daoSuppliers.EmailAddress = _emailAddress; daoSuppliers.JobTitle = _jobTitle; daoSuppliers.BusinessPhone = _businessPhone; daoSuppliers.HomePhone = _homePhone; daoSuppliers.MobilePhone = _mobilePhone; daoSuppliers.FaxNumber = _faxNumber; daoSuppliers.Address = _address; daoSuppliers.City = _city; daoSuppliers.StateProvince = _stateProvince; daoSuppliers.ZipPostalCode = _zipPostalCode; daoSuppliers.CountryRegion = _countryRegion; daoSuppliers.WebPage = _webPage; daoSuppliers.Notes = _notes; daoSuppliers.Attachments = _attachments; _iSuppliersRepository.Insert(daoSuppliers); CommitTransaction(_iSuppliersRepository); Done(this); _id = daoSuppliers.İd; _company = daoSuppliers.Company; _lastName = daoSuppliers.LastName; _firstName = daoSuppliers.FirstName; _emailAddress = daoSuppliers.EmailAddress; _jobTitle = daoSuppliers.JobTitle; _businessPhone = daoSuppliers.BusinessPhone; _homePhone = daoSuppliers.HomePhone; _mobilePhone = daoSuppliers.MobilePhone; _faxNumber = daoSuppliers.FaxNumber; _address = daoSuppliers.Address; _city = daoSuppliers.City; _stateProvince = daoSuppliers.StateProvince; _zipPostalCode = daoSuppliers.ZipPostalCode; _countryRegion = daoSuppliers.CountryRegion; _webPage = daoSuppliers.WebPage; _notes = daoSuppliers.Notes; _attachments = daoSuppliers.Attachments; _ctrVersion = daoSuppliers.CtrVersion; _isDirty = false; } catch (Exception ex) { Failed(this, ex); RollbackTransaction(_iSuppliersRepository, "savenewBOSuppliers"); Handle(this, ex); } }
///<Summary> ///SaveNew ///This method persists a new Suppliers record to the store ///</Summary> ///<returns> ///void ///</returns> ///<parameters> /// ///</parameters> public virtual void SaveNew() { Doing(this); IDAOSuppliers daoSuppliers = _iSuppliersRepository.New(); RegisterDataObject(_iSuppliersRepository, _iSuppliersRepository.BaseData(daoSuppliers)); BeginTransaction(_iSuppliersRepository, "savenewBOSuppliers"); try { daoSuppliers.CompanyName = _companyName; daoSuppliers.ContactName = _contactName; daoSuppliers.ContactTitle = _contactTitle; daoSuppliers.Address = _address; daoSuppliers.City = _city; daoSuppliers.Region = _region; daoSuppliers.PostalCode = _postalCode; daoSuppliers.Country = _country; daoSuppliers.Phone = _phone; daoSuppliers.Fax = _fax; daoSuppliers.HomePage = _homePage; _iSuppliersRepository.Insert(daoSuppliers); CommitTransaction(_iSuppliersRepository); Done(this); _supplierID = daoSuppliers.SupplierID; _companyName = daoSuppliers.CompanyName; _contactName = daoSuppliers.ContactName; _contactTitle = daoSuppliers.ContactTitle; _address = daoSuppliers.Address; _city = daoSuppliers.City; _region = daoSuppliers.Region; _postalCode = daoSuppliers.PostalCode; _country = daoSuppliers.Country; _phone = daoSuppliers.Phone; _fax = daoSuppliers.Fax; _homePage = daoSuppliers.HomePage; _ctrVersion = daoSuppliers.CtrVersion; _isDirty = false; } catch (Exception ex) { Failed(this, ex); RollbackTransaction(_iSuppliersRepository, "savenewBOSuppliers"); Handle(this, ex); } }