コード例 #1
0
        public static string GetConnectionString(string customerID)
        {
            var trexBaseEntities = new TrexBaseEntities();
            var customer         = trexBaseEntities.TrexCustomers.SingleOrDefault(c => c.CustomerId == customerID);

            return(customer.ConnectionString);
        }
コード例 #2
0
ファイル: Service.svc.cs プロジェクト: StefanAniff/hb.trex
        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;
            }
        }
コード例 #3
0
        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);
        }