Beispiel #1
0
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         CounterInfo infoCounter = new CounterInfo();
         CounterSP   spCounter   = new CounterSP();
         infoCounter.CounterName = txtCounterName.Text.Trim();
         infoCounter.Narration   = txtNarration.Text.Trim();
         infoCounter.Extra1      = string.Empty;
         infoCounter.Extra2      = string.Empty;
         if (spCounter.CounterCheckIfExist(txtCounterName.Text.Trim(), 0) == false)
         {
             decLedgerId = spCounter.CounterAddWithIdentity(infoCounter);
             Messages.SavedMessage();
             Clear();
             decIdForOtherForms = decLedgerId;
         }
         else
         {
             Messages.InformationMessage("Counter name already exist");
             txtCounterName.Focus();
         }
         if (frmPOSObj != null)
         {
             this.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CT3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         CounterInfo infoCounter = new CounterInfo();
         CounterSP spCounter = new CounterSP();
         infoCounter.CounterName = txtCounterName.Text.Trim();
         infoCounter.Narration = txtNarration.Text.Trim();
         infoCounter.Extra1 = string.Empty;
         infoCounter.Extra2 = string.Empty;
         if (spCounter.CounterCheckIfExist(txtCounterName.Text.Trim(), 0) == false)
         {
             decLedgerId = spCounter.CounterAddWithIdentity(infoCounter);
             Messages.SavedMessage();
             Clear();
             decIdForOtherForms = decLedgerId;
         }
         else
         {
             Messages.InformationMessage("Counter name already exist");
             txtCounterName.Focus();
         }
         if (frmPOSObj != null)
         {
             this.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CT3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }