Example #1
0
        private void BtnSure_Click(object sender, RoutedEventArgs e)
        {
            List <Control> con_list = new List <Control>()
            {
                txtjinji,
                txtKId,
                txtmiaoshu,
                txtyujiaofei,
                cbobingchuang,
                cbobingfang,
                cboKebie
            };

            foreach (Control item in con_list)
            {
                if (item is TextBox)
                {
                    if (((TextBox)item).Text == "")
                    {
                        var t = new Tip("请把信息填完整!");
                        t.ShowDialog();
                        return;
                    }
                }
                else
                {
                    if (((ComboBox)item).Text == "")
                    {
                        var t = new Tip("请把信息填完整!");
                        t.ShowDialog();
                        return;
                    }
                }
            }
            zhuyuan zhu = new zhuyuan
            {
                kId        = int.Parse(txtKId.Text),
                Idsickroom = int.Parse(cbobingfang.Text),
                Sid        = cboKebie.SelectedIndex,
                BedNo      = cbobingchuang.Text,
                Imprest    = int.Parse(txtyujiaofei.Text),
                Bewrite    = txtmiaoshu.Text,
                Tabu       = txtjinji.Text,
                Ztime      = DateTime.Now + ""
            };
            string str = new IdCard_BLL().p_zhuyuan_insert(zhu);
            var    p   = new Tip(str);

            p.ShowDialog();
        }
Example #2
0
 private void Button4_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         int i = int.Parse(txtyujiao.Text) + int.Parse(txtyujiao2.Text);
         new IdCard_BLL().update_zhuyuan_yujiao(i, txtId2.Text);
         var p = new Tip("交款成功!");
         p.ShowDialog();
     }
     catch
     {
         var p = new Tip("请输入正确金额!");
         p.ShowDialog();
     }
 }
 //快捷菜单栏点击
 private void MenuDel_Click(object sender, RoutedEventArgs e)
 {
     if (listView1.SelectedItems.Count > 0)
     {
         string str = listView1.SelectedItems[0].ToString();
         new IdCard_BLL().p_usesType_delete(str);
         Tip t1 = new Tip("删除成功!");
         t1.ShowDialog();
     }
     else
     {
         Tip t2 = new Tip("没有选中要删除的数据");
         t2.ShowDialog();
     }
 }
Example #4
0
        //添加
        private void Button5_Click(object sender, RoutedEventArgs e)
        {
            if (textBox15.Text == "0")
            {
                var pm = new Tip("增加的数量不能为0!");
                pm.ShowDialog();
                return;
            }
            if (listView2.IsVisible == true)
            {
                if (listView2.SelectedItems.Count > 0)
                {
                    int      i  = listView2.SelectedIndex;
                    string   s  = listView2.Items[i].ToString();
                    string[] ss = s.Split(',');
                    textBox15.Text = int.Parse(ss[3].Substring(3).Replace("=", "").Trim()) + int.Parse(textBox15.Text) + "";
                    Button9_Click(null, null);

                    var p = new Tip("添加成功!");
                    p.ShowDialog();
                    textBox15.Text = "0";
                    return;
                }
            }
            foreach (ListViewItem item in listView2.Items)
            {
                string   s  = listView2.Items[listView2.SelectedIndex].ToString();
                string[] ss = s.Split(',');
                if (ss[0].Substring(4).Replace("=", "").Trim() == textBox11.Text)
                {
                    textBox15.Text       = int.Parse(ss[3].Substring(3).Replace("=", "").Trim()) + int.Parse(textBox15.Text) + "";
                    listView2.Visibility = Visibility.Visible;
                    txtyaopin.IsEnabled  = false;
                    btninsert.Content    = "新单";
                    num            = 0;
                    textBox15.Text = "0";
                    Button9_Click(null, null);

                    var p = new Tip("添加成功!");
                    p.ShowDialog();
                    textBox15.Text = "0";
                    return;
                }
            }
            var pp = new Tip("没有添加信息!");

            pp.ShowDialog();
        }
Example #5
0
        //西药删除
        private void Button4_Click(object sender, RoutedEventArgs e)
        {
            if (lvwYaofang2.SelectedItems.Count == 0)
            {
                var p = new Tip("请选中要删除的药品 !");
                p.ShowDialog();
                return;
            }
            string str = lvwYaofang2.Items[lvwYaofang2.SelectedIndex].ToString();

            string[] ss       = str.Split(',');
            string   s        = ss[1].Substring(3).Replace("=", "").Trim();
            int      deleteNo = int.Parse(s);

            lvwYaofang2.Items.RemoveAt(deleteNo - 1);
            ww();
        }
 //支付金额输入框改变
 private void textBox5_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (textBox5.Text == "")
         {
             textBox6.Text = "";
             return;
         }
         textBox6.Text = int.Parse(textBox5.Text) - int.Parse(textBox4.Text) + "";
     }
     catch
     {
         Tip t = new Tip("请正确输入金钱!");
         t.ShowDialog();
     }
 }
Example #7
0
 private void Button3_Click(object sender, RoutedEventArgs e)
 {
     if (txtDinsertPrice.Text == "")
     {
         var p = new Tip("请输入价钱!");
         p.ShowDialog();
         return;
     }
     lvwShow.Items.Clear();
     try
     {
         if (dd.Where(p => p.DinsertPrice == int.Parse(txtDinsertPrice.Text)).Count() == 0)
         {
             var p = new Tip("没有数据!");
             p.ShowDialog();
             return;
         }
         foreach (var d in dd.Where(p => p.DinsertPrice == int.Parse(txtDinsertPrice.Text)))
         {
             #region 列表添加项
             lvwShow.Items.Add(new
             {
                 c1  = d.Dname,
                 c2  = d.Dtype,
                 c3  = d.DcostName,
                 c4  = d.Dspec,
                 c5  = d.DjiXing,
                 c6  = d.DinsertPrice,
                 c7  = d.DsellPrice,
                 c8  = d.Dstock,
                 c9  = d.DstockMax,
                 c10 = d.DstockMin,
                 c11 = d.DeffectTime,
                 c12 = d.DproductTime,
                 c13 = d.Efficay
             });
             #endregion
         }
     }
     catch
     {
         var p = new Tip("请输入正确价钱!");
         p.ShowDialog();
     }
 }
Example #8
0
        //中药提交
        private void BtnOk_Click(object sender, RoutedEventArgs e)
        {
            if (txtKId.Text == "" || txtRid.Text == "")
            {
                var t1 = new Tip("请先选择挂号单 !");
                t1.ShowDialog();
                return;
            }
            if (txtYizhu.Text == "" || txtJinji.Text == "")
            {
                var t2 = new Tip("请把药方填写完整 !");
                t2.ShowDialog();
                return;
            }
            string ypName = "";

            if (lvwYaofang.SelectedItems.Count > 0)
            {
                string   str = lvwYaofang.Items[lvwYaofang.SelectedIndex].ToString();
                string[] ss  = str.Split(',');
                //foreach (ListViewItem item in lvwYaofang.Items)
                //{
                //    ypName += ss[1].Substring(3).Replace("=", "").Trim() + "-";
                //}

                Kaiyao ky = new Kaiyao
                {
                    Rid        = txtRid.Text,
                    Kid        = int.Parse(txtKId.Text),
                    yaopinName = ypName,
                    zhuangtai  = "no",
                    yizhu      = txtYizhu.Text,
                    yongfa     = txtJinji.Text
                };
                if (lvwGuaHaoShow.SelectedItems.Count > 0)
                {
                    lvwGuaHaoShow.Items.RemoveAt(lvwGuaHaoShow.SelectedIndex);
                }
                string mes = new Prescribe_BLL().kaiyao_Insert(ky);
                //MessageBox.Show(mes);
                var t = new Tip("提交成功!");
                t.ShowDialog();
            }
        }
Example #9
0
        //删除
        private void BtnDelete_Click(object sender, RoutedEventArgs e)
        {
            SectionRoom s = new SectionRoom();

            if (listView1.SelectedItems.Count > 0)
            {
                s.Sname = txtSname.Text;
                new SectionRoomBLL().Delete(s);
                listView1.Items.RemoveAt(listView1.SelectedIndex);
            }
            listView1.Items.Clear();
            Init_Load(null, null);
            txtSname.Text  = "";
            txtSaddr.Text  = "";
            txtSprice.Text = "";
            Tip p = new Tip("删除成功");

            p.ShowDialog();
        }
Example #10
0
        private void Button1_Click(object sender, RoutedEventArgs e)
        {
            if (txtDname.Text == "")
            {
                var p = new Tip("请输入药品名字!");
                p.ShowDialog();
                return;
            }
            lvwShow.Items.Clear();
            List <Drug_insert> di = new Drug_insert_BLL().SelectAll(txtDname.Text);

            if (di.Count == 0)
            {
                var p = new Tip("没有你要查找的数据!");
                p.ShowDialog();
                return;
            }
            for (int i = 0; i < di.Count; i++)
            {
                #region 列表添加项
                lvwShow.Items.Add(new
                {
                    c1  = di[i].Dname,
                    c2  = di[i].Dtype,
                    c3  = di[i].DcostName,
                    c4  = di[i].Dspec,
                    c5  = di[i].DjiXing,
                    c6  = di[i].DinsertPrice,
                    c7  = di[i].DsellPrice,
                    c8  = di[i].Dstock,
                    c9  = di[i].DstockMax,
                    c10 = di[i].DstockMin,
                    c11 = di[i].DeffectTime,
                    c12 = di[i].DproductTime,
                    c13 = di[i].Efficay
                });
                #endregion
            }
        }
 private void Button1_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (textBox1.Text == "")
         {
             var p = new Tip("请输入卡号!");
             p.ShowDialog();
             return;
         }
         listView1.Items.Clear();
         if (zhu.Where(p => p.kId == int.Parse(textBox1.Text)).Count() == 0)
         {
             var p = new Tip("没有数据!");
             p.ShowDialog();
             return;
         }
         foreach (var z in zhu.Where(p => p.kId == int.Parse(textBox1.Text)))
         {
             listView1.Items.Add(new
             {
                 c1 = z.kId,
                 c2 = z.Kname,
                 c3 = se[z.Sid].Sname,
                 c4 = z.Idsickroom,
                 c5 = z.BedNo,
                 c6 = z.Imprest,
                 c7 = z.Bewrite,
                 c8 = z.Tabu,
                 c9 = z.Ztime
             });
         }
     }
     catch
     {
         var p = new Tip("病人编号只能是数字!");
         p.ShowDialog();
     }
 }
Example #12
0
        //药品查找
        private void BtnSearch_Click(object sender, RoutedEventArgs e)
        {
            if (txtDname.Text == "")
            {
                var p = new Tip("请输入药品名字!");
                p.ShowDialog();
                return;
            }
            lvwShow.Items.Clear();
            List <Drug_insert> di = new Drug_insert_BLL().SelectAll(txtDname.Text);

            if (di.Count == 0)
            {
                var p = new Tip("没有你要查找的数据!");
                p.ShowDialog();
                return;
            }
            for (int i = 0; i < di.Count; i++)
            {
                lvwShow.Items.Add(new
                {
                    drugname   = di[i].Dname,
                    type       = di[i].Dtype,
                    fare       = di[i].DcostName,
                    dosetype   = di[i].Dspec,
                    spec       = di[i].DjiXing,
                    in_price   = di[i].DinsertPrice,
                    sell_price = di[i].DsellPrice,
                    stock      = di[i].Dstock,
                    stockMax   = di[i].DstockMax,
                    stockMin   = di[i].DstockMin,
                    proDate    = di[i].DeffectTime,
                    effDate    = di[i].DproductTime,
                    effect     = di[i].Efficay
                });
            }
        }
        //确定
        private void BtnYes_Click(object sender, RoutedEventArgs e)
        {
            List <Control> con_list = new List <Control>
            {
                txtnum,
                txtBFnum,
                txtPrice,
                txtlou1,
                txtlou2,
                txtfang1,
                txtfang2,
                cboKeshi,
                cboType
            };

            foreach (Control item in con_list)
            {
                if (checkBox1.IsChecked == true)
                {
                    if (item is TextBox)
                    {
                        if (((TextBox)item).Text == "" && item.Name != "txtnum")
                        {
                            Tip t1 = new Tip("请输入完整!");
                            t1.ShowDialog();
                            return;
                        }
                    }
                    else
                    {
                        if (((ComboBox)item).Text == "" && item.Name != "txtnum")
                        {
                            Tip frmPrompting = new Tip("请输入完整!");
                            frmPrompting.ShowDialog();
                            return;
                        }
                    }
                }
                else
                {
                    if (item.Name == "txtlou1" || item.Name == "txtlou2" || item.Name == "txtfang1" || item.Name == "txtfang2")
                    {
                        break;
                    }
                    if (item is TextBox)
                    {
                        if (((TextBox)item).Text == "")
                        {
                            Tip t1 = new Tip("请输入完整!");
                            t1.ShowDialog();
                            return;
                        }
                    }
                    if (item is ComboBox)
                    {
                        if (((ComboBox)item).Text == "")
                        {
                            Tip t2 = new Tip("请输入完整!");
                            t2.ShowDialog();
                            return;
                        }
                    }
                }
            }

            List <Sickroom> sics = new List <Sickroom>();//要添加的病房放到sics集合中

            if (checkBox1.IsChecked == true)
            {
                for (int i = int.Parse(txtlou1.Text); i <= int.Parse(txtlou2.Text); i++)
                {
                    for (int j = int.Parse(txtfang1.Text); j <= int.Parse(txtfang2.Text); j++)
                    {
                        Sickroom sic = new Sickroom();
                        if (j > 9)
                        {
                            sic.Idsickroom = int.Parse("" + i + j);
                        }
                        else
                        {
                            sic.Idsickroom = int.Parse("" + i + 0 + j);
                        }
                        sic.Sid   = cboKeshi.SelectedIndex;
                        sic.Tyep  = cboType.Text;
                        sic.Price = int.Parse(txtPrice.Text);
                        sics.Add(sic);
                    }
                }
            }
            else
            {
                Sickroom sic = new Sickroom
                {
                    Idsickroom = int.Parse(txtnum.Text),
                    Sid        = cboKeshi.SelectedIndex,
                    Tyep       = cboType.Text,
                    Price      = int.Parse(txtPrice.Text)
                };
                sics.Add(sic);
            }
            int    num = int.Parse(txtBFnum.Text);             //获取病床数
            string str = new IdCard_BLL().sickroom(sics, num); //添加相应数量的病床
            Tip    t   = new Tip(str);

            t.ShowDialog();
        }
Example #14
0
        //导入病例点击事件
        private void BtnImport_Click(object sender, RoutedEventArgs e)
        {
            var t = new Tip("导入病例成功!");

            t.ShowDialog();
        }
        //保存按钮事件
        private void btnSend_Click(object sender, RoutedEventArgs e)
        {
            List <TextBox> tb = new List <TextBox>
            {
                textBox1,
                textBox2,
                textBox3,
                textBox4,
                textBox5,
                textBox6,
                textBox7,
                textBox8
            };

            foreach (TextBox item in tb) //遍历所有textbox的属性
            {
                if (comboBox1.Text != "医师" && (item.Name == "textBox8" || item.Name == "comboBox2"))
                {
                    textBox8.Text = 0 + "";
                    continue;
                }
                else if (item.Text == "")
                {
                    Tip t1 = new Tip("请输入完整!");
                    t1.ShowDialog();
                    return;
                }
            }
            try
            {
                int.Parse(textBox8.Text);
            }
            catch
            {
                Tip t2 = new Tip("请正确输入挂号费!");
                t2.ShowDialog();
            }
            Users u = new Users
            {
                Uname = textBox1.Text,
                name  = textBox4.Text,
                Pwd   = textBox2.Text
            };

            if (radioButton1.IsChecked == true)
            {
                u.Sex = "男";
            }
            else
            {
                u.Sex = "女";
            }
            u.Address     = textBox5.Text;
            u.Phone       = textBox6.Text;
            u.Spell       = textBox7.Text;
            u.Type        = comboBox1.Text;
            u.SectionRoom = comboBox2.Text;
            u.money       = int.Parse(textBox8.Text);
            u.Peodom      = "";
            string s = new IdCard_BLL().p_users_insert(u);

            Tip t3 = new Tip(s);

            t3.ShowDialog();
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button btn = e.Source as Button;
            string s   = btn.Content.ToString();

            switch (s)
            {
            case "查找":
                if (txtDname.Text == "")
                {
                    var t1 = new Tip("请输入药品名字!");
                    t1.ShowDialog();
                    return;
                }
                lvwShow.Items.Clear();
                List <Drug_insert> di = new Drug_insert_BLL().SelectAll(txtDname.Text);
                if (di.Count == 0)
                {
                    var t2 = new Tip("没有你要查找的数据!");
                    t2.ShowDialog();
                    return;
                }
                lvwShow.Items.Clear();
                for (int i = 0; i < di.Count; i++)
                {
                    lvwShow.Items.Add(new
                    {
                        drugname   = di[i].Dname,
                        type       = di[i].Dtype,
                        fare       = di[i].DcostName,
                        dosetype   = di[i].Dspec,
                        spec       = di[i].DjiXing,
                        in_price   = di[i].DinsertPrice,
                        sell_price = di[i].DsellPrice,
                        stock      = di[i].Dstock,
                        stockMax   = di[i].DstockMax,
                        stockMin   = di[i].DstockMin,
                        proDate    = di[i].DeffectTime,
                        effDate    = di[i].DproductTime,
                        effect     = di[i].Efficay
                    });
                }
                break;

            case "药品出库":
                if (txtDname.Text == "" && lvwShow.SelectedItems.Count == 0)
                {
                    var t1 = new Tip("请选择需要删除的数据 !");
                    t1.ShowDialog();
                    return;
                }
                Drug_insert Ddelete = new Drug_insert();
                Ddelete.Dname = txtDname.Text;
                string mes = new Drug_insert_BLL().Delete(Ddelete);
                lvwShow.Items.RemoveAt(lvwShow.SelectedIndex);
                txtDname.Text = "";
                Init_Load();
                var p = new Tip(mes);
                p.ShowDialog();
                break;

            case "清除":
                txtDname.Text = "";
                break;
            }
        }
        //注册
        private void BtnSure_Click(object sender, RoutedEventArgs e)
        {
            List <Control> con_list = new List <Control>()
            {
                txtName,
                txtAddress,
                cboCulture,
                txtIdcardNo,
                txtPhone,
                cboWork,
                txtAge,
                cboNation,
                txtPostcode,
                rdoBoy,
                rdoGirl,
                rdoMarriageYes,
                rdoMarriageNo,
                dtpBirthday
            };

            foreach (Control item in con_list)
            {
                if (item is TextBox)
                {
                    if (((TextBox)item).Text == "")
                    {
                        var p = new Tip("请把信息填写完整!");
                        p.ShowDialog();
                        return;
                    }
                }
                if (item is ComboBox)
                {
                    if (((ComboBox)item).Text == "")
                    {
                        var p = new Tip("请把信息填写完整!");
                        p.ShowDialog();
                        return;
                    }
                }
                if (item is DatePicker)
                {
                    if (((DatePicker)item).Text == "")
                    {
                        var p = new Tip("请把信息填写完整!");
                        p.ShowDialog();
                        return;
                    }
                }
            }
            IdCard IC = new IdCard
            {
                Name = txtName.Text
            };

            if (rdoBoy.IsChecked == true)
            {
                IC.Sex = rdoBoy.Content.ToString();
            }
            else
            {
                IC.Sex = rdoGirl.Content.ToString();
            }
            IC.Age      = int.Parse(txtAge.Text);
            IC.Birthday = dtpBirthday.Text;
            IC.Address  = txtAddress.Text;
            IC.Phone    = (txtPhone.Text);
            IC.Nation   = cboNation.Text;
            IC.Cultrue  = cboCulture.Text;
            if (rdoMarriageYes.IsChecked == true)
            {
                IC.Marriage = rdoMarriageYes.Content.ToString();
            }
            else
            {
                IC.Marriage = rdoMarriageNo.Content.ToString();
            }
            IC.Work     = cboWork.Text;
            IC.Postcode = (txtPostcode.Text);
            IC.IdcardNo = txtIdcardNo.Text;

            string mes = new IdCard_BLL().Reg(IC);
            string s   = new IdCard_BLL().p_IdCard_select();

            var t = new Tip("注册成功!卡号为:" + s);

            t.ShowDialog();
        }
Example #18
0
        //挂号
        private void BtnRegister_Click(object sender, RoutedEventArgs e)
        {
            List <Control> con_list1 = new List <Control>()
            {
                txtRid,
                txtKid,
                txtOtherFei,
                cboIdType,
                cboSectionRoom,
                dtpRegisterTime,
                dtpSeeDoctorTime,
                cboDoctor,
                txtGuaHaoFei,
                txtName,
                txtAddress,
                cboCultrue,
                txtIdcardNo,
                txtPhone,
                cboWork,
                txtAge,
                cboNation,
                txtPostcode,
                rdoBoy,
                rdoGirl,
                rdoMarriageYes,
                rdoMarriageNo,
                dtpBirthday
            };

            foreach (Control item in con_list1)
            {
                if (item is TextBox)
                {
                    if (((TextBox)item).Text == "")
                    {
                        var p = new Tip("请填写完整信息!");
                        p.ShowDialog();
                        return;
                    }
                }
                else if (item is ComboBox)
                {
                    if (((ComboBox)item).Text == "")
                    {
                        var p = new Tip("请填写完整信息!");
                        p.ShowDialog();
                        return;
                    }
                }
                else if (item is DatePicker)
                {
                    if (((DatePicker)item).Text == "")
                    {
                        var p = new Tip("请填写完整信息!");
                        p.ShowDialog();
                        return;
                    }
                }
                else
                {
                    //if(((RadioButton)item).IsChecked == false)
                    //{
                    //    var p = new Tip("请填写完整信息!");
                    //    p.ShowDialog();
                    //    return;
                    //}
                }
            }
            Register r = new Register
            {
                Rid           = txtRid.Text,
                KId           = int.Parse(txtKid.Text),
                IdType        = cboIdType.Text,
                SectionRoom   = cboSectionRoom.Text + "",
                Doctor        = cboDoctor.Text,
                GuaDanFei     = int.Parse(txtGuaHaoFei.Text),
                OtherFei      = int.Parse(txtOtherFei.Text),
                ReristerTime  = dtpRegisterTime.Text,
                SeeDoctorTime = dtpSeeDoctorTime.Text
            };
            string s = new UsersBLL().RegisterRew(r);

            var t = new Tip(s);

            t.ShowDialog();
            if (printList.IsChecked == true && s == "挂号成功")
            {
                PrintDialog dialog = new PrintDialog();
                if (dialog.ShowDialog() == true)
                {
                    dialog.PrintVisual(groupBox1, "打印挂号单");
                }
            }
        }
Example #19
0
        private void Button1_Click(object sender, RoutedEventArgs e)
        {
            List <zhuyuan>     zhu = new IdCard_BLL().p_zhuyuan_Select();
            List <SectionRoom> se  = new UsersBLL().Section();

            txtId2.Text     = "";
            txtname2.Text   = "";
            txtyujiao2.Text = "";
            List <Control> conList2 = new List <Control>()
            {
                txtId, txtkeshi, txttime, txtname, txtshengyu, txtyujiao, txtyiyong
            };
            List <Control> conList3 = new List <Control>()
            {
                txtname2, txtId2, txtyujiao2
            };

            foreach (Control item in conList2)
            {
                if (item is TextBox)
                {
                    ((TextBox)item).Text = "";
                }
            }
            foreach (Control item in conList3)
            {
                item.IsEnabled = false;
            }
            try
            {
                if (textBox1.Text == "")
                {
                    var p = new Tip("请输入卡号!");
                    p.ShowDialog();
                    return;
                }
                if (zhu.Where(p => p.kId == int.Parse(textBox1.Text)).Count() == 0)
                {
                    var p = new Tip("没有数据!");
                    p.ShowDialog();
                    return;
                }
                foreach (var z in zhu.Where(p => p.kId == int.Parse(textBox1.Text)))
                {
                    txtId.Text     = z.kId + "";
                    txtname.Text   = z.Kname;
                    txtkeshi.Text  = (se[z.Sid].Sname);
                    txttime.Text   = (z.Ztime + "");
                    txtyujiao.Text = (z.Imprest + "");
                }
                List <zhuyuanxiaofei> xfs = new IdCard_BLL().p_zhuyuanxiaofei_select(int.Parse(txtId.Text));
                int i = 0;
                foreach (zhuyuanxiaofei xf in xfs)
                {
                    List <Drug_insert> di = new Drug_insert_BLL().SelectAll(xf.yaoName);
                    i = i + int.Parse(xf.yaonum + "") * int.Parse(di[0].DsellPrice + "");
                }
                txtyiyong.Text  = i + "";
                txtshengyu.Text = int.Parse(txtyujiao.Text) - int.Parse(txtyiyong.Text) + "";
            }
            catch
            {
                var p = new Tip("病人编号只能是数字!");
                p.ShowDialog();
            }
        }
Example #20
0
        //药品入库
        private void Drug_Insert()
        {
            #region 控件列表集合
            List <Control> con_list = new List <Control>()
            {
                txtDinsertPrice,
                txtDname,
                txtDsellPrice,
                txtDstock,
                txtDstockMax,
                txtDstockMin,
                txtEfficay,
                cboDcostName,
                cboDjiXing,
                cboDspec,
                cboDtype,
                dtpDeffectTime,
                dtpDproductTime
            };
            #endregion
            foreach (Control item in con_list)
            {
                if (item is TextBox)
                {
                    if (((TextBox)item).Text == "")
                    {
                        Tip p = new Tip("请把信息填写完整 !");
                        p.ShowDialog();
                        return;
                    }
                }
                if (item is ComboBox)
                {
                    if (((ComboBox)item).Text == "")
                    {
                        Tip p = new Tip("请把信息填写完整 !");
                        p.ShowDialog();

                        return;
                    }
                }
            }
            Drug_insert Dinsert = new Drug_insert();
            Dinsert.Dname        = txtDname.Text;
            Dinsert.Dtype        = cboDtype.Text;
            Dinsert.DcostName    = cboDcostName.Text;
            Dinsert.Dspec        = cboDspec.Text;
            Dinsert.DjiXing      = cboDjiXing.Text;
            Dinsert.DinsertPrice = int.Parse(txtDinsertPrice.Text);
            Dinsert.DsellPrice   = int.Parse(txtDsellPrice.Text);
            Dinsert.Dstock       = int.Parse(txtDstock.Text);
            Dinsert.DstockMax    = int.Parse(txtDstockMax.Text);
            Dinsert.DstockMin    = int.Parse(txtDstockMin.Text);
            Dinsert.DeffectTime  = dtpDproductTime.Text;
            Dinsert.DproductTime = dtpDeffectTime.Text;
            Dinsert.Efficay      = txtEfficay.Text;

            string mes = new Drug_insert_BLL().Insert(Dinsert);
            txtDname.Text = "";
            Method();
            Tip pp = new Tip(mes);
            pp.ShowDialog();
        }
 //保存按钮点击事件
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     #region 所有控件的列表容器con_list
     List <Control> con_list = new List <Control>();
     con_list.Add(groupBox1);
     con_list.Add(groupBox2);
     con_list.Add(groupBox3);
     con_list.Add(groupBox4);
     con_list.Add(groupBox5);
     con_list.Add(groupBox6);
     con_list.Add(groupBox7);
     con_list.Add(groupBox8);
     con_list.Add(checkBox1);
     con_list.Add(checkBox2);
     con_list.Add(checkBox3);
     con_list.Add(checkBox4);
     con_list.Add(checkBox5);
     con_list.Add(checkBox6);
     con_list.Add(checkBox7);
     con_list.Add(checkBox8);
     con_list.Add(checkBox9);
     con_list.Add(checkBox10);
     con_list.Add(checkBox11);
     con_list.Add(checkBox12);
     con_list.Add(checkBox13);
     con_list.Add(checkBox14);
     con_list.Add(checkBox15);
     con_list.Add(checkBox16);
     con_list.Add(checkBox17);
     con_list.Add(checkBox18);
     con_list.Add(checkBox19);
     con_list.Add(checkBox20);
     con_list.Add(checkBox21);
     con_list.Add(checkBox22);
     con_list.Add(checkBox23);
     con_list.Add(checkBox24);
     con_list.Add(checkBox25);
     con_list.Add(checkBox26);
     con_list.Add(checkBox27);
     con_list.Add(checkBox28);
     con_list.Add(checkBox29);
     con_list.Add(checkBox30);
     con_list.Add(checkBox31);
     con_list.Add(checkBox32);
     con_list.Add(checkBox33);
     con_list.Add(checkBox34);
     con_list.Add(checkBox35);
     con_list.Add(checkBox36);
     con_list.Add(checkBox37);
     con_list.Add(checkBox38);
     con_list.Add(checkBox39);
     con_list.Add(checkBox40);
     con_list.Add(checkBox41);
     con_list.Add(checkBox42);
     con_list.Add(checkBox43);
     con_list.Add(checkBox44);
     con_list.Add(checkBox45);
     #endregion
     #region checkbox容器cb_list
     List <CheckBox> cb_list = new List <CheckBox>();
     cb_list.Add(checkBox1);
     cb_list.Add(checkBox2);
     cb_list.Add(checkBox3);
     cb_list.Add(checkBox4);
     cb_list.Add(checkBox5);
     cb_list.Add(checkBox6);
     cb_list.Add(checkBox7);
     cb_list.Add(checkBox8);
     cb_list.Add(checkBox9);
     cb_list.Add(checkBox10);
     cb_list.Add(checkBox11);
     cb_list.Add(checkBox12);
     cb_list.Add(checkBox13);
     cb_list.Add(checkBox14);
     cb_list.Add(checkBox15);
     cb_list.Add(checkBox16);
     cb_list.Add(checkBox17);
     cb_list.Add(checkBox18);
     cb_list.Add(checkBox19);
     cb_list.Add(checkBox20);
     cb_list.Add(checkBox21);
     cb_list.Add(checkBox22);
     cb_list.Add(checkBox23);
     cb_list.Add(checkBox24);
     cb_list.Add(checkBox25);
     cb_list.Add(checkBox26);
     cb_list.Add(checkBox27);
     cb_list.Add(checkBox28);
     cb_list.Add(checkBox29);
     cb_list.Add(checkBox30);
     cb_list.Add(checkBox31);
     cb_list.Add(checkBox32);
     cb_list.Add(checkBox33);
     cb_list.Add(checkBox34);
     cb_list.Add(checkBox35);
     cb_list.Add(checkBox36);
     cb_list.Add(checkBox37);
     cb_list.Add(checkBox38);
     cb_list.Add(checkBox39);
     cb_list.Add(checkBox40);
     cb_list.Add(checkBox41);
     cb_list.Add(checkBox42);
     cb_list.Add(checkBox43);
     cb_list.Add(checkBox44);
     cb_list.Add(checkBox45);
     #endregion
     string str = "";
     foreach (Control item in con_list)
     {
         if (item is GroupBox)
         {
             foreach (Control ite in cb_list)
             {
                 if (ite is CheckBox)
                 {
                     if (((CheckBox)ite).IsChecked == true)
                     {
                         str += ((CheckBox)ite).Content.ToString() + "-";
                     }
                 }
             }
         }
     }
     if (textBox1.Text != "")
     {
         new IdCard_BLL().p_usesType_update(textBox1.Text, str);
         type = new IdCard_BLL().p_usesType_select();
         Tip t1 = new Tip("保存成功!");
         t1.ShowDialog();
         Authority_Load(null, null);
     }
     else if (textBox3.Text != "")
     {
         new IdCard_BLL().p_usersPeodom_update(textBox3.Text, str);
         type = new IdCard_BLL().p_usesType_select();
         Tip t2 = new Tip("保存成功!");
         t2.ShowDialog();
         Authority_Load(null, null);
     }
     //设置权限...
     if (textBox1.Text == "")
     {
         var p = new Tip("请输入类型!");
         p.ShowDialog();
         return;
     }
     string str1 = "";
     foreach (Control item in con_list)
     {
         if (item is GroupBox)
         {
             foreach (Control ite in cb_list)
             {
                 if (ite is CheckBox)
                 {
                     if (((CheckBox)ite).IsChecked == true)
                     {
                         str1 += ((CheckBox)ite).Content.ToString() + "-";
                     }
                 }
             }
         }
     }
     string s = new IdCard_BLL().p_usersType_insert(textBox1.Text, str);
     MessageBox.Show(str);
     var pp = new Tip(str);
     pp.ShowDialog();
 }
Example #22
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button btn = e.Source as Button;
            string s   = btn.Content.ToString();


            switch (s)
            {
            case "清空全部":
                txtDinsertPrice.Text = "";
                txtDname.Text        = "";
                txtDsellPrice.Text   = "";
                txtDstock.Text       = "";
                txtDstockMax.Text    = "";
                txtDstockMin.Text    = "";
                txtEfficay.Text      = "";
                cboDcostName.Text    = "";
                cboDjiXing.Text      = "";
                cboDspec.Text        = "";
                cboDtype.Text        = "";
                dtpDeffectTime.Text  = "";
                dtpDproductTime.Text = "";
                break;

            case "显示全部":
                #region 列表添加显示所有药品
                List <Drug_insert> di = new Drug_insert_BLL().SelectAll("");
                for (int i = 0; i < di.Count; i++)
                {
                    lvwShow.Items.Add(new
                    {
                        drugname   = di[i].Dname,
                        type       = di[i].Dtype,
                        fare       = di[i].DcostName,
                        dosetype   = di[i].Dspec,
                        spec       = di[i].DjiXing,
                        in_price   = di[i].DinsertPrice,
                        sell_price = di[i].DsellPrice,
                        stock      = di[i].Dstock,
                        stockMax   = di[i].DstockMax,
                        stockMin   = di[i].DstockMin,
                        proDate    = di[i].DeffectTime,
                        effDate    = di[i].DproductTime,
                        effect     = di[i].Efficay
                    });
                }
                #endregion
                break;

            case "药品修改":
                if (txtDname.Text == "")
                {
                    Tip p = new Tip("请选择需要修改的数据 !");
                    p.ShowDialog();
                    return;
                }
                Drug_insert Dupdate = new Drug_insert();
                Dupdate.Dname        = txtDname.Text;
                Dupdate.Dtype        = cboDtype.Text;
                Dupdate.DcostName    = cboDcostName.Text;
                Dupdate.Dspec        = cboDspec.Text;
                Dupdate.DjiXing      = cboDjiXing.Text;
                Dupdate.DinsertPrice = int.Parse(txtDinsertPrice.Text);
                Dupdate.DsellPrice   = int.Parse(txtDsellPrice.Text);
                Dupdate.Dstock       = int.Parse(txtDstock.Text);
                Dupdate.DstockMax    = int.Parse(txtDstockMax.Text);
                Dupdate.DstockMin    = int.Parse(txtDstockMin.Text);
                Dupdate.DeffectTime  = dtpDproductTime.Text;
                Dupdate.DproductTime = dtpDeffectTime.Text;
                Dupdate.Efficay      = txtEfficay.Text;
                string mes = new Drug_insert_BLL().Update(Dupdate);
                break;

            case "药品入库":
                Drug_Insert();
                break;
            }
        }
        //门诊结账按钮
        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();
            }
        }