示例#1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (dgvUsers.CurrentRow != null)
                {
                    if (dgvUsers.SortedColumn != null)
                    {
                        sortedColumn  = dgvUsers.SortedColumn;
                        sortDirection = dgvUsers.SortOrder;
                    }

                    frmTermsNConditionsEntry fUser = new frmTermsNConditionsEntry((int)Constant.Mode.Delete, (dgvUsers.CurrentRow.Cells["TNC_Sub"].Value).ToString());
                    fUser.ShowInTaskbar = false;
                    fUser.ShowDialog();
                    LoadList();



                    if (sortedColumn != null)
                    {
                        ListSortDirection LSD;
                        if (sortDirection == SortOrder.Ascending)
                        {
                            LSD = System.ComponentModel.ListSortDirection.Ascending;
                        }
                        else
                        {
                            LSD = System.ComponentModel.ListSortDirection.Descending;
                        }

                        dgvUsers.Sort(dgvUsers.Columns[sortedColumn.Name], LSD);
                    }
                    if (dgvUsers.CurrentRow != null && idgvPosition <= dgvUsers.RowCount)
                    {
                        if (dgvUsers.Rows.Count - 1 < idgvPosition)
                        {
                            dgvUsers.CurrentCell = dgvUsers.Rows[idgvPosition - 1].Cells[0];
                        }
                        else
                        {
                            dgvUsers.CurrentCell = dgvUsers.Rows[idgvPosition].Cells[0];
                        }
                    }
                    dgvUsers_SelectionChanged(sender, e);
                }
            }
            catch (Exception exc)
            {
                Utill.Common.ExceptionLogger.writeException("TNC", exc.StackTrace);
                MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception");
            }
        }
示例#2
0
 private void btnNewTNC_Click(object sender, EventArgs e)
 {
     try
     {
         GUI.TermsNConditions.frmTermsNConditionsEntry fTNC = new GUI.TermsNConditions.frmTermsNConditionsEntry((int)Constant.Mode.Modify, cmbTNCSub.Text);
         fTNC.ShowInTaskbar = false;
         fTNC.ShowDialog();
         LoadList();
     }
     catch (Exception exc)
     {
         Utill.Common.ExceptionLogger.writeException("TNC", exc.StackTrace);
         MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception");
     }
 }
示例#3
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            try
            {
                frmTermsNConditionsEntry fUser = new frmTermsNConditionsEntry((int)Constant.Mode.Insert, "");
                fUser.ShowInTaskbar = false;
                fUser.ShowDialog();
                LoadList();

                dgvUsers_SelectionChanged(sender, e);
            }
            catch (Exception exc)
            {
                Utill.Common.ExceptionLogger.writeException("TNC", exc.StackTrace);
            }
        }