예제 #1
0
    public static IMGAE GetIMGAEByID(int id)
    {
        IMGAE            iMGAE            = new IMGAE();
        SqlIMGAEProvider sqlIMGAEProvider = new SqlIMGAEProvider();

        iMGAE = sqlIMGAEProvider.GetIMGAEByID(id);
        return(iMGAE);
    }
예제 #2
0
    public int InsertIMGAE(IMGAE iMGAE)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("AbiMatuEnterprise_InsertIMGAE", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@IMGAEID", SqlDbType.Int).Direction = ParameterDirection.Output;
            cmd.Parameters.Add("@IMG", SqlDbType.Image).Value       = iMGAE.IMG;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return((int)cmd.Parameters["@IMGAEID"].Value);
        }
    }
예제 #3
0
    public bool UpdateIMGAE(IMGAE iMGAE)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("AbiMatuEnterprise_UpdateIMGAE", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@IMGAEID", SqlDbType.Int).Value = iMGAE.IMGAEID;
            cmd.Parameters.Add("@IMG", SqlDbType.Image).Value   = iMGAE.IMG;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return(result == 1);
        }
    }
예제 #4
0
 public IMGAE GetIMGAEFromReader(IDataReader reader)
 {
     try
     {
         IMGAE iMGAE = new IMGAE
                       (
             (int)reader["IMGAEID"],
             reader["IMG"].ToString()
                       );
         return(iMGAE);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
예제 #5
0
    public static bool UpdateIMGAE(IMGAE iMGAE)
    {
        SqlIMGAEProvider sqlIMGAEProvider = new SqlIMGAEProvider();

        return(sqlIMGAEProvider.UpdateIMGAE(iMGAE));
    }
예제 #6
0
    public static int InsertIMGAE(IMGAE iMGAE)
    {
        SqlIMGAEProvider sqlIMGAEProvider = new SqlIMGAEProvider();

        return(sqlIMGAEProvider.InsertIMGAE(iMGAE));
    }