⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sellcorp.java

📁 java版虚拟社区,在mysql上运行.
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
   	private void Payback()
   	{
   		try{
   			mm.SetType("Payback");
   			mm.SetNum(2);
   			mm.SetMes(id, 0);
   			mm.SetMes(""+bankrecord_jTable.getValueAt(RowNumBank, 2), 1);
   			mes.SendMessage(mm);
   			mes.GetMessage(mm);
   			if("true".equals(mm.GetType()))
   			{
   				JOptionPane.showMessageDialog(null,"Payback success!");
   				bankrecord_jTable.setValueAt("payed",RowNumBank, 0);
   			}
   			else if("notenough".equals(mm.GetType()))
   			{
   				JOptionPane.showMessageDialog(null,"Banance not enough!");
   			}	
   			else
   			{
   				JOptionPane.showMessageDialog(null,"Error!");
   			}
   		}catch(Exception ie)
   		{
   			JOptionPane.showMessageDialog(null,"Network exception,please exit and log!");
   		}
   	}

       private void GetFinanceImfor()
       {
           try{
                   mm.SetType("SoftSellFinanceView");
                   mm.SetNum(1);
                   mm.SetMes(id,0);
                   mes.SendMessage(mm);
                   mes.GetMessage(mm);
                   if("true".equals(mm.GetType()))
                   {
                       AllAccountTextField.setText(mm.GetMes(0));
                       ProfitTextField.setText(mm.GetMes(1));
                       AllAccountTextField.setEditable(false);
                       ProfitTextField.setEditable(false);
                   }
                   else
                   {
                        JOptionPane.showMessageDialog(null,"Error!");
                   }

               }catch(Exception ie){
                   JOptionPane.showMessageDialog(null,"Network exception,please exit and log!");
               }

       }
       private void GetSellAllImfor()
       {
           try{
               mm.SetType("SoftSellAllView");
               mm.SetNum(1);
               mm.SetMes(id,0);
               mes.SendMessage(mm);
               mes.GetMessage(mm);
               if("true".equals(mm.GetType()))
               {
                   SellAlldatamode = new DefaultTableModel(null,SellAllColumnname)
                   {
                       public boolean isCellEditable(int row, int column) {
                           return false;
                       }

                   };
                   SellAllTable.setModel(SellAlldatamode);
                   SellAllTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

                   int n = mm.GetNum()/7;
                   for(int i = 0; i < n; i++)
                   {
                            SellAlldatamode.addRow(new Object[]{mm.GetMes(7*i),mm.GetMes(7*i+1),mm.GetMes(7*i+2),mm.GetMes(7*i+3),mm.GetMes(7*i+4),mm.GetMes(7*i+5),mm.GetMes(7*i+6)});
                   }


               }
               else if("false".equals(mm.GetType()))
               {
            	   JOptionPane.showMessageDialog(null,"No record!");
               }
               else
               {
                    JOptionPane.showMessageDialog(null,"Error!");
               }

               }catch(Exception ie){
                   JOptionPane.showMessageDialog(null,"Network exception,please exit and log!");
               }

       }

       public void GetFeedbackImfor()
       {
           try{
                   mm.SetType("SoftSellFeedbackView");
                   mm.SetNum(1);
                   mm.SetMes(id,0);
                   mes.SendMessage(mm);
                   mes.GetMessage(mm);
                   if("true".equals(mm.GetType()))
                   {
                       Feedbackdatamode = new DefaultTableModel(null,FeedbackColumnname)
                       {
                           public boolean isCellEditable(int row, int column) {
                               return false;
                           }

                       };
                       FeedbackTable.setModel(Feedbackdatamode);
                       FeedbackTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

                       int n = mm.GetNum()/5;
                       for(int i = 0; i < n; i++)
                       {
                    	   Feedbackdatamode.addRow(new Object[]{mm.GetMes(5*i),mm.GetMes(5*i+1),mm.GetMes(5*i+2),mm.GetMes(5*i+3),mm.GetMes(5*i+4)});
                       }


                   }
                   else if("false".equals(mm.GetType()))
                   {
                	   JOptionPane.showMessageDialog(null,"No record!");
                   }
                   else
                   {
                        JOptionPane.showMessageDialog(null,"Wrong!");
                   }

               }catch(Exception ie){
                   JOptionPane.showMessageDialog(null,"Network exception,please exit and log!");
               }

       }
       public void GetCustomerImfor()
       {
           try{
                   mm.SetType("SoftSellCustomerView");
                   mm.SetNum(1);
                   mm.SetMes(id,0);
                   mes.SendMessage(mm);
                   mes.GetMessage(mm);
                   if("true".equals(mm.GetType()))
                   {
                       Customerdatamode = new DefaultTableModel(null,CustomerColumnname)
                       {
                           public boolean isCellEditable(int row, int column) {
                               return false;
                           }

                       };
                       CustomerTable.setModel(Customerdatamode);
                       CustomerTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                       
                       int n = mm.GetNum()/5;
                       for(int i = 0; i < n; i++)
                       {
                                Customerdatamode.addRow(new Object[]{mm.GetMes(5*i),mm.GetMes(5*i+1),mm.GetMes(5*i+2),mm.GetMes(5*i+3),mm.GetMes(5*i+4)});
                       }


                   }
                   else if("false".equals(mm.GetType()))
                   {
                	   JOptionPane.showMessageDialog(null,"No record!");
                   }
                   else
                   {
                        JOptionPane.showMessageDialog(null,"Wrong!");
                   }

               }catch(Exception ie){
                   JOptionPane.showMessageDialog(null,"Network exception,please exit and log!");
               }

       }

    public void SellAllViewButton_actionPerformed(ActionEvent e) {
    	note_jLabel.setText("Here is all the software in your company.");
        bankPanel.setVisible(false);
        bankenterPanel.setVisible(false);
        regaccountPanel.setVisible(false);
        SellAllPanel.setVisible(true);
        FeedbackPanel.setVisible(false);
        CustomerPanel.setVisible(false);
        FinancePanel.setVisible(false);
        GetSellAllImfor();
        
    }

    public void FeedBackButton_actionPerformed(ActionEvent e) {
    	note_jLabel.setText("Here is all the feedback imformation from your customer.");
        bankPanel.setVisible(false);
        bankenterPanel.setVisible(false);
        regaccountPanel.setVisible(false);
        SellAllPanel.setVisible(false);
        FeedbackPanel.setVisible(true);
        CustomerPanel.setVisible(false);
        FinancePanel.setVisible(false);
        GetFeedbackImfor();
        

    }

    public void CustomerButton_actionPerformed(ActionEvent e) {
    	note_jLabel.setText("Here is all the software you have sold.");
        bankPanel.setVisible(false);
        bankenterPanel.setVisible(false);
        regaccountPanel.setVisible(false);
        SellAllPanel.setVisible(false);
        FeedbackPanel.setVisible(false);
        CustomerPanel.setVisible(true);
        FinancePanel.setVisible(false);
        GetCustomerImfor();

    }

    public void FinanceButton_actionPerformed(ActionEvent e) {
        bankPanel.setVisible(false);
        bankenterPanel.setVisible(false);
        regaccountPanel.setVisible(false);
        SellAllPanel.setVisible(false);
        FeedbackPanel.setVisible(false);
        CustomerPanel.setVisible(false);
        FinancePanel.setVisible(true);
        GetFinanceImfor();
        note_jLabel.setText("You are seeing customer imformation.");

    }
    
    public void balanceButton_actionPerformed(ActionEvent e)
    {
    	/////////////////////////////********************************
    	
    	try{
    		mm.SetType("SoftSellBalance");
        	mm.SetNum(1);
            mm.SetMes(id,0);
            mes.SendMessage(mm);
            mes.GetMessage(mm);
            if("true".equals(mm.GetType()))
            {
            	JOptionPane.showMessageDialog(null,"Balance success!");


            }
            else if("noaccount".equals(mm.GetType()))
            {
         	   JOptionPane.showMessageDialog(null,"You don't have an account in the bank!");
            }
            
            else if("notenough".equals(mm.GetType()))
            {
         	   JOptionPane.showMessageDialog(null,"Balance inadequate!");
            }
            else
            {
                 JOptionPane.showMessageDialog(null,"Error!");
            }

        }catch(Exception ie){
            JOptionPane.showMessageDialog(null,"Network exception,please exit and log!");
        }
    }
}


class SellCorp_FinanceButton_actionAdapter implements ActionListener {
    private SellCorp adaptee;
    SellCorp_FinanceButton_actionAdapter(SellCorp adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.FinanceButton_actionPerformed(e);
    }
}


class SellCorp_CustomerButton_actionAdapter implements ActionListener {
    private SellCorp adaptee;
    SellCorp_CustomerButton_actionAdapter(SellCorp adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.CustomerButton_actionPerformed(e);
    }
}


class SellCorp_FeedBackButton_actionAdapter implements ActionListener {
    private SellCorp adaptee;
    SellCorp_FeedBackButton_actionAdapter(SellCorp adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.FeedBackButton_actionPerformed(e);
    }
}


class SellCorp_SellAllViewButton_actionAdapter implements ActionListener {
    private SellCorp adaptee;
    SellCorp_SellAllViewButton_actionAdapter(SellCorp adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.SellAllViewButton_actionPerformed(e);
    }
}

class SellCorp_balanceButton_actionAdapter implements ActionListener {
    private SellCorp adaptee;
    SellCorp_balanceButton_actionAdapter(SellCorp adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.balanceButton_actionPerformed(e);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -