Esempio n. 1
0
 /// <summary>
 /// Edit function
 /// </summary>
 public void EditFunction()
 {
     try
     {
         SuffixPrefixSP   spSuffixPrefix   = new SuffixPrefixSP();
         SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
         infoSuffixPrefix.FromDate = Convert.ToDateTime(txtFromDate.Text.ToString());
         infoSuffixPrefix.ToDate   = Convert.ToDateTime(txtToDate.Text.ToString());
         String strvouchertype = (cmbVoucherType.SelectedValue.ToString());
         infoSuffixPrefix.VoucherTypeId = Convert.ToDecimal(strvouchertype.ToString());
         infoSuffixPrefix.Prefix        = txtPrefix.Text.Trim();
         infoSuffixPrefix.Suffix        = txtSufix.Text.Trim();
         infoSuffixPrefix.StartIndex    = Convert.ToDecimal(txtStartIndex.Text.ToString());
         if (cbxPrefillWithZero.Checked)
         {
             infoSuffixPrefix.PrefillWithZero      = true;
             infoSuffixPrefix.WidthOfNumericalPart = Convert.ToInt32(txtWidthofNumericalPart.Text.ToString());
         }
         else
         {
             infoSuffixPrefix.PrefillWithZero      = false;
             infoSuffixPrefix.WidthOfNumericalPart = 0;
         }
         infoSuffixPrefix.Narration      = txtNarration.Text.Trim();
         infoSuffixPrefix.Extra1         = string.Empty;
         infoSuffixPrefix.Extra2         = string.Empty;
         infoSuffixPrefix.SuffixprefixId = decSuffixPrefixId;
         if (spSuffixPrefix.SuffixPrefixCheckExistenceForAdd(txtFromDate.Text.ToString(), txtToDate.Text.ToString(), Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString()), decSuffixPrefixId) == false)
         {
             if (spSuffixPrefix.SuffixPrefixSettingsEdit(infoSuffixPrefix))
             {
                 Messages.UpdatedMessage();
                 Clear();
             }
             else
             {
                 Messages.ReferenceExistsMessageForUpdate();
                 cmbVoucherType.Focus();
             }
         }
         else
         {
             Messages.InformationMessage("Voucher type already exist for  dates");
             cmbVoucherType.Focus();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "SPS5" + ex.Message;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// save function
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         SuffixPrefixSP   spSuffixPrefix   = new SuffixPrefixSP();
         SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
         infoSuffixPrefix.FromDate = Convert.ToDateTime(txtFromDate.Text.ToString());
         infoSuffixPrefix.ToDate   = Convert.ToDateTime(txtToDate.Text.ToString());
         String strvouchertype = (cmbVoucherType.SelectedValue.ToString());
         infoSuffixPrefix.VoucherTypeId = Convert.ToDecimal(strvouchertype.ToString());
         infoSuffixPrefix.Suffix        = txtSufix.Text.Trim();
         infoSuffixPrefix.Prefix        = txtPrefix.Text.Trim();
         infoSuffixPrefix.StartIndex    = Convert.ToDecimal(txtStartIndex.Text.ToString());
         if (cbxPrefillWithZero.Checked)
         {
             infoSuffixPrefix.PrefillWithZero      = true;
             infoSuffixPrefix.WidthOfNumericalPart = Convert.ToInt32(txtWidthofNumericalPart.Text.ToString());
         }
         else
         {
             infoSuffixPrefix.PrefillWithZero      = false;
             infoSuffixPrefix.WidthOfNumericalPart = 0;
         }
         infoSuffixPrefix.Narration = txtNarration.Text.Trim();
         infoSuffixPrefix.Extra1    = string.Empty;
         infoSuffixPrefix.Extra2    = string.Empty;
         if (spSuffixPrefix.SuffixPrefixCheckExistenceForAdd(txtFromDate.Text.ToString(), txtToDate.Text.ToString(), Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString()), 0) == false)
         {
             if (spSuffixPrefix.SuffixPrefixAddWithId(infoSuffixPrefix))
             {
                 Messages.SavedMessage();
                 Clear();
             }
         }
         else
         {
             Messages.InformationMessage("Voucher type already exist for  dates");
             cmbVoucherType.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SPS4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Edit function
 /// </summary>
 public void EditFunction()
 {
     try
     {
         SuffixPrefixSP spSuffixPrefix = new SuffixPrefixSP();
         SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
         infoSuffixPrefix.FromDate = Convert.ToDateTime(txtFromDate.Text.ToString());
         infoSuffixPrefix.ToDate = Convert.ToDateTime(txtToDate.Text.ToString());
         String strvouchertype = (cmbVoucherType.SelectedValue.ToString());
         infoSuffixPrefix.VoucherTypeId = Convert.ToDecimal(strvouchertype.ToString());
         infoSuffixPrefix.Prefix = txtPrefix.Text.Trim();
         infoSuffixPrefix.Suffix = txtSufix.Text.Trim();
         infoSuffixPrefix.StartIndex = Convert.ToDecimal(txtStartIndex.Text.ToString());
         if (cbxPrefillWithZero.Checked)
         {
             infoSuffixPrefix.PrefillWithZero = true;
             infoSuffixPrefix.WidthOfNumericalPart = Convert.ToInt32(txtWidthofNumericalPart.Text.ToString());
         }
         else
         {
             infoSuffixPrefix.PrefillWithZero = false;
             infoSuffixPrefix.WidthOfNumericalPart = 0;
         }
         infoSuffixPrefix.Narration = txtNarration.Text.Trim();
         infoSuffixPrefix.Extra1 = string.Empty;
         infoSuffixPrefix.Extra2 = string.Empty;
         infoSuffixPrefix.SuffixprefixId = decSuffixPrefixId;
         if (spSuffixPrefix.SuffixPrefixCheckExistenceForAdd(txtFromDate.Text.ToString(), txtToDate.Text.ToString(), Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString()), decSuffixPrefixId) == false)
         {
             if (spSuffixPrefix.SuffixPrefixSettingsEdit(infoSuffixPrefix))
             {
                 Messages.UpdatedMessage();
                 Clear();
             }
             else
             {
                 Messages.ReferenceExistsMessageForUpdate();
                 cmbVoucherType.Focus();
             }
         }
         else
         {
             Messages.InformationMessage("Voucher type already exist for  dates");
             cmbVoucherType.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SPS5" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }