예제 #1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (isEqu)
     {
         A_frmAddEqu addequ = new A_frmAddEqu(this);
         addequ.ShowDialog();
     }
     else
     {
         A_frmAddFactory f = new A_frmAddFactory(this);
         f.ShowDialog();
     }
     //Flash();
 }
예제 #2
0
 private void dgv_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         if (isEqu)
         {
             A_frmAddEqu f = new A_frmAddEqu(dgv.Rows[e.RowIndex].Cells[1].Value.ToString(), -1, this);
             f.ShowDialog();
         }
         else
         {
             A_frmAddFactory f = new A_frmAddFactory(dgv.Rows[e.RowIndex].Cells[1].Value.ToString(), -1, this);
             f.ShowDialog();
         }
     }
 }
예제 #3
0
        private void btnLaws_Click(object sender, EventArgs e)
        {
            int num   = 0;
            int index = -1;

            for (int i = 0; i < dgv.Rows.Count; i++)
            {
                if (dgv.Rows[i].Cells["Column1"].Value != null && dgv.Rows[i].Cells["Column1"].Value.Equals(true))
                {
                    num++;
                    index = i;
                }
            }
            if (num == 0)
            {
                MessageBox.Show("请选择要修改的信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else if (num > 1)
            {
                MessageBox.Show("每次只能修改一条记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else
            {
                if (index != -1)
                {
                    if (isEqu)
                    {
                        strUpDateEquID = dgv.Rows[index].Cells["EquID"].Value.ToString();
                        A_frmAddEqu f = new A_frmAddEqu(dgv.Rows[index].Cells[1].Value.ToString(), 1, this);
                        f.ShowDialog();
                    }
                    else
                    {
                        strUpDateFactoryID = dgv.Rows[index].Cells["FactoryID"].Value.ToString();
                        A_frmAddFactory f = new A_frmAddFactory(dgv.Rows[index].Cells[1].Value.ToString(), 1, this);
                        f.ShowDialog();
                    }
                    //Flash();
                }
            }
        }
예제 #4
0
 private void dgv_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         if (isEqu)
         {
             A_frmAddEqu f = new A_frmAddEqu(dgv.Rows[e.RowIndex].Cells[1].Value.ToString(), -1, this);
             f.ShowDialog();
         }
         else
         {
             A_frmAddFactory f = new A_frmAddFactory(dgv.Rows[e.RowIndex].Cells[1].Value.ToString(), -1, this);
             f.ShowDialog();
         }
     }
 }
예제 #5
0
 private void btnLaws_Click(object sender, EventArgs e)
 {
     int num = 0;
     int index = -1;
     for (int i = 0; i < dgv.Rows.Count; i++)
     {
         if (dgv.Rows[i].Cells["Column1"].Value!=null && dgv.Rows[i].Cells["Column1"].Value.Equals(true))
         {
             num++;
             index = i;
         }
     }
     if (num == 0)
     {
         MessageBox.Show("请选择要修改的信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     }
     else if (num > 1)
     {
         MessageBox.Show("每次只能修改一条记录!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Asterisk);
     }
     else
     {
         if (index != -1)
         {
             if (isEqu)
             {
                 strUpDateEquID = dgv.Rows[index].Cells["EquID"].Value.ToString();
                 A_frmAddEqu f = new A_frmAddEqu(dgv.Rows[index].Cells[1].Value.ToString(), 1,this);
                 f.ShowDialog();
             }
             else
             {
                 strUpDateFactoryID = dgv.Rows[index].Cells["FactoryID"].Value.ToString();
                 A_frmAddFactory f = new A_frmAddFactory(dgv.Rows[index].Cells[1].Value.ToString(), 1,this);
                 f.ShowDialog();
             }
             //Flash();
         }
     }
 }
예제 #6
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (isEqu)
     {
         A_frmAddEqu addequ = new A_frmAddEqu(this);
         addequ.ShowDialog();
     }
     else
     {
         A_frmAddFactory f = new A_frmAddFactory(this);
         f.ShowDialog();
     }
     //Flash();
 }