Пример #1
0
    public static Web_EventType GetWeb_EventTypeByID(int id)
    {
        Web_EventType            web_EventType            = new Web_EventType();
        SqlWeb_EventTypeProvider sqlWeb_EventTypeProvider = new SqlWeb_EventTypeProvider();

        web_EventType = sqlWeb_EventTypeProvider.GetWeb_EventTypeByID(id);
        return(web_EventType);
    }
Пример #2
0
    public int InsertWeb_EventType(Web_EventType web_EventType)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("IEB_InsertWeb_EventType", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Web_EventTypeID", SqlDbType.Int).Direction    = ParameterDirection.Output;
            cmd.Parameters.Add("@Web_EventTypeName", SqlDbType.NVarChar).Value = web_EventType.Web_EventTypeName;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return((int)cmd.Parameters["@Web_EventTypeID"].Value);
        }
    }
Пример #3
0
    public bool UpdateWeb_EventType(Web_EventType web_EventType)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("IEB_UpdateWeb_EventType", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Web_EventTypeID", SqlDbType.Int).Value        = web_EventType.Web_EventTypeID;
            cmd.Parameters.Add("@Web_EventTypeName", SqlDbType.NVarChar).Value = web_EventType.Web_EventTypeName;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return(result == 1);
        }
    }
Пример #4
0
 public Web_EventType GetWeb_EventTypeFromReader(IDataReader reader)
 {
     try
     {
         Web_EventType web_EventType = new Web_EventType
                                       (
             (int)reader["Web_EventTypeID"],
             reader["Web_EventTypeName"].ToString()
                                       );
         return(web_EventType);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Пример #5
0
    public static bool UpdateWeb_EventType(Web_EventType web_EventType)
    {
        SqlWeb_EventTypeProvider sqlWeb_EventTypeProvider = new SqlWeb_EventTypeProvider();

        return(sqlWeb_EventTypeProvider.UpdateWeb_EventType(web_EventType));
    }
Пример #6
0
    public static int InsertWeb_EventType(Web_EventType web_EventType)
    {
        SqlWeb_EventTypeProvider sqlWeb_EventTypeProvider = new SqlWeb_EventTypeProvider();

        return(sqlWeb_EventTypeProvider.InsertWeb_EventType(web_EventType));
    }