Exemplo n.º 1
0
        private void dgView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView dgv = (DataGridView)sender;
            if (e.RowIndex == -1 || dgv.CurrentRow == null || dgv.CurrentRow.IsNewRow) return;
            //if (frmState == Js.NetBase.KcfrmState.View) return;
            if (this.Column2.Index == e.ColumnIndex)
            {
                Sys.frmSelect frm = new Sys.frmSelect(true, "BU_Enterprise", " 1=1 ");
                //Js.NetBase.frmSelect frm = new Js.NetBase.frmSelect(bll.getSysPid("machine"), true);
                frm.ShowInTaskbar = false;
                frm.ShowDialog();
                RefreshTable();

                DataRow dr;
                if (frm.DialogResult == DialogResult.OK)
                {
                    for (int i = frm.dtSelect.Rows.Count - 1; i >= 0; i--)
                    {
                        if (!Exists(dgv, frm.dtSelect.Rows[i][0].ToString()))
                        {
                            if (i == (frm.dtSelect.Rows.Count - 1))
                                dr = GetRow(dgv, e.RowIndex);
                            else
                                dr = NewRowInsertAt(dgv, e.RowIndex);
                            dgv.Rows[e.RowIndex].Cells[this.Column2.Index].Value = frm.dtSelect.Rows[i][0].ToString();
                            dgv.Rows[e.RowIndex].Cells[this.Column3.Index].Value = frm.dtSelect.Rows[i][1].ToString();
                        }
                    }
                    CheckRowID(dgv);
                }
            }
        }
Exemplo n.º 2
0
 private void txtUserName_DoubleClick(object sender, EventArgs e)
 {
     Sys.frmSelect f = new Sys.frmSelect(false, "BU_User", " 1=1 ");
     f.ShowDialog();
     if (f.DialogResult == DialogResult.OK)
     {
         if (f.dtSelect.Rows.Count > 0)
         {
             this.txtUserName.Text = f.dtSelect.Rows[0][0].ToString();
             this.txtPersonID.Text = f.dtSelect.Rows[0][1].ToString();
             this.txtPersonName.Text = f.dtSelect.Rows[0][2].ToString();
         }
     }
 }
Exemplo n.º 3
0
 private void txtEnterpriseID_DoubleClick(object sender, EventArgs e)
 {
     Sys.frmSelect f = new Sys.frmSelect(false, "BU_Enterprise", " EnterpriseID not in (select distinct EnterpriseID from Com_EnterpriseDb) ");
     f.ShowDialog();
     if (f.DialogResult == DialogResult.OK)
     {
         if (f.dtSelect.Rows.Count > 0)
         {
             this.txtEnterpriseID.Text = f.dtSelect.Rows[0][0].ToString();
             this.txtEnterpriseName.Text = f.dtSelect.Rows[0][1].ToString();
         }
     }
 }