Exemple #1
0
        /// <summary>
        /// 根据名字,日期查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSearch_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtPicName.Text.Trim()))
            {
                return;
            }
            if (string.IsNullOrEmpty(txtPicName.Tag.ToString().Trim()))
            {
                return;
            }
            if (string.IsNullOrEmpty(StartDate.Text.Trim()))
            {
                MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.EMS.EquipmentLayout.msg.0002}"));//开始日期不能为空!
                StartDate.Focus();
                return;
            }
            if (string.IsNullOrEmpty(EndDate.Text.Trim()))
            {
                MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.EMS.EquipmentLayout.msg.0003}"));//结束日期不能为空!
                EndDate.Focus();
                return;
            }
            if (Convert.ToDateTime(StartDate.Text) > Convert.ToDateTime(EndDate.Text))
            {
                MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.EMS.EquipmentLayout.msg.0004}"));//开始日期不能大于结束日期!
                return;
            }

            string  msg      = string.Empty;
            DataSet dsReturn = EquLayoutEntity.GetEquipmentLayoutDetail(txtPicName.Tag.ToString(), out msg);

            if (string.IsNullOrEmpty(msg))
            {
                QueryEquipmentData(dsReturn);
            }
        }