コード例 #1
0
        public static void DeleteScript(int scriptId)
        {
            var dbc = new SqlDbClient(ConnString);

            dbc.GetNonQuery(cmd =>
            {
                cmd.CommandText = "sp_deleteScript";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@scriptId", scriptId));
            });
        }
コード例 #2
0
        public static void UpdateScript(int id, Script s)
        {
            var dbc = new SqlDbClient(ConnString);

            dbc.GetNonQuery(cmd =>
            {
                cmd.CommandText = "sp_updateScript";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@scriptId", id));
                cmd.Parameters.Add(new SqlParameter("@name", s.Name));
                cmd.Parameters.Add(new SqlParameter("@description", s.Description));
                cmd.Parameters.Add(new SqlParameter("@searchPattern", s.SearchPattern));
                cmd.Parameters.Add(new SqlParameter("@replacePattern", s.ReplacePattern));
            });
        }