public void updateFromServerContact(CustomerType serverContact) { this.city = string.IsNullOrEmpty(this.city) ? serverContact.city : this.city; this.company = string.IsNullOrEmpty(this.company) ? serverContact.company : this.company; this.country = string.IsNullOrEmpty(this.country) ? serverContact.country : this.country; this.department = string.IsNullOrEmpty(this.department) ? serverContact.department : this.department; this.email = string.IsNullOrEmpty(this.email) ? serverContact.email : this.email; this.externalCompanyReference = string.IsNullOrEmpty(this.externalCompanyReference) ? serverContact.externalCompanyReference : this.externalCompanyReference; this.externalReference = string.IsNullOrEmpty(this.externalReference) ? serverContact.externalReference : this.externalReference; this.fax = string.IsNullOrEmpty(this.fax) ? serverContact.fax : this.fax; this.firstname = string.IsNullOrEmpty(this.firstname) ? serverContact.firstname : this.firstname; this.function = string.IsNullOrEmpty(this.function) ? serverContact.function : this.function; this.jobtitle = string.IsNullOrEmpty(this.jobtitle) ? serverContact.jobtitle : this.jobtitle; this.lastname = string.IsNullOrEmpty(this.lastname) ? serverContact.lastname : this.lastname; this.level = string.IsNullOrEmpty(this.level) ? serverContact.level : this.level; this.mobile = string.IsNullOrEmpty(this.mobile) ? serverContact.mobile : this.mobile; this.phone = string.IsNullOrEmpty(this.phone) ? serverContact.phone : this.phone; this.prefix = string.IsNullOrEmpty(this.prefix) ? serverContact.prefix : this.prefix; this.street = string.IsNullOrEmpty(this.street) ? serverContact.street : this.street; this.vat = string.IsNullOrEmpty(this.vat) ? serverContact.vat : this.vat; this.zip = string.IsNullOrEmpty(this.zip) ? serverContact.zip : this.zip; }
public DBlocalContact(CustomerType serverContact) { this.city = serverContact.city; this.company = serverContact.company; this.country = serverContact.country; this.department = serverContact.department; this.email = serverContact.email; this.externalCompanyReference = serverContact.externalCompanyReference; this.externalReference = serverContact.externalReference; this.fax = serverContact.fax; this.firstname = serverContact.firstname; this.function = serverContact.function; this.jobtitle = serverContact.jobtitle; this.lastname = serverContact.lastname; this.level = serverContact.level; this.mobile = serverContact.mobile; this.phone = serverContact.phone; this.prefix = serverContact.prefix; this.street = serverContact.street; this.uid = serverContact.uid; this.vat = serverContact.vat; this.zip = serverContact.zip; }
public List <OrderType> GetAllContactsFromShare(List <DBOverviewContacts> _list_share) { //var _list_share = new List<DBOverviewContacts> (); var _list_ordertype = new List <OrderType> (); try{ //_list_share = DBLocalDataStore.GetInstance().GetOverwievContacts(-1, "new").FindAll(s=>s.isfiles == true); //_list_share = (from contact in _list_share where contact.isfiles == true select contact); if (_list_share.Count == 0) { return(_list_ordertype); } foreach (var ls in _list_share) { var _order = new OrderType(); var outCustomers = new CustomerType(); outCustomers.company = ls.company; outCustomers.firstname = ls.firstName; outCustomers.lastname = ls.lastName; outCustomers.email = ls.email; outCustomers.phone = ls.phone; //outCustomers.source = ls.source; outCustomers.zip = ls.zip; outCustomers.street = ls.street; outCustomers.city = ls.city; outCustomers.country = ls.country; //if (!string.IsNullOrEmpty(ls.barcode)){ // outCustomers.badge = new BrandTappBadge { // properties = new IBadgeProperties{ barcode = ls.barcode }, // type = "barcode" // }; //} //2015-09-08T13:34:45+06:00 _order.created = string.Format("{0:yyyy-MM-ddTH:mm:sszzz}", new DateTimeOffset(ls.datetime)); //string.Format("{0:yyyy-MM-ddTH:mm:sszzz}", dto); // Console.WriteLine(_order.created); _order.customer = outCustomers; _order.creator = GetUserMail(); _order.profile = GetSelectProfile().shortName; var _list_share_files = GetOverwievFiles(ls.session, "new"); var _line = new List <OrderLineType>(); foreach (var _lf in _list_share_files) { var _linet = new OrderLineType(); _linet.item = _lf.uuid; _linet.itemDescription = _lf.name; _line.Add(_linet); } _order.orderLine = _line.ToArray(); if (_list_share_files.Count != 0) { _list_ordertype.Add(_order); } } } catch //(Exception ex) { // Console.WriteLine (ex.Message); } return(_list_ordertype); }