Example #1
0
 private void gridViewDanhBaCongTy_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         if (gridViewDanhBaCongTy.SelectedRowsCount > 0)
         {
             DanhBaCongTy    objCongTy = (DanhBaCongTy)gridViewDanhBaCongTy.GetFocusedRow();
             frmDanhBaCongTy frm       = new frmDanhBaCongTy(objCongTy, false);
             frm.ShowDialog(this);
             if (frm.IsSuccess)
             {
                 objCongTy = frm.GetDanhBaCongTy();
                 frm.Dispose();
                 if (!objCongTy.Update())
                 {
                     new MessageBox.MessageBoxBA().Show("Lỗi thêm mới danh bạ công ty");
                 }
                 else
                 {
                     LoadListDanhBaCongTy();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogError.WriteLogError("gridViewDanhBaCongTy_DoubleClick: ", ex);
     }
 }
 /// <summary>
 /// Mo form DanhBaCongTy de edit
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gridDanhBaCongTy_DoubleClick(object sender, EventArgs e)
 {
     gridDMDanhBaCongTy.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
     if (gridDMDanhBaCongTy.SelectedItems.Count > 0)
     {
         GridEXRow       row             = ((GridEXSelectedItem)gridDMDanhBaCongTy.SelectedItems[0]).GetRow();
         DanhBaCongTy    objDanhBaCongTy = (DanhBaCongTy)((GridEXSelectedItem)gridDMDanhBaCongTy.SelectedItems[0]).GetRow().DataRow;
         frmDanhBaCongTy frm             = new frmDanhBaCongTy(objDanhBaCongTy, false);
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             objDanhBaCongTy = frm.GetDanhBaCongTy();
             frm.Dispose();
             //Insert DataBase
             if (!objDanhBaCongTy.Update())
             {
                 new MessageBox.MessageBoxBA().Show("Lỗi thêm mới danh bạ công ty");
                 return;
             }
             else
             {
                 //Load lai grid
                 LoadListDanhBaCongTy();
             }
         }
         else
         {
             return;
         }
     }
 }