private void Button_Click(object sender, RoutedEventArgs e)
        {
            double paid_amount = Convert.ToDouble(paid);
            double charge      = Convert.ToDouble(charge_amount);
            double change      = paid_amount - charge;

            if (change >= 0)
            {
                queryBtn.IsEnabled = true;
                MessageBoxResult result = MessageBox.Show("就诊卡号:" + cardId + "\r\n金额:" + charge_amount, "确认充值", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (result == MessageBoxResult.Yes)
                {
                    double blance_after = blance_now + Convert.ToDouble(charge_amount);
                    Query  query        = new Query();
                    query.Update_bal(cardId, blance_after);
                    query_btn_Click(sender, e);
                    patient pa    = DtTransaction.Dt2patient(query.Query_by_patient_id(cardId));
                    string  path  = Print2word.patient2word(Convert.ToDouble(charge_amount), pa.Name, (string)Application.Current.Properties["userName"]);
                    Print   print = new Print(path);
                    print.Show();
                    queryBtn.IsEnabled = false;
                }
                else
                {
                    queryBtn.IsEnabled = true;
                }
            }
            else
            {
                queryBtn.IsEnabled = false;
                change_texbox.Text = change.ToString("0.00");
            }
        }
Esempio n. 2
0
        private void read_Button_Click_1(object sender, RoutedEventArgs e)
        {
            string  ID  = cardNo.Text.Trim();
            patient tmp = new patient
            {
                ID1 = ID
            };
            Query     query  = new Query();
            DataTable dt     = query.Query_by_patient_id(ID);
            patient   result = DtTransaction.Dt2patient(dt);

            patient_fin = result;
            if (result.Name == null)
            {
                MessageBox.Show("无法找到该病人", "提示");
                name.Text           = "";
                gender.Text         = "";
                balance.Text        = "";
                age.Text            = "";
                start_date.Text     = "";
                query_btn.IsEnabled = false;
            }

            else
            {
                name.Text              = result.Name;
                gender.Text            = result.Gender;
                balance.Text           = result.Price.ToString();
                age.Text               = (DateTime.Now.Year - result.Birthday.Year).ToString();
                start_date.Text        = result.Setup_date.ToString();
                start_date.DisplayDate = result.Setup_date;
                query_btn.IsEnabled    = true;
            }
        }
        private void query_btn_Click(object sender, RoutedEventArgs e)
        {
            cardId = cardNo.Text.Trim();
            Query   query = new Query();
            patient pa    = DtTransaction.Dt2patient(query.Query_by_patient_id(cardId));

            if (pa.Name == null)
            {
                MessageBox.Show("无法找到该病人", "提示");
            }
            balancebox.Text = pa.Price.ToString();
            blance_now      = pa.Price;
        }