Пример #1
0
        private void ok_button_Click(object sender, EventArgs e)
        {
            goods one = new goods();

            one.number      = number_textBox.Text;
            one.source      = source_textBox.Text;
            one.dest        = dest_comBox.Text;
            one.arriveTime  = arrive_time.Value.ToString("yyyy-MM-dd");
            one.deadline    = dead_time.Value.ToString("yyyy-MM-dd");
            one.objVechicle = deferVech(vech_comBox.Text);
            one.status      = status_comBox.Text;
            one.finishTime  = finish_time.Value.ToString("yyyy-MM-dd");
            if (m_status == Status.addStatus)
            {
                m_form.insertGoods(one);
            }
            else
            {
                m_form.updateGoods(one);
            }
            m_form.setStatus(formStatus.noneStaus);
            //m_form.goFull();
            //this.Visible = false;
        }
Пример #2
0
        private void ok_button_Click(object sender, EventArgs e)
        {
            string str   = "";
            bool   first = true;

            if (num_checkBox.Checked)
            {
                if (first)
                {
                    str  += "where number = '" + number_textBox.Text + "' ";
                    first = false;
                }
            }
            if (arrive_checkBox.Checked)
            {
                if (first)
                {
                    str  += "where  arriveTime >= '" + arriveS_time.Value.ToString("yyyy-MM-dd") + "' and arriveTime <= '" + arriveF_time.Value.ToString("yyyy-MM-dd") + "' ";
                    first = false;
                }
                else
                {
                    str += " and arriveTime >= '" + arriveS_time.Value.ToString("yyyy-MM-dd") + "' and arriveTime <= '" + arriveF_time.Value.ToString("yyyy-MM-dd") + "' ";
                }
            }
            if (finish_checkBox.Checked)
            {
                if (first)
                {
                    str  += "where  finishTime >= '" + finishS_time.Value.ToString("yyyy-MM-dd") + "' and finishTime <= '" + finishF_time.Value.ToString("yyyy-MM-dd") + "' ";
                    first = false;
                }
                else
                {
                    str += " and finishTime >= '" + finishS_time.Value.ToString("yyyy-MM-dd") + "' and finishTime <= '" + finishF_time.Value.ToString("yyyy-MM-dd") + "' ";
                }
            }
            if (status_checkBox.Checked)
            {
                if (first)
                {
                    str  += "where  status = '" + status_comBox.Text + "' ";
                    first = false;
                }
                else
                {
                    str += " and status = '" + status_comBox.Text + "' ";
                }
            }
            if (vech_checkBox.Checked)
            {
                if (first)
                {
                    str  += "where  objVechicle = '" + deferVech() + " '";
                    first = false;
                }
                else
                {
                    str += " and objVechicle = '" + deferVech() + " '";
                }
            }
            if (dest_checkBox.Checked)
            {
                if (first)
                {
                    str  += "where  dest = '" + dest_comBox.Text + "'";
                    first = false;
                }
                else
                {
                    str += " and dest = '" + dest_comBox.Text + "'";
                }
            }
            m_form.queryGoods(str);
            m_form.setStatus(formStatus.noneStaus);
            //this.Visible = false;
        }