public ChargeWindow(string no, PatientWindow _PaW)
 {
     InitializeComponent();
     pno = no;
     PaW = _PaW;
     textprint();
 }
        private void ConfirmButton_Click(object sender, RoutedEventArgs e)
        {
            // string sql;
            sql = "SELECT ISNULL((SELECT TOP(1) 1 FROM Patient WHERE Pno=" + Pno.Text + "), 0)";
            try
            {
                ds = con.Getds(sql);
            }
            catch
            {
                MessageBox.Show("请输入正确的账号");
            }

            if (ds.Tables[0].Rows[0][0].Equals(0))
            {
                MessageBox.Show("账户不存在!", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                PatientWindow paW = new PatientWindow(Pno.Text, this);
                paW.Show();
                this.Hide();
            }
            Pno.Text = "";
        }
 public RegisterWindow(string no, PatientWindow _PaW)
 {
     InitializeComponent();
     pno = no;
     PaW = _PaW;
     SetRegisterGrid();
     sql  = "select Deptno as 科室编号,Deptname as 科室名称,Dnum as 医生数量 from Dept";
     ds   = con.Getds(sql);
     dept = ds.Tables[0];
     DeptGrid.ItemsSource = dept.DefaultView;
 }