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