frmPop_selectDate.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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.Windows.Forms;
  9. using Core.Mes.Client.Comm.Tool;
  10. using CoreFS.CA06;
  11. using Pur.Entity;
  12. namespace Pur.Pop_upWindow
  13. {
  14. public partial class frmPop_selectDate : FrmPmsBase
  15. {
  16. public string tips = "0";
  17. public string type = "0";//0计算月充值 1:复制月定额
  18. public string computerType = "0";
  19. public string limitCount = "";
  20. public DateTime date;
  21. public frmPop_selectDate()
  22. {
  23. InitializeComponent();
  24. }
  25. public frmPop_selectDate(OpeBase OB,String str)
  26. {
  27. InitializeComponent();
  28. this.ob = OB;
  29. this.type = str;
  30. }
  31. private void frmPop_selectDate_Load(object sender, EventArgs e)
  32. {
  33. Qmouth.Value = DateTime.Now;
  34. Qmouth.Format = "yyyy/MM";
  35. txt_computer_type.SelectedIndex =0;
  36. this.Text = "选择月份";
  37. LimitCount.SelectedIndex = 2;
  38. }
  39. private void btn_sure_Click(object sender, EventArgs e)
  40. {
  41. if (String.IsNullOrEmpty(Qmouth.Text.Trim()))
  42. {
  43. MessageUtil.ShowTips("请选择日期");
  44. tips = "0";
  45. return;
  46. }
  47. date = Convert.ToDateTime(Qmouth.Value);
  48. if (date.Month != DateTime.Now.Month)
  49. {
  50. if (MessageUtil.ShowYesNoAndQuestion("非当前年月,确定选择?") != DialogResult.Yes)
  51. {
  52. tips = "0";
  53. return;
  54. }
  55. }
  56. if (txt_computer_type.SelectedIndex == -1)
  57. {
  58. MessageUtil.ShowTips("请选择计算模式");
  59. tips = "0";
  60. return;
  61. }
  62. if(LimitCount.SelectedIndex == -1)
  63. {
  64. MessageUtil.ShowTips("请选择限额倍数");
  65. tips = "0";
  66. return;
  67. }
  68. computerType = txt_computer_type.Value.ToString().Trim();
  69. limitCount = LimitCount.Value.ToString().Trim();
  70. tips = "1";
  71. this.Close();
  72. }
  73. }
  74. }