예제 #1
0
    public static SPR_DATA GetSPR_DATAByID(int id)
    {
        SPR_DATA            sPR_DATA            = new SPR_DATA();
        SqlSPR_DATAProvider sqlSPR_DATAProvider = new SqlSPR_DATAProvider();

        sPR_DATA = sqlSPR_DATAProvider.GetSPR_DATAByID(id);
        return(sPR_DATA);
    }
예제 #2
0
    public int InsertSPR_DATA(SPR_DATA sPR_DATA)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("AbiMatuEnterprise_InsertSPR_DATA", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@SPR_DATAID", SqlDbType.Int).Direction = ParameterDirection.Output;
            cmd.Parameters.Add("@STYPE", SqlDbType.VarChar).Value      = sPR_DATA.STYPE;
            cmd.Parameters.Add("@MRC", SqlDbType.VarChar).Value        = sPR_DATA.MRC;
            cmd.Parameters.Add("@DCOMM", SqlDbType.Int).Value          = sPR_DATA.DCOMM;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return((int)cmd.Parameters["@SPR_DATAID"].Value);
        }
    }
예제 #3
0
    public bool UpdateSPR_DATA(SPR_DATA sPR_DATA)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("AbiMatuEnterprise_UpdateSPR_DATA", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@SPR_DATAID", SqlDbType.Int).Value = sPR_DATA.SPR_DATAID;
            cmd.Parameters.Add("@STYPE", SqlDbType.VarChar).Value  = sPR_DATA.STYPE;
            cmd.Parameters.Add("@MRC", SqlDbType.VarChar).Value    = sPR_DATA.MRC;
            cmd.Parameters.Add("@DCOMM", SqlDbType.Int).Value      = sPR_DATA.DCOMM;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return(result == 1);
        }
    }
예제 #4
0
 public SPR_DATA GetSPR_DATAFromReader(IDataReader reader)
 {
     try
     {
         SPR_DATA sPR_DATA = new SPR_DATA
                             (
             (int)reader["SPR_DATAID"],
             reader["STYPE"].ToString(),
             reader["MRC"].ToString(),
             (int)reader["DCOMM"]
                             );
         return(sPR_DATA);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
예제 #5
0
    public static bool UpdateSPR_DATA(SPR_DATA sPR_DATA)
    {
        SqlSPR_DATAProvider sqlSPR_DATAProvider = new SqlSPR_DATAProvider();

        return(sqlSPR_DATAProvider.UpdateSPR_DATA(sPR_DATA));
    }
예제 #6
0
    public static int InsertSPR_DATA(SPR_DATA sPR_DATA)
    {
        SqlSPR_DATAProvider sqlSPR_DATAProvider = new SqlSPR_DATAProvider();

        return(sqlSPR_DATAProvider.InsertSPR_DATA(sPR_DATA));
    }