Exemplo n.º 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);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Function to fill datagridview
 /// </summary>
 public void Gridfill()
 {
     try
     {
         DataTable dtblCounter = new DataTable();
         CounterSP spCounter = new CounterSP();
         dtblCounter = spCounter.CounterOnlyViewAll();
         dgvCounter.DataSource = dtblCounter;
     }
     catch (Exception ex)
     {
         MessageBox.Show("CT2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Function to fill datagridview
 /// </summary>
 public void Gridfill()
 {
     try
     {
         DataTable dtblCounter = new DataTable();
         CounterSP spCounter   = new CounterSP();
         dtblCounter           = spCounter.CounterOnlyViewAll();
         dgvCounter.DataSource = dtblCounter;
     }
     catch (Exception ex)
     {
         MessageBox.Show("CT2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Function to fill datagridview
 /// </summary>
 public void Gridfill()
 {
     try
     {
         DataTable dtblCounter = new DataTable();
         CounterSP spCounter   = new CounterSP();
         dtblCounter           = spCounter.CounterOnlyViewAll();
         dgvCounter.DataSource = dtblCounter;
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "CT2" + ex.Message;
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Function to edit
 /// </summary>
 public void EditFunction()
 {
     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;
         infoCounter.CounterId   = Convert.ToDecimal(dgvCounter.CurrentRow.Cells["dgvtxtcounterId"].Value.ToString());
         if (txtCounterName.Text.ToString() != strCounterName)
         {
             if (spCounter.CounterCheckIfExist(txtCounterName.Text.Trim(), decCounterId) == false)
             {
                 if (spCounter.CounterEditParticularField(infoCounter))
                 {
                     Messages.UpdatedMessage();
                     Clear();
                 }
                 else if (infoCounter.CounterId == 1)
                 {
                     Messages.InformationMessage("Cannot update");
                     Clear();
                     txtCounterName.Focus();
                 }
             }
             else
             {
                 Messages.InformationMessage("Counter name already exist");
                 txtCounterName.Focus();
             }
         }
         else
         {
             spCounter.CounterEditParticularField(infoCounter);
             Messages.UpdatedMessage();
             Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CT4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Function to fill controls to update
 /// </summary>
 public void FillControls()
 {
     try
     {
         CounterInfo infoCounter = new CounterInfo();
         CounterSP   spCounter   = new CounterSP();
         infoCounter         = spCounter.CounterWithNarrationView(Convert.ToDecimal(dgvCounter.CurrentRow.Cells[1].Value.ToString()));
         txtCounterName.Text = infoCounter.CounterName;
         txtNarration.Text   = infoCounter.Narration;
         btnSave.Text        = "Update";
         btnDelete.Enabled   = true;
         decCounterId        = infoCounter.CounterId;
         strCounterName      = infoCounter.CounterName;
     }
     catch (Exception ex)
     {
         MessageBox.Show("CT8" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// Function to fill controls to update
 /// </summary>
 public void FillControls()
 {
     try
     {
         CounterInfo infoCounter = new CounterInfo();
         CounterSP   spCounter   = new CounterSP();
         infoCounter         = spCounter.CounterWithNarrationView(Convert.ToDecimal(dgvCounter.CurrentRow.Cells[1].Value.ToString()));
         txtCounterName.Text = infoCounter.CounterName;
         txtNarration.Text   = infoCounter.Narration;
         btnSave.Text        = "Update";
         btnDelete.Enabled   = true;
         decCounterId        = infoCounter.CounterId;
         strCounterName      = infoCounter.CounterName;
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "CT8" + ex.Message;
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// Function to delete
 /// </summary>
 public void DeleteFunction()
 {
     try
     {
         CounterSP spCounter = new CounterSP();
         if (spCounter.CounterCheckReferenceAndDelete(decCounterId) <= 0)
         {
             Messages.ReferenceExistsMessage();
         }
         else
         {
             spCounter.CounterDelete(Convert.ToDecimal(dgvCounter.CurrentRow.Cells[1].Value.ToString()));
             Messages.DeletedMessage();
             Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CT6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 9
0
 /// <summary>
 /// Function to delete
 /// </summary>
 public void DeleteFunction()
 {
     try
     {
         CounterSP spCounter = new CounterSP();
         if (spCounter.CounterCheckReferenceAndDelete(decCounterId) <= 0)
         {
             Messages.ReferenceExistsMessage();
         }
         else
         {
             spCounter.CounterDelete(Convert.ToDecimal(dgvCounter.CurrentRow.Cells[1].Value.ToString()));
             Messages.DeletedMessage();
             Clear();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "CT6" + ex.Message;
     }
 }
Exemplo n.º 10
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);
     }
 }
Exemplo n.º 11
0
 /// <summary>
 /// Function to fill controls to update
 /// </summary>
 public void FillControls()
 {
     try
     {
         CounterInfo infoCounter = new CounterInfo();
         CounterSP spCounter = new CounterSP();
         infoCounter = spCounter.CounterWithNarrationView(Convert.ToDecimal(dgvCounter.CurrentRow.Cells[1].Value.ToString()));
         txtCounterName.Text = infoCounter.CounterName;
         txtNarration.Text = infoCounter.Narration;
         btnSave.Text = "Update";
         btnDelete.Enabled = true;
         decCounterId = infoCounter.CounterId;
         strCounterName = infoCounter.CounterName;
     }
     catch (Exception ex)
     {
         MessageBox.Show("CT8" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 12
0
 /// <summary>
 /// Function to delete
 /// </summary>
 public void DeleteFunction()
 {
     try
     {
         CounterSP spCounter = new CounterSP();
         if (spCounter.CounterCheckReferenceAndDelete(decCounterId) <= 0)
         {
             Messages.ReferenceExistsMessage();
         }
         else
         {
             spCounter.CounterDelete(Convert.ToDecimal(dgvCounter.CurrentRow.Cells[1].Value.ToString()));
             Messages.DeletedMessage();
             Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CT6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 13
0
 /// <summary>
 /// Function to edit
 /// </summary>
 public void EditFunction()
 {
     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;
         infoCounter.CounterId = Convert.ToDecimal(dgvCounter.CurrentRow.Cells["dgvtxtcounterId"].Value.ToString());
         if (txtCounterName.Text.ToString() != strCounterName)
         {
             if (spCounter.CounterCheckIfExist(txtCounterName.Text.Trim(), decCounterId) == false)
             {
                 if (spCounter.CounterEditParticularField(infoCounter))
                 {
                     Messages.UpdatedMessage();
                     Clear();
                 }
                 else if (infoCounter.CounterId == 1)
                 {
                     Messages.InformationMessage("Cannot update");
                     Clear();
                     txtCounterName.Focus();
                 }
             }
             else
             {
                 Messages.InformationMessage("Counter name already exist");
                 txtCounterName.Focus();
             }
         }
         else
         {
             spCounter.CounterEditParticularField(infoCounter);
             Messages.UpdatedMessage();
             Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CT4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 14
0
 /// <summary>
 /// Function to use the Counter Combo Fill
 /// </summary>
 public void CounterComboFill()
 {
     CounterSP SpCounter = new CounterSP();
     DataTable dtbl = new DataTable();
     try
     {
         dtbl = SpCounter.CounterOnlyViewAll();
         cmbCounter.DataSource = dtbl;
         cmbCounter.DisplayMember = "counterName";
         cmbCounter.ValueMember = "counterId";
     }
     catch (Exception ex)
     {
         MessageBox.Show("POS : 11" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }