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); }
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); } }
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); } }
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); } }
public static bool UpdateSPR_DATA(SPR_DATA sPR_DATA) { SqlSPR_DATAProvider sqlSPR_DATAProvider = new SqlSPR_DATAProvider(); return(sqlSPR_DATAProvider.UpdateSPR_DATA(sPR_DATA)); }
public static int InsertSPR_DATA(SPR_DATA sPR_DATA) { SqlSPR_DATAProvider sqlSPR_DATAProvider = new SqlSPR_DATAProvider(); return(sqlSPR_DATAProvider.InsertSPR_DATA(sPR_DATA)); }