Ejemplo n.º 1
0
        private void btnEdit_Click(object sender, System.EventArgs e)
        {
            int rowhandle=0;
            rowhandle=gvwContact.FocusedRowHandle;

            if(rowhandle<0) return;
            frmClientDeptContactDlg objContact=new frmClientDeptContactDlg();
            objContact.ContactType = "DepartmentContact";
            objContact.Mode="Edit";
            objContact.ModeParental=_mode;
            int _contid=0;
            _contid=Convert.ToInt32(gvwContact.GetRowCellValue(gvwContact.FocusedRowHandle, gcolContactID).ToString());
            objContact.ID =_contid;
            if(objContact.ShowDialog()==DialogResult.OK)
            {
                LoadContact();
            }
            objContact.Close();
            objContact.Dispose();
            objContact=null;
            gvwContact.FocusedRowHandle=rowhandle;
        }
Ejemplo n.º 2
0
 private void btnAdd_Click(object sender, System.EventArgs e)
 {
     frmClientDeptContactDlg objContact=new frmClientDeptContactDlg();
     objContact.ContactType = "DepartmentContact";
     objContact.Mode="Add";
     objContact.ModeParental=_mode;
     if(_deptid<=0)
     {
         getRandomNo();
         objContact.RefID=intRandomNo;
     }
     else objContact.RefID=_deptid;
     if(objContact.ShowDialog()==DialogResult.OK)
     {
         LoadContact();
     }
     objContact.Close();
     objContact.Dispose();
     objContact=null;
 }