SaleBillInfo.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using PTMedicalInsurance.Variables;
  11. namespace PTMedicalInsurance.Forms
  12. {
  13. public partial class SaleBillInfo : Form
  14. {
  15. public string entId, code, medicalDrugId, batchNo;
  16. public decimal drugSalePrice = 0, unpackCount = 0;
  17. public int salePkg = 0;
  18. private void SaleBillInfo_Load(object sender, EventArgs e)
  19. {
  20. cbb_CLBS.SelectedIndex = 0;
  21. tb_CBXSSL.Text = "0";
  22. }
  23. private void cbb_CLBS_SelectedIndexChanged(object sender, EventArgs e)
  24. {
  25. if (cbb_CLBS.SelectedIndex == 0)
  26. {
  27. tb_CBXSSL.Text = "0";
  28. }
  29. else
  30. {
  31. tb_CBXSSL.Text = "";
  32. }
  33. }
  34. public SaleBillInfo()
  35. {
  36. InitializeComponent();
  37. }
  38. public SaleBillInfo(string InsuCode,string InsuName)
  39. {
  40. InitializeComponent();
  41. tb_YBYPBM.Text = InsuCode;
  42. tb_YBYPMC.Text = InsuName;
  43. tb_JRZDBS.Text = Global.inf.hospitalNO;
  44. }
  45. private void uiButton8_Click(object sender, EventArgs e)
  46. {
  47. DialogResult = DialogResult.Cancel;
  48. }
  49. private void uiButton9_Click(object sender, EventArgs e)
  50. {
  51. entId = tb_JRZDBS.Text;
  52. code = tb_ZSM.Text;
  53. medicalDrugId = tb_YBYPBM.Text;
  54. salePkg = int.Parse(cbb_CLBS.Text.Substring(0, 7));
  55. unpackCount = decimal.Parse(tb_CBXSSL.Text);
  56. drugSalePrice = decimal.Parse(tb_YPLSJG.Text);
  57. batchNo = tb_SCPC.Text;
  58. if ((code == "") && (batchNo == ""))
  59. {
  60. MessageBox.Show("当【追溯码】为空时,【生产批次】必须有值!");
  61. return;
  62. }
  63. decimal count;
  64. count = unpackCount;
  65. if (cbb_CLBS.SelectedIndex != 0)
  66. {
  67. if ((count <= 0) || (tb_CBXSSL.Text == ""))
  68. {
  69. MessageBox.Show("整包销售时【拆包销售数量】传0,拆零销售时【拆包销售数量】传大于0的整数!");
  70. return;
  71. }
  72. }
  73. decimal price;
  74. price = drugSalePrice;
  75. if ((price <= 0) || (tb_YPLSJG.Text == ""))
  76. {
  77. MessageBox.Show("【药品零售价格】无效!");
  78. return;
  79. }
  80. DialogResult = DialogResult.OK;
  81. }
  82. }
  83. }