| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- /*******************************************************************************
- * Copyright(c) 2015 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_P_000021.cs
- * 2.功能描述:成型结算信息表-查询条件(成型工号)
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 陈晓野 2017/01/11 1.00 新建
- *******************************************************************************/
- using System;
- using System.Windows.Forms;
- using Dongke.IBOSS.PRD.Client.Controls;
- namespace Dongke.IBOSS.PRD.Client.Public
- {
- /// <summary>
- /// 成型结算信息表-查询条件(成型工号)
- /// </summary>
- public partial class F_P_000021 : DKFormBase
- {
- private const string TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
- private DateTime? _nonShowErrorTime = null;
- public string UserCode
- {
- get;
- set;
- }
- public DateTime DateStart
- {
- get
- {
- return dtpDateStart.Value;
- }
- }
- public DateTime DateMonth
- {
- get
- {
- return dtpMonth.Value;
- }
- }
- public string ErrorMessges
- {
- get
- {
- return this.lblErrorMessges.Text;
- }
- set
- {
- this.lblErrorMessges.Text = value;
- }
- }
- public F_P_000021()
- {
- InitializeComponent();
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
- this.lblErrorMessges.Text = null;
- //#if DEBUG
- // this.lblAccountDateStart.Visible = true;
- // this.dtpDateStart.Visible = true;
- // this.btnSearch.Visible = true;
- // this.label1.Visible = true;
- //#else
- this.lblAccountDateStart.Visible = false;
- this.dtpDateStart.Visible = false;
- this.btnSearch.Visible = false;
- this.label1.Visible = false;
- //#endif
- }
- private void F_P_000021_Shown(object sender, System.EventArgs e)
- {
- this.timer1.Start();
- this.txtUserCode.Focus();
- DateTime date = DateTime.Now.Date;
- //this.dtpDateStart.Value = date;
- DateTime month = new DateTime(date.Year, date.Month, 1);
- this.dtpMonth.Value = month;
- this.dtpMonth.MaxDate = month;
- this.dtpMonth.MinDate = month.AddMonths(-1);
- this.hScrollBar1.Value = 1;
- if (string.IsNullOrEmpty(this.lblErrorMessges.Text))
- {
- _nonShowErrorTime = null;
- }
- else
- {
- _nonShowErrorTime = DateTime.Now.AddSeconds(10);
- }
- }
- private void F_P_000021_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e)
- {
- this.timer1.Stop();
- }
- private void timer1_Tick(object sender, System.EventArgs e)
- {
- this.lblDataTime.Text = DateTime.Now.ToString(TIME_FORMAT);
- if (_nonShowErrorTime.HasValue)
- {
- if (DateTime.Now > _nonShowErrorTime.Value)
- {
- this.lblErrorMessges.Text = null;
- _nonShowErrorTime = null;
- }
- }
- }
- private void txtUserCode_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- string text = this.txtUserCode.Text.Trim().ToUpper();
- if (string.IsNullOrWhiteSpace(text))
- {
- return;
- }
- if (text.Length > 3 && text.StartsWith("#") && text.EndsWith("#"))
- {
- this.txtUserCode.Clear();
- if (F_P_00002.PreMonth == text)
- {
- this.hScrollBar1.Value = 0;
- }
- else if (F_P_00002.CurMonth == text)
- {
- this.hScrollBar1.Value = 1;
- }
- }
- else
- {
- this.btnSearch_Click(sender, e);
- }
- }
- else if (e.KeyCode == Keys.Down || e.KeyCode == Keys.PageDown || e.KeyCode == Keys.VolumeDown)
- {
- this.hScrollBar1.Value = 0;
- }
- else if (e.KeyCode == Keys.Up || e.KeyCode == Keys.PageUp || e.KeyCode == Keys.VolumeUp)
- {
- this.hScrollBar1.Value = 1;
- }
- }
- private void btnSearch_Click(object sender, EventArgs e)
- {
- this.UserCode = this.txtUserCode.Text.Trim();
- if (string.IsNullOrWhiteSpace(this.UserCode))
- {
- return;
- }
- this.txtUserCode.Clear();
- this.lblErrorMessges.Text = null;
- _nonShowErrorTime = null;
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- this.Close();
- }
- private void hScrollBar1_ValueChanged(object sender, EventArgs e)
- {
- if (hScrollBar1.Value == 0)
- {
- this.dtpMonth.Value = this.dtpMonth.MinDate;
- }
- else
- {
- this.dtpMonth.Value = this.dtpMonth.MaxDate;
- }
- }
- }
- }
|