Пример #1
0
        public DBContactToServer(DBlocalContact c, bool isNewContact = false)
        {
            if (c == null)
            {
                throw new ArgumentNullException("Contact must not be null");
            }
            //if (string.IsNullOrWhiteSpace(c.uid))
            //{
            //    throw new ArgumentException("Contact UID must not be null or empty");
            //}

            this.uid = c.uid;

            this.city       = c.city != null || !isNewContact                       ? c.city                        : valueForUnchanged;
            this.company    = c.company != null || !isNewContact                    ? c.company                     : valueForUnchanged;
            this.country    = c.country != null || !isNewContact                    ? c.country                     : valueForUnchanged;
            this.department = c.department != null || !isNewContact                 ? c.department                  : valueForUnchanged;
            this.email      = c.email != null || !isNewContact                      ? c.email                       : valueForUnchanged;
            this.externalCompanyReference = c.externalCompanyReference != null || !isNewContact   ? c.externalCompanyReference    : valueForUnchanged;
            this.externalReference        = c.externalReference != null || !isNewContact          ? c.externalReference           : valueForUnchanged;
            this.fax       = c.fax != null || !isNewContact                        ? c.fax                         : valueForUnchanged;
            this.firstname = c.firstname != null || !isNewContact                  ? c.firstname                   : valueForUnchanged;
            this.function  = c.function != null || !isNewContact                   ? c.function                    : valueForUnchanged;
            this.jobtitle  = c.jobtitle != null || !isNewContact                   ? c.jobtitle                    : valueForUnchanged;
            this.lastname  = c.lastname != null || !isNewContact                   ? c.lastname                    : valueForUnchanged;
            this.level     = c.level != null || !isNewContact                      ? c.level                       : valueForUnchanged;
            this.mobile    = c.mobile != null || !isNewContact                     ? c.mobile                      : valueForUnchanged;
            this.phone     = c.phone != null || !isNewContact                      ? c.phone                       : valueForUnchanged;
            this.prefix    = c.prefix != null || !isNewContact                     ? c.prefix                      : valueForUnchanged;
            this.street    = c.street != null || !isNewContact                     ? c.street                      : valueForUnchanged;
            this.vat       = c.vat != null || !isNewContact                        ? c.vat                         : valueForUnchanged;
            this.zip       = c.zip != null || !isNewContact                        ? c.zip                         : valueForUnchanged;
        }
 public DBpopupContact(DBlocalContact lc)
 {
     firstName = lc.firstname;
     lastName  = lc.lastname;
     email     = lc.email;
     company   = lc.company;
     phone     = lc.phone;
     jobTitle  = lc.jobtitle;
     //source = lc.source;
     street  = lc.street;
     zip     = lc.zip;
     city    = lc.city;
     country = lc.country;
 }
        public void AddLocalContactPopup(DBpopupContact item)
        {
            SQLiteConnection connection = GetConnection();

            connection.CreateTable <DBpopupContact>();
            DBlocalContact lc = new DBlocalContact();

            lc.company   = item.company;
            lc.email     = item.email;
            lc.firstname = item.firstName;
            lc.lastname  = item.lastName;
            lc.phone     = item.phone;
            //lc.source = item.source;
            lc.city    = item.city;
            lc.zip     = item.zip;
            lc.street  = item.street;
            lc.country = item.country;
            //lc.uuid = item.uuid;
            //AddLocalContact (lc);
            connection.Insert(item);
        }
Пример #4
0
 public CustomerType(DBlocalContact contact)
 {
     this.city       = contact.city;
     this.company    = contact.company;
     this.country    = contact.country;
     this.department = contact.department;
     this.email      = contact.email;
     this.externalCompanyReference = contact.externalCompanyReference;
     this.externalReference        = contact.externalReference;
     this.fax       = contact.fax;
     this.firstname = contact.firstname;
     this.function  = contact.function;
     this.jobtitle  = contact.jobtitle;
     this.lastname  = contact.lastname;
     this.level     = contact.level;
     this.mobile    = contact.mobile;
     this.phone     = contact.phone;
     this.prefix    = contact.prefix;
     this.street    = contact.street;
     this.uid       = contact.uid;
     this.vat       = contact.vat;
     this.zip       = contact.zip;
 }