using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm
{
public partial class GetDateSuperSmallForm : LYFZ.Software.UI.CameraControlBook.SuperSmallForm.GetDateSuperSmallForm
{
public GetDateSuperSmallForm()
{
}
private string _strvalue = "";
public string StrValue
{
get { return _strvalue; }
set { _strvalue = value; }
}
///
/// 是否确定
///
public bool IsOK = false;
///
/// 是否允许值为空
///
public bool IsValueNull = true;
///
/// 窗体加载事件
///
///
///
protected override void GetDateSuperSmallForm_Load(object sender, EventArgs e)
{
this.dtpDate.DateValue = LYFZ.Command.Command_Validate.DateTimeToString(SDateTime.Now);
}
///
/// 输入后回车
///
///
///
protected override void dtpDate_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{ this.btnOK_Click(this, null); }
}
///
/// 日期值改变事件
///
///
///
protected override void dtpDate_ValueChanged(object sender, EventArgs e)
{
this.dtpDate.CustomFormat = "yyyy-MM-dd";
}
///
/// 确定
///
///
///
protected override void btnOK_Click(object sender, EventArgs e)
{
if (!IsValueNull)
{
if (string.IsNullOrEmpty(this.dtpDate.DateValue))
{ MessageBoxCustom.Show("日期不允许为空!"); return; }
}
IsOK = true;
StrValue = this.dtpDate.DateValue;
this.Close();
}
///
/// 取消
///
///
///
protected override void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
}
}