Example #1
0
        private void createPostalAddress(Client newClient, int clientId, safricomEntities model, clientaddress postalAddress, PersistanceMethod method)
        {
            postalAddress.street_number = newClient.PostalAddress.StreetNumber;
            postalAddress.street        = newClient.PostalAddress.Street;
            postalAddress.post_box      = newClient.PostalAddress.PoBox;
            postalAddress.city          = newClient.PostalAddress.City;
            postalAddress.suburb        = newClient.PostalAddress.Suburb;
            postalAddress.postal_code   = newClient.PostalAddress.PostalCode;
            postalAddress.client_id     = clientId;
            postalAddress.type          = AddressType.Postal.ToString();

            if (method == PersistanceMethod.Create)
            {
                model.clientaddresses.Add(postalAddress);
            }

            if (model.SaveChanges() > 0)
            {
                _log.Debug(String.Format("Successfully created client postal address of '{0} {1}'", newClient.Name, newClient.Surname));
            }
            else
            {
                _log.Warn(String.Format("No changes were made for client postal address of '{0} {1}'", newClient.Name, newClient.Surname));
            }
        }
Example #2
0
        private void createClientBasicInformation(Client newClient, safricomEntities model, client thisClient, PersistanceMethod method)
        {
            thisClient.name             = newClient.Name;
            thisClient.surname          = newClient.Surname;
            thisClient.business_name    = newClient.BusinessName;
            thisClient.cell_phone_one   = newClient.CellPhoneOne;
            thisClient.email            = newClient.Email;
            thisClient.telephone_work   = newClient.Telephone;
            thisClient.id_passport      = newClient.IdPassport;
            thisClient.vat_registration = newClient.VatNumber;

            if (method == PersistanceMethod.Create)
            {
                model.clients.Add(thisClient);
            }

            if (model.SaveChanges() > 0)
            {
                _log.Debug(String.Format("Successfully created client basic information form '{0} {1}'", thisClient.name, thisClient.surname));
            }
            else
            {
                _log.Warn(String.Format("No changes were made for client basic information of '{0} {1}'", thisClient.name, thisClient.surname));
            }
        }
Example #3
0
        private void createInstallationAddress(Client newClient, int clientId, safricomEntities model, clientaddress installationAddress, PersistanceMethod method)
        {
            installationAddress.street_number   = newClient.InstallationAddress.StreetNumber;
            installationAddress.street          = newClient.InstallationAddress.Street;
            installationAddress.city            = newClient.InstallationAddress.City;
            installationAddress.suburb          = newClient.InstallationAddress.Suburb;
            installationAddress.gps_coordinates = newClient.InstallationAddress.GPS;
            installationAddress.client_id       = clientId;
            installationAddress.type            = AddressType.Installation.ToString();

            if (method == PersistanceMethod.Create)
            {
                model.clientaddresses.Add(installationAddress);
            }

            if (model.SaveChanges() > 0)
            {
                _log.Debug(String.Format("Successfully created client innstallation address of '{0} {1}'", newClient.Name, newClient.Surname));
            }
            else
            {
                _log.Warn(String.Format("No changes were made for client installation address of '{0} {1}'", newClient.Name, newClient.Surname));
            }
        }