KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > model > MNote


1 /******************************************************************************
2  * The contents of this file are subject to the Compiere License Version 1.1
3  * ("License"); You may not use this file except in compliance with the License
4  * You may obtain a copy of the License at http://www.compiere.org/license.html
5  * Software distributed under the License is distributed on an "AS IS" basis,
6  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
7  * the specific language governing rights and limitations under the License.
8  * The Original Code is Compiere ERP & CRM Smart Business Solution
9  * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
10  * Portions created by Jorg Janke are Copyright (C) 1999-2003 Jorg Janke, parts
11  * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
12  * Contributor(s): ______________________________________.
13  *****************************************************************************/

14 package org.compiere.model;
15
16 import java.util.*;
17 import org.compiere.util.*;
18
19
20 /**
21  * Note
22  *
23  * @author Jorg Janke
24  * @version $Id: MNote.java,v 1.3 2003/10/31 05:30:54 jjanke Exp $
25  */

26 public class MNote extends X_AD_Note
27 {
28     /**
29      * Standard Constructor
30      * @param ctx context
31      * @param AD_Note_ID id
32      */

33     public MNote (Properties ctx, int AD_Note_ID)
34     {
35         super(ctx, AD_Note_ID);
36     } // MNote
37

38     /**
39      * Create Note
40      * @param ctx context
41      * @param AD_User_ID user
42      * @param AD_Table_ID table
43      * @param Record_ID record
44      * @param AD_Message message
45      * @param Text text
46      * @param Reference reference
47      */

48     public MNote (Properties ctx, int AD_User_ID,
49         int AD_Table_ID, int Record_ID,
50         String JavaDoc AD_Message, String JavaDoc Reference, String JavaDoc Text)
51     {
52         super(ctx, 0);
53         setAD_User_ID(AD_User_ID);
54         setAD_Table_ID(AD_Table_ID);
55         setRecord_ID(Record_ID);
56         setAD_Message_ID(AD_Message);
57         //
58
setReference(Reference);
59         setText(Text);
60     } // MNote
61

62     /**
63      * Set Record.
64      * (Ss Button and defaults to String)
65      * @param AD_Message AD_Message
66      */

67     public void setAD_Message_ID (String JavaDoc AD_Message)
68     {
69         int AD_Message_ID = DB.getSQLValue("SELECT AD_Message_ID FROM AD_Message WHERE Value=?", AD_Message);
70         if (AD_Message_ID != -1)
71             setAD_Message_ID(AD_Message_ID);
72         else
73         {
74             setAD_Message_ID(240); // Error
75
log.error("setAD_Message_ID - ID not found for '" + AD_Message + "'");
76         }
77     } // setRecord_ID
78

79     /**
80      * String Representation
81      * @return info
82      */

83     public String JavaDoc toString()
84     {
85         StringBuffer JavaDoc sb = new StringBuffer JavaDoc ("MNote[")
86             .append(getID()).append(",AD_Message_ID=").append(getAD_Message_ID())
87             .append(",").append(getReference())
88             .append("]");
89         return sb.toString();
90     } // toString
91

92 } // MNote
93
Popular Tags