コード例 #1
0
ファイル: Form1.cs プロジェクト: ryanyau/mobile
 private void button2_Click(object sender, EventArgs e)
 {
     Int64 num = Int64.Parse(textBox6.Text);
     MobileDao dao = new MobileDao();
     if (dao.checknumexists(num)) MessageBox.Show("此号码不存在", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     else
     {
         AccountDao accountDao = new AccountDao();
         Int32 customerId = accountDao.getCustomerId(num);
         CustomerDao customerDao = new CustomerDao();
         label9.Text = customerDao.getName(customerId);
         MobileDao mobileDao = new MobileDao();
         Mobile mobile = mobileDao.getMobile(num);
         label11.Text = num.ToString();
         if (mobile.Mobiletype.Equals("world")) label13.Text = "全球通";
         else if (mobile.Mobiletype.Equals("music")) label13.Text = "动感地带";
         else label13.Text = "神州行";
         label15.Text = mobile.Balance.ToString() + "元";
         label18.Text = mobile.LastTimePayFor.ToString();
     }
 }