Esempio n. 1
0
 private void loginkryptonButton1_Click(object sender, EventArgs e)
 {
     try
     {
         if (isValid())
         {
             this.Cursor = Cursors.WaitCursor;
             errorProvider1.Clear();
             m_currentUser = (User)r_user.GetUser(userCodekryptonTextBox1.Text.Trim(), passwordkryptonTextBox2.Text.Trim());
             if (m_currentUser == null)
             {
                 throw new Exception("Invelid User");
             }
             m_currentPeriod        = r_period.FindCurrentPeriod();
             mainForm.CurrentUser   = m_currentUser;
             mainForm.CurrentPeriod = m_currentPeriod;
             this.Cursor            = Cursors.Default;
             this.Hide();
             mainForm.Show();
         }
     }
     catch (Exception x)
     {
         messageLabelkryptonLabel.Text = x.Message;
         this.Cursor = Cursors.Default;
     }
 }
Esempio n. 2
0
        private void kryptonButtonRollBack_Click(object sender, EventArgs e)
        {
            try
            {
                kryptonTextBox1.Text = "";
                if (KryptonMessageBox.Show("Are Sure Want To Rollback The Current Month?", "Transaction Process", MessageBoxButtons.YesNo, MessageBoxIcon.Question).Equals(DialogResult.Yes))
                {
                    r_prtr.RollBackTransaction(m_mainForm.CurrentPeriod.ID);
                    m_mainForm.CurrentPeriod = r_period.FindCurrentPeriod();
                    kryptonDateTimePicker1.Value = m_mainForm.CurrentPeriod.START_DATE;
                    kryptonTextBox1.Text = "Rollback Succeeded";
                }

            }
            catch (Exception x)
            {
                kryptonTextBox1.Text = x.Message;
            }
        }