private void btnAddImport_Click(object sender, EventArgs e)
 {
     var frmExport = new FrmDecleExport(_userInfo, 0, Common.DeclerationType.Import, _mainForm);
     frmExport.Show(this);
 }
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (grvDecleration.SelectedRows.Count != 0)
         {
             var declarationType = grvDecleration.SelectedRows[0].Cells["DeclarationType"].Value;
             if (declarationType.Equals((short)Common.DeclerationType.Export)) // tờ khai xuất
             {
                 var frmExport = new FrmDecleExport(_mainForm, _userInfo, 1, Convert.ToInt32(grvDecleration.SelectedRows[0].Cells[0].Value), Common.DeclerationType.Export);
                 frmExport.Show(this);
             }
             else
             {
                 var frmExport = new FrmDecleExport(_mainForm, _userInfo, 1, Convert.ToInt32(grvDecleration.SelectedRows[0].Cells[0].Value), Common.DeclerationType.Import);
                 frmExport.Show(this);
             }
         }
         else
         {
             MessageBox.Show("Bạn cần chọn 1 tờ khai cần cập nhật.");
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex.ToString());
         if (GlobalInfo.IsDebug) MessageBox.Show(ex.ToString());
     }
 }
 private void grvDecleration_CellMouseDoubleClick_1(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (_userInfo.UserPermission.Contains(ConstantInfo.PERMISSON_CAP_NHAT_TO_KHAI))
     {
         try
         {
             if (e.RowIndex >= 0 && grvDecleration.SelectedRows.Count == 1) // Only select one row
             {
                 var declarationType = grvDecleration.SelectedRows[0].Cells["DeclarationType"].Value;
                 if (declarationType.Equals((short)Common.DeclerationType.Export)) // tờ khai xuất
                 {
                     var frmExport = new FrmDecleExport(_mainForm, _userInfo, 1, Convert.ToInt64(grvDecleration.SelectedRows[0].Cells[0].Value), Common.DeclerationType.Export);
                     frmExport.Show(this);
                 }
                 else
                 {
                     var frmExport = new FrmDecleExport(_mainForm, _userInfo, 1, Convert.ToInt64(grvDecleration.SelectedRows[0].Cells[0].Value), Common.DeclerationType.Import);
                     frmExport.Show(this);
                 }
             }
         }
         catch (Exception ex)
         {
             logger.Error(ex.ToString());
             if (GlobalInfo.IsDebug) MessageBox.Show(ex.ToString());
         }
     }
 }
 private void tsExport_Click(object sender, EventArgs e)
 {
     var frmDecleExport = new FrmDecleExport(_userInfo, 0, Common.DeclerationType.Export, this);
     frmDecleExport.Show(this);
 }