Пример #1
0
        //增加
        private void tpbAdd_Click(object sender, EventArgs e)
        {
            VipsModel vip = new VipsModel();

            vip.VipID1 = -1;
            MemberEditorForm mef = new MemberEditorForm(vip);

            mef.Show();
            this.Hide();
        }
Пример #2
0
        //修改
        private void tpbUpdate_Click(object sender, EventArgs e)
        {
            int              index     = Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value);
            string           name      = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[1].Value.ToString();
            string           sex       = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[2].Value.ToString();
            string           top       = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[3].Value.ToString();
            string           tel       = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[5].Value.ToString();
            string           startTime = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[6].Value.ToString();
            string           endTime   = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[7].Value.ToString();
            VipsModel        vip       = new VipsModel(index, name, sex, top, tel, startTime, endTime);
            MemberEditorForm mef       = new MemberEditorForm(vip);

            mef.Show();
            this.Hide();
        }