コード例 #1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     Recorder.Enabled         = false;
     Recorder.Text            = UserHelper.Recorder;
     model.Table              = "summary";
     dataGridView1.DataSource = bll.GetList("1=1", model);
     dataGridView1.AutoResizeColumns();
 }
コード例 #2
0
 private void Form2_Load(object sender, EventArgs e)
 {
     agree.Enabled            = false;
     agree.Text               = "";
     Recorder.Enabled         = false;
     Recorder.Text            = UserHelper.Recorder;
     model.Table              = "value_decrease";
     dataGridView1.DataSource = bll.GetList("1=1", model);
     dataGridView1.AutoResizeColumns();
 }
コード例 #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("请确认添加!", "添加提示", MessageBoxButtons.OKCancel);

            if (dr == DialogResult.OK)
            {
                model.Id        = textBox3.Text;
                model.Now       = textBox4.Text;
                model.Date      = textBox5.Text;
                model.Recorder  = Recorder.Text;
                model.Inspecter = agree.Text;

                BLL.Contact bll = new BLL.Contact();
                BLL.Change  ch  = new BLL.Change();
                string      msg = "";
                if (bll.Update(model, out msg))
                {
                    MessageBox.Show("添加成功!");
                }
                else
                {
                    MessageBox.Show(msg);
                }
                dataGridView1.DataSource = bll.GetList("1=1", model);
                dataGridView1.AutoResizeColumns();
                ch.change_ad_state(model);
                ch.change_remain_state(model);
                UserHelper.Inspecter = "";
            }

            else
            {
                MessageBox.Show("添加取消!");
            }
        }
コード例 #4
0
        public void Fill()
        {
            string strWhere = "";

            if (cboCondition.Text == "姓名")
            {
                strWhere = "Name like '%" + txtSearch.Text.Trim() + "%'";
            }
            if (cboCondition.Text == "手机")
            {
                strWhere = "Phone like '%" + txtSearch.Text.Trim() + "%'";
            }
            dgvContactList.DataSource = bll.GetList(strWhere);
        }
コード例 #5
0
        private void button9_Click(object sender, EventArgs e)
        {
            model.Id               = textBox5.Text.Trim();
            model.Name             = textBox6.Text.Trim();
            model.Buy_time         = textBox7.Text.Trim();
            model.Price            = textBox8.Text.Trim();
            model.Discard_time     = textBox9.Text.Trim();
            model.Initial_recorder = Recorder.Text.Trim();
            DialogResult dr = MessageBox.Show("请确认添加!", "添加提示", MessageBoxButtons.OKCancel);

            if (dr == DialogResult.OK)
            {
                BLL.Contact bll = new BLL.Contact();
                string      msg = "";
                if (bll.Update(model, out msg))
                {
                    MessageBox.Show("添加成功!");
                    textBox5.Text = "";
                    textBox6.Text = "";
                    textBox7.Text = "";
                    textBox8.Text = "";
                    textBox9.Text = "";
                }
                else
                {
                    MessageBox.Show(msg);
                }

                dataGridView1.DataSource = bll.GetList("1=1", model);
                dataGridView1.AutoResizeColumns();
            }
            else
            {
                MessageBox.Show("添加取消!");
            }
        }