Exemple #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     using (Form1add fa = new Form1add())
     {
         fa.Edit = "ADD";
         if (fa.ShowDialog() == DialogResult.OK)
         {
             MessageBox.Show("添加成功");
             Department_Id = fa.Department_Id;
             Company_Id    = fa.Company_Id;
             load();
         }
     }
 }
Exemple #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            using (Form1add fa = new Form1add())
            {
                int rowindex = this.dataGridView1.CurrentCell.RowIndex;
                fa.Edit            = "ED";
                fa.Department_Id   = this.dataGridView1.Rows[rowindex].Cells[2].Value.ToString();
                fa.Company_Id      = this.dataGridView1.Rows[rowindex].Cells[1].Value.ToString();
                fa.PaDepartment_Id = this.dataGridView1.Rows[rowindex].Cells[4].Value.ToString();
                fa.Desc_01         = this.dataGridView1.Rows[rowindex].Cells[3].Value.ToString();
                fa.Remark          = this.dataGridView1.Rows[rowindex].Cells[5].Value.ToString();
                fa.Usr_Id          = this.dataGridView1.Rows[rowindex].Cells[6].Value.ToString();
                fa.Create_Date     = this.dataGridView1.Rows[rowindex].Cells[7].Value.ToString();

                if (fa.ShowDialog() == DialogResult.OK)
                {
                    MessageBox.Show("修改成功");
                    Department_Id = fa.Department_Id;
                    Company_Id    = fa.Company_Id;
                    load();
                }
            }
        }