Beispiel #1
0
        public void TestWhereAmI()
        {
            Environment.EnvironmentContext where = Environment.Current.WhereAmI();
            Assert.IsTrue(where == Environment.EnvironmentContext.QA);

            Assert.AreEqual(Configuration.GlobalConfiguration.GlobalSettings.GetByEnviromnentModifers("MyKey"), "qa value");

            Assert.AreEqual(Data.DBConnection.GetConnectionString("DBConn"), "mydbstring");
        }
        public static Model.Error404 RecordError404(int AppID, Environment.EnvironmentContext Environment, string ClientID, string URL, string UserAgent, string Detail)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand("[dbo].[pr_Error404_Insert]");
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@AppID", SqlConvert.ToSql(AppID));
            cmd.Parameters.AddWithValue("@EnvironmentID", (int)Environment);
            if (!StringFunctions.IsNullOrWhiteSpace(ClientID))
            {
                cmd.Parameters.AddWithValue("@ClientID", SqlConvert.ToSql(ClientID));
            }
            cmd.Parameters.AddWithValue("@URL", SqlConvert.ToSql(URL));
            cmd.Parameters.AddWithValue("@UserAgent", SqlConvert.ToSql(UserAgent));
            cmd.Parameters.AddWithValue("@Detail", SqlConvert.ToSql(Detail));

            return(GetError404Model(SqlHelper.ExecuteDataset(cmd, null, ConnectionStringName).Tables[0].Rows[0]));
        }