乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      用友NC單據(jù)UI基本代碼示例

       鷹皇軟件 2013-05-16

      用友NC單據(jù)UI基本代碼示例

      分類: ERP開發(fā) 158人閱讀 評(píng)論(0) 收藏 舉報(bào)

      本示例在用友NC57環(huán)境下調(diào)試通過

      最近在做基于NC的二次開發(fā),這種封閉的系統(tǒng)文檔很少,一個(gè)簡單的例子都不能找到幫助。

      本示例的目的是為了讓后來者少走我走過的彎路

      1. package nc.ui.ic.generaltc;  
      2.   
      3. import nc.ui.pub.ButtonObject;  
      4. import nc.ui.pub.ClientEnvironment;  
      5. import nc.ui.pub.ToftPanel;  
      6. import nc.ui.pub.beans.UIPanel;  
      7. import nc.ui.pub.bill.BillCardPanel;  
      8. import nc.ui.pub.bill.BillEditEvent;  
      9. import nc.ui.pub.bill.BillEditListener;  
      10. import nc.ui.pub.bill.BillItem;  
      11. import nc.ui.pub.bill.BillListPanel;  
      12. import nc.ui.scm.pub.query.SCMQueryConditionDlg;  
      13. import javax.swing.JComboBox;  
      14. import javax.swing.JLabel;  
      15. import javax.swing.JTextField;  
      16. import java.awt.Dimension;  
      17.   
      18. /** 
      19.  * NC5.7單據(jù)基礎(chǔ)示例 
      20.  * @ClassName: ClientUI 
      21.  * @Description: TODO 
      22.  * @author s 
      23.  * @date 2013-4-9 下午2:22:21 
      24.  * BillEditListener  是按鈕監(jiān)聽類 
      25.  * 實(shí)現(xiàn)BillEditListener,需實(shí)現(xiàn)bodyRowChange()、afterEdit()兩個(gè)方法 
      26.  */  
      27. public class ClientUI extends ToftPanel implements BillEditListener {  
      28.   
      29.     // 單據(jù)類型  
      30.     private BillCardPanel cpBill = null;  
      31.       
      32.     // 客戶端環(huán)境變量類  
      33.     private ClientEnvironment ce = getClientEnvironment();  
      34.       
      35.     // 按鈕查詢,增加,修改,刪除,保存,取消,打印,審核,棄審,關(guān)閉,打開.  
      36.     protected ButtonObject bnQuery = new ButtonObject("查詢""查詢"1"查詢");  
      37.     protected ButtonObject bnAdd = new ButtonObject("增加""增加"2"增加");  
      38.     protected ButtonObject bnModify = new ButtonObject("修改""修改"3"修改");  
      39.     protected ButtonObject bnDelete = new ButtonObject("刪除""刪除"4"刪除");  
      40.     protected ButtonObject bnSave = new ButtonObject("保存""保存"5"保存");  
      41.     protected ButtonObject bnCancel = new ButtonObject("取消""取消"6"取消");  
      42.     protected ButtonObject bnPrint = new ButtonObject("打印""打印"7"打印");  
      43.     protected ButtonObject bnAudit = new ButtonObject("審核""審核"9"審核");  
      44.     protected ButtonObject bnUnAudit = new ButtonObject("棄審""棄審"10"棄審");  
      45.     protected ButtonObject bnClose = new ButtonObject("關(guān)閉""關(guān)閉"11"關(guān)閉");  
      46.     protected ButtonObject bnOpen = new ButtonObject("打開""打開"12"打開");  
      47.       
      48.     protected ButtonObject[] bgMain = { bnQuery, bnAdd, bnModify, bnDelete,  
      49.             bnSave, bnCancel, bnPrint, bnAudit, bnUnAudit, bnClose, bnOpen };  
      50.       
      51.     // 狀態(tài) 有下列五種狀態(tài)  
      52.     private int iStatus = 0;  
      53.     private int INIT = 0;  
      54.     private int NEW = 1;  
      55.     private int UPDATED = 2;  
      56.     private int DELETED = 3;  
      57.     private int SAVED = 4;  
      58.       
      59.     private nc.vo.scm.pub.session.ClientLink m_cl=null;  
      60.     protected UIPanel conditionpanel = null;  
      61.   
      62.     public ClientUI() {  
      63.         super();  
      64.         initialize();  
      65.     }  
      66.   
      67.     /** 
      68.      * 選中行觸發(fā)該方法 
      69.      */  
      70.     public void bodyRowChange(BillEditEvent arg0) {  
      71.         // TODO Auto-generated method stub  
      72.         // int isChangeRow = arg0.getRow();  
      73.     }  
      74.   
      75.     public void afterEdit(BillEditEvent arg0) {  
      76.     }  
      77.   
      78.     /** 
      79.      * 界面初始化。 
      80.      * @Title: initialize 
      81.      * @Description: TODO 
      82.      * @return void 
      83.      * @throws 
      84.      * 創(chuàng)建者:s 
      85.      * 創(chuàng)建日期:2013-4-10 
      86.      */  
      87.     private void initialize() {  
      88.         try {  
      89.             setName("TcUI");  
      90.             m_cl = new nc.vo.scm.pub.session.ClientLink(ClientEnvironment.getInstance());  
      91.             //INIT,NEW,UPDATED,DELETED,SAVED;  
      92.             iStatus = INIT;  
      93.             setBnStatus(iStatus);  
      94.             //bnOpen.setHint("測試?。。。?!");  
      95.             // 加載按鈕  
      96.             setButtons(bgMain);  
      97.             add(getBillCardPanel());  
      98.             // onQuery();  
      99.         } catch (Exception e) {  
      100.              nc.vo.scm.pub.SCMEnv.out(e.getMessage());  
      101.              JLabel msg = new JLabel(e.getMessage());  
      102.              msg.setHorizontalAlignment(JLabel.CENTER);  
      103.              add(msg);  
      104.         }  
      105.     }  
      106.   
      107.     /** 
      108.      * 設(shè)置單據(jù)窗體 
      109.      * @Title: getBillCardPanel 
      110.      * @Description: TODO 
      111.      * @return BillCardPanel 
      112.      * @throws 
      113.      * 創(chuàng)建者:s 
      114.      * 創(chuàng)建日期:2013-4-10 
      115.      */  
      116.     private BillCardPanel getBillCardPanel() {  
      117.         if (cpBill == null) {  
      118.             try {  
      119.                 cpBill = new BillCardPanel();  
      120.                 /* 
      121.                  * 單據(jù)模板有兩種常用加載方式 
      122.                  * 第一種是根據(jù)“單據(jù)模板編號(hào)”來加載 
      123.                  * 單據(jù)模板編號(hào)是模板在標(biāo)準(zhǔn)產(chǎn)品庫中所保存的模板編號(hào),在pub_billtemplet(單據(jù)模板主表)中的pk_billtemplet字段 
      124.                  * 可根據(jù)nodecode條件去pub_billtemplet表中查詢 
      125.                  * 可用語句select pk_billtemplet from pub_billtemplet where nodecode='40081001'來查詢 
      126.                  * nodecode是在“功能注冊(cè)”時(shí)定義的節(jié)點(diǎn)“功能編碼”,或稱“節(jié)點(diǎn)編號(hào)”,見圖1(單據(jù)類型管理) 
      127.                  */  
      128.                 //cpBill.loadTemplet("0001AA1000000004OJWO");  
      129.                 /* 
      130.                  * 第二種方式是使用cpBill.loadTemplet(strBillType, strBusiType, strOperator, strCorp)方法加載 
      131.                  * strBillType是單據(jù)模板在標(biāo)準(zhǔn)產(chǎn)品庫中所保存的模板類型,在pub_billtemplet(單據(jù)模板主表)中的pk_billtypecode字段 
      132.                  * 可根據(jù)nodecode條件去pub_billtemplet表中查詢 
      133.                  * 可用語句select pk_billtypecode from pub_billtemplet where nodecode='40081001'來查詢 
      134.                  * strBusiType是業(yè)務(wù)類型,可設(shè)為null 
      135.                  * strOperator是操作者,使用ClientEnvironment.getUser().getPrimaryKey()取得環(huán)境用戶參數(shù) 
      136.                  * strCorp是公司參數(shù),使用ClientEnvironment.getCorporation().getPk_corp()取得環(huán)境公司參數(shù) 
      137.                  */  
      138.                 cpBill.loadTemplet("40081001"null, ce.getUser().getPrimaryKey(), ce.getCorporation().getPk_corp());  
      139.                 //設(shè)置單據(jù)體表體菜單是否顯示  
      140.                 cpBill.setBodyMenuShow(false);  
      141.                 //添加監(jiān)聽  
      142.                 cpBill.addEditListener(this);  
      143.   
      144.             } catch (java.lang.Throwable ivjExc) {  
      145.             }  
      146.         }  
      147.         return cpBill;  
      148.     }  
      149.     /** 
      150.      *  
      151.      * @Title: getConditionPanel 
      152.      * @Description: TODO 
      153.      * @return UIPanel 
      154.      * @throws 
      155.      * 創(chuàng)建者:s 
      156.      * 創(chuàng)建日期:2013-4-9 
      157.      */  
      158.     protected UIPanel getConditionPanel() {  
      159.         if (conditionpanel == null) {  
      160.             conditionpanel = new UIPanel();  
      161.             conditionpanel.setName("UIPanel");  
      162.             conditionpanel.setLayout(new java.awt.GridLayout(2601));  
      163.             conditionpanel.setMaximumSize(new Dimension(55040));  
      164.             conditionpanel.setPreferredSize(new Dimension(55040));  
      165.             conditionpanel.setMinimumSize(new Dimension(5501));  
      166.         }  
      167.         return conditionpanel;  
      168.     }  
      169.       
      170.     @Override  
      171.     public String getTitle() {  
      172.         // TODO Auto-generated method stub  
      173.         return null;  
      174.     }  
      175.   
      176.     @Override  
      177.     public void onButtonClicked(ButtonObject arg0) {  
      178.         // TODO Auto-generated method stub  
      179.           
      180.     }  
      181.       
      182.     /** 
      183.      * 設(shè)置按鈕狀態(tài)。 
      184.      * @Title: setBnStatus 
      185.      * @Description: TODO 
      186.      * @param status 
      187.      * @return void 
      188.      * @throws 
      189.      * 創(chuàng)建者:s 
      190.      * 創(chuàng)建日期:2013-4-10 
      191.      */  
      192.     public void setBnStatus(int status) {  
      193.         //初始、刪除、保存狀態(tài)  
      194.         if (status == INIT || status == DELETED || status == SAVED) {  
      195.             bnQuery.setEnabled(true);  
      196.             bnAdd.setEnabled(true);  
      197.             bnModify.setEnabled(true);  
      198.             bnSave.setEnabled(false);  
      199.             bnCancel.setEnabled(false);  
      200.             bnDelete.setEnabled(true);  
      201.             //  bnModify.setEnabled(false);  
      202.         }  
      203.         //增加、修改狀態(tài)  
      204.         else if (status == NEW || status == UPDATED) {  
      205.             bnQuery.setEnabled(false);  
      206.             bnAdd.setEnabled(false);  
      207.             bnSave.setEnabled(true);  
      208.             bnCancel.setEnabled(true);  
      209.             bnDelete.setEnabled(false);  
      210.             bnModify.setEnabled(false);  
      211.         }  
      212.             //bnPrint.setEnabled(false);  
      213.         updateButtons();  
      214.     }  
      215. }  

      圖1:單據(jù)類型管理界面

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約