public override int Query()
        {
            panel1.Enabled = true;
            if (_Form == null)
            {
                _Form = new UIForms.FormEnterWarehouseReceiptsCodition();
                _Form.StartPosition = FormStartPosition.CenterParent;
                _Form.ShowInTaskbar = false;
            }
            if (_Form.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return(0);
            }
            _where = _Form.GetWhereCondition;
            List <FishEntity.EnterWarehouseReceipts> list = _bll.GetModelListVo(_where + _rolewhere + _orderBy);

            if (list == null || list.Count < 1)
            {
                _entity = null;
                return(1);
            }
            else
            {
                _entity = list[0];
                SetOnepound();
            }
            return(1);
        }
Exemplo n.º 2
0
        public override int Query()
        {
            string strwhere = " 1=1 ";

            if (!string.IsNullOrEmpty(txtcode.Text))
            {
                strwhere += " and code like '%" + txtcode.Text + "%'";
            }
            strwhere += string.Format(" and Unpackingdate>='{0}' and Unpackingdate<='{1}'",
                                      dtpbefore.Value.ToString("yyyy-MM-dd 00:00:00"),
                                      dtpRear.Value.ToString("yyyy-MM-dd 23:59:59"));
            GetList = _bll.GetModelListVo(strwhere);
            if (GetList != null)
            {
                dataGridView1.AutoGenerateColumns = false;
                dataGridView1.DataSource          = GetList;
            }
            else
            {
                MessageBox.Show("查无数据!");
            }
            return(base.Query());
        }