public static string GetConnectionString(string customerID) { var trexBaseEntities = new TrexBaseEntities(); var customer = trexBaseEntities.TrexCustomers.SingleOrDefault(c => c.CustomerId == customerID); return(customer.ConnectionString); }
public bool ValidateUserWithCustomerId(string userName, string password, string customerId) { try { Membership.ApplicationName = customerId; var customerEntities = new TrexBaseEntities(); var customer = customerEntities.TrexCustomers.SingleOrDefault(c => c.CustomerId.ToLower() == customerId.ToLower()); if (customer == null) { return(false); } if (!customer.IsActivated) { return(false); } return(Membership.ValidateUser(userName, password)); } catch (Exception ex) { LogError(ex); throw; } }
public static string GetConnectionString(string customerID) { var trexBaseEntities = new TrexBaseEntities(); var customer = trexBaseEntities.TrexCustomers.SingleOrDefault(c => c.CustomerId == customerID); var preString = ConfigurationManager.AppSettings["defaultEFConnectionString"]; var tmp = string.Format(preString, customer.ConnectionString); return(tmp); }