public static T_Payment_t GetT_Payment_tByID(int id) { T_Payment_t t_Payment_t = new T_Payment_t(); SqlT_Payment_tProvider sqlT_Payment_tProvider = new SqlT_Payment_tProvider(); t_Payment_t = sqlT_Payment_tProvider.GetT_Payment_tByID(id); return t_Payment_t; }
public T_Payment_t GetT_Payment_tFromReader(IDataReader reader) { try { T_Payment_t t_Payment_t = new T_Payment_t ( (int)reader["T_Payment_tID"], reader["ID"].ToString(), reader["Date"].ToString(), reader["Amount"].ToString() ); return t_Payment_t; } catch(Exception ex) { return null; } }
public static bool UpdateT_Payment_t(T_Payment_t t_Payment_t) { SqlT_Payment_tProvider sqlT_Payment_tProvider = new SqlT_Payment_tProvider(); return sqlT_Payment_tProvider.UpdateT_Payment_t(t_Payment_t); }
public static int InsertT_Payment_t(T_Payment_t t_Payment_t) { SqlT_Payment_tProvider sqlT_Payment_tProvider = new SqlT_Payment_tProvider(); return sqlT_Payment_tProvider.InsertT_Payment_t(t_Payment_t); }
public bool UpdateT_Payment_t(T_Payment_t t_Payment_t) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("CUC_db_UpdateT_Payment_t", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@T_Payment_tID", SqlDbType.Int).Value = t_Payment_t.T_Payment_tID; cmd.Parameters.Add("@ID", SqlDbType.NVarChar).Value = t_Payment_t.ID; cmd.Parameters.Add("@Date", SqlDbType.NVarChar).Value = t_Payment_t.Date; cmd.Parameters.Add("@Amount", SqlDbType.NVarChar).Value = t_Payment_t.Amount; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }