Beispiel #1
0
 //删除
 private void Button8_Click(object sender, RoutedEventArgs e)
 {
     if (listView2.SelectedItems.Count > 0)
     {
         var p = new Tip2("确定要删除?", this);
         p.ShowDialog();
         if (this.Tag + "" == "OK")
         {
             string   s  = listView2.Items[listView2.SelectedIndex].ToString();
             string[] ss = s.Split(',');
             new IdCard_BLL().p_zhuyuanxiaofei_delete(int.Parse(txtId.Text), ss[0].Substring(4).Replace("=", "").Trim());
             listView2.Items.RemoveAt(listView2.SelectedIndex);
             this.Tag = "";
         }
     }
 }
        //门诊结账按钮
        private void btnCheckout_Click(object sender, RoutedEventArgs e)
        {
            if (txtRid.Text == "")
            {
                Tip pf = new Tip("没有要结账病人信息!");
                pf.ShowDialog();
                return;
            }
            if (textBox6.Text == "")
            {
                Tip pm = new Tip("付款金额不足!");
                pm.ShowDialog();
                return;
            }
            if (int.Parse(textBox6.Text) < 0)
            {
                Tip pm = new Tip("付款金额不足!");
                pm.ShowDialog();
                return;
            }
            Tip2 p = new Tip2("确定结账?", this);

            p.ShowDialog();
            if (this.Tag.ToString() == "OK")
            {
                new IdCard_BLL().p_kaiyao_update(txtRid.Text);
                Tip pp = new Tip("结账成功!请到药房取药!");
                pp.ShowDialog();

                zhuayuantongji zhu = new zhuayuantongji();
                zhu.Kid    = (txtRid.Text);
                zhu.Sname  = cboroom.Text;
                zhu.time   = DateTime.Now + "";
                zhu.ymoney = int.Parse(textBox4.Text);
                zhu.zmoney = 0;
                new IdCard_BLL().p_zhuayuantongji_select(zhu);
                Init_Load();

                List <Control> con_list = new List <Control>
                {
                    txtRid,
                    txtdoct,
                    txtname,
                    txtidno,
                    textBox4,
                    textBox5,
                    textBox6,
                    cboroom,
                    cbosex
                };

                foreach (Control item in con_list)
                {
                    if (item is TextBox)
                    {
                        ((TextBox)item).Text = "";
                    }
                    if (item is ComboBox)
                    {
                        ((ComboBox)item).Text = "";
                    }
                }
                listView2.Items.Clear();
            }
        }