示例#1
0
 public void Save(object sender, EventArgs e)
 {
     try
     {
         if (Valid())
         {
             this.Cursor = Cursors.WaitCursor;
             UpdateEntity();
             if (m_si.ID == 0)
             {
                 r_si.Save(m_si);
             }
             else
             {
                 r_si.Update(m_si);
             }
             KryptonMessageBox.Show("Transaction '" + m_si.CODE + "' Record has been saved", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
             //ClearForm();
             textBoxCode.Text = m_si.CODE;
             setEnableForm(false);
             setEditMode(EditMode.View);
             textBoxCode.Focus();
             this.Cursor = Cursors.Default;
         }
     }
     catch (Exception x)
     {
         KryptonMessageBox.Show(x.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }