using System; using System.Collections; 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.Customers.SetSmallForm { public partial class ConditionQuerySamllForm : LYFZ.Software.UI.Customers.SetSmallForm.ConditionQuerySamllForm { public ConditionQuerySamllForm() { this.Shown += ConditionQuerySamllForm_Shown; this.txtAgesEnd.KeyPress += txtAgesEnd_KeyPress; this.txtAgesStart.KeyPress += txtAgesStart_KeyPress; this.chkAgesGrow.Click += chkAgesGrow_Click; this.chkAgesOrder.Click += chkAgesOrder_Click; this.btnOK.Click += btnOK_Click; this.btnCanael.Click += btnCanael_Click; } public bool IsSaveed = false; public string StrLoadType = ""; public Hashtable htData = new Hashtable(); /// /// 窗体加载事件 /// /// /// void ConditionQuerySamllForm_Shown(object sender, EventArgs e) { if (this.StrLoadType == "1" || string.IsNullOrEmpty(this.StrLoadType)) { TreeNode root = new TreeNode(); root.Text = "岁"; root.Tag = "Age_Year"; root.Name = "Age_Year"; this.cmbtreevAge.Nodes.Add(root); root = new TreeNode(); root.Text = "天"; root.Tag = "Age_Day"; root.Name = "Age_Day"; this.cmbtreevAge.Nodes.Add(root); this.cmbtreevAge.TextFindTag("天"); } else { this.panelAges.Visible = false; } LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientRelation("AAAAAAC", this.cmbtreevRegion, IsFirstNodeNull: true); } /// /// 结束年龄输入限制 /// /// /// void txtAgesEnd_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 开始年龄输入限制 /// /// /// void txtAgesStart_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 按成长年龄点击 /// /// /// void chkAgesGrow_Click(object sender, EventArgs e) { this.chkAgesGrow.Checked = true; this.chkAgesOrder.Checked = false; } /// /// 按订单年龄点击 /// /// /// void chkAgesOrder_Click(object sender, EventArgs e) { this.chkAgesOrder.Checked = true; this.chkAgesGrow.Checked = false; } /// /// 确定 /// /// /// void btnOK_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.cmbtreevRegion.Text.Trim())) { htData["ClientRegion"] = this.cmbtreevRegion.Text.Trim(); } if (!string.IsNullOrEmpty(this.txtAgesStart.Text.Trim())) { htData["AgesStart"] = this.txtAgesStart.Text.Trim(); } if (!string.IsNullOrEmpty(this.txtAgesEnd.Text.Trim())) { htData["AgesEnd"] = this.txtAgesEnd.Text.Trim(); } if (this.chkAgesOrder.Checked) { htData["AgesType"] = "Order"; } if (this.chkAgesGrow.Checked) { htData["AgesType"] = "Grow"; } if (!string.IsNullOrEmpty(this.txtAgesStart.Text.Trim()) || !string.IsNullOrEmpty(this.txtAgesEnd.Text.Trim())) { if (this.cmbtreevAge.Text.Trim() == "") { MessageBoxCustom.Show("年龄未选择是按岁查还是按天查"); return; } htData["GrowAges"] = this.cmbtreevAge.Tag.ToString().Trim(); htData["OrderAges"] = this.cmbtreevAge.Text.Trim(); } this.IsSaveed = true; this.Close(); } /// /// 取消 /// /// /// void btnCanael_Click(object sender, EventArgs e) { this.Close(); } } }