public SiteSettingsViewModel(SiteSettings settings) { if (settings == null) { PhoneNumber = "+2 95 01 88 821"; SiteName = "Lean Commerce"; Email = "*****@*****.**"; FacebookURL = "#"; TwitterURL = "#"; LinkedInURL = "#"; DribbbleURL = "#"; GooglePlusURL = "#"; } else { PhoneNumber = settings.PhoneNumber; SiteName = settings.SiteName; Email = settings.Email; FacebookURL = settings.FacebookURL; TwitterURL = settings.TwitterURL; LinkedInURL = settings.LinkedInURL; DribbbleURL = settings.DribbbleURL; GooglePlusURL = settings.GooglePlusURL; } }
public void InsertUpdateSite(SiteSettings site) { if (site.Id == null) { var filter = Builders<SiteSettings>.Filter.Eq(s => s.Id, site.Id); var result = SiteSettings.ReplaceOneAsync(filter, site).Result; } else { SiteSettings.InsertOneAsync(site); } }
public void CopyToSiteSettings(SiteSettings settings) { settings.SiteName = SiteName; settings.PhoneNumber = PhoneNumber; settings.Email = Email; settings.FacebookURL = FacebookURL; settings.TwitterURL = TwitterURL; settings.LinkedInURL = LinkedInURL; settings.DribbbleURL = DribbbleURL; settings.GooglePlusURL = GooglePlusURL; }
public SiteSettingsViewModel(SiteSettings settings) { SiteName = settings.SiteName; PhoneNumber = settings.PhoneNumber; Email = settings.Email; FacebookURL = settings.FacebookURL; TwitterURL = settings.TwitterURL; LinkedInURL = settings.LinkedInURL; DribbbleURL = settings.DribbbleURL; GooglePlusURL = settings.GooglePlusURL; }