private void SerchBtn_Click(object sender, EventArgs e)
        {
            DateTime startDate = Convert.ToDateTime(this.dateEditStart.EditValue);
            DateTime endDate   = Convert.ToDateTime(this.dateEditEnd.EditValue);

            if (DateTimeParse.DateTimeEquls(startDate, endDate))
            {
                MessageBox.Show(Properties.Resources.StartDateNotEndDate, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (DateTime.Compare(startDate, endDate) > 0)
            {
                MessageBox.Show(Properties.Resources.StartDateGTEndDate, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            this.bindingSource1.DataSource = stockEditorDetalManager.GetStockEditorDetalByDate(startDate, endDate);
        }
示例#2
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            DateTime startDate = Convert.ToDateTime(this.dateEditStart.EditValue);
            DateTime endDate   = Convert.ToDateTime(this.dateEditEnd.EditValue);

            if (DateTimeParse.DateTimeEquls(startDate, endDate))
            {
                MessageBox.Show("起始时间不能和结束时间相等!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (DateTime.Compare(startDate, endDate) > 0)
            {
                MessageBox.Show("起始时间不能大于结束时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            DataSet ds = this.stockCheckDetailManager.SelectDataSet(startDate, endDate);

            this.bindingSource1.DataSource = ds.Tables[0];
        }