예제 #1
0
 /// <summary>
 /// grid double click fill the items in controll for edit
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvSuffixPrefixSettings_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex != -1)
         {
             SuffixPrefixSP   spSuffixPrefix   = new SuffixPrefixSP();
             SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
             infoSuffixPrefix             = spSuffixPrefix.SuffixPrefixView(Convert.ToDecimal(dgvSuffixPrefixSettings.Rows[e.RowIndex].Cells["dgvtxtSuffixPrefixId"].Value.ToString()));
             decSuffixPrefixId            = Convert.ToDecimal(dgvSuffixPrefixSettings.Rows[e.RowIndex].Cells["dgvtxtSuffixPrefixId"].Value.ToString());
             txtFromDate.Text             = infoSuffixPrefix.FromDate.ToString("dd-MMM-yyyy");
             txtToDate.Text               = infoSuffixPrefix.ToDate.ToString("dd-MMM-yyyy");
             cmbVoucherType.SelectedValue = infoSuffixPrefix.VoucherTypeId.ToString();
             txtStartIndex.Text           = infoSuffixPrefix.StartIndex.ToString();
             txtStartIndex.Enabled        = false;
             txtSufix.Text  = infoSuffixPrefix.Suffix;
             txtPrefix.Text = infoSuffixPrefix.Prefix;
             if (infoSuffixPrefix.PrefillWithZero == true)
             {
                 cbxPrefillWithZero.Checked   = true;
                 txtWidthofNumericalPart.Text = infoSuffixPrefix.WidthOfNumericalPart.ToString();
             }
             else
             {
                 cbxPrefillWithZero.Checked   = false;
                 txtWidthofNumericalPart.Text = infoSuffixPrefix.WidthOfNumericalPart.ToString();
             }
             txtNarration.Text = infoSuffixPrefix.Narration;
             btnSave.Text      = "Update";
             btnDelete.Enabled = true;
             txtFromDate.Focus();
             txtWidthofNumericalPart.Enabled = true;
             if (cbxPrefillWithZero.Checked == true)
             {
                 txtWidthofNumericalPart.Enabled = true;
             }
             else
             {
                 txtWidthofNumericalPart.Enabled = false;
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "SPS20" + ex.Message;
     }
 }
 /// <summary>
 /// grid double click fill the items in controll for edit
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvSuffixPrefixSettings_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex != -1)
         {
             SuffixPrefixSP spSuffixPrefix = new SuffixPrefixSP();
             SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
             infoSuffixPrefix = spSuffixPrefix.SuffixPrefixView(Convert.ToDecimal(dgvSuffixPrefixSettings.Rows[e.RowIndex].Cells["dgvtxtSuffixPrefixId"].Value.ToString()));
             decSuffixPrefixId = Convert.ToDecimal(dgvSuffixPrefixSettings.Rows[e.RowIndex].Cells["dgvtxtSuffixPrefixId"].Value.ToString());
             txtFromDate.Text = infoSuffixPrefix.FromDate.ToString("dd-MMM-yyyy");
             txtToDate.Text = infoSuffixPrefix.ToDate.ToString("dd-MMM-yyyy");
             cmbVoucherType.SelectedValue = infoSuffixPrefix.VoucherTypeId.ToString();
             txtStartIndex.Text = infoSuffixPrefix.StartIndex.ToString();
             txtStartIndex.Enabled = false;
             txtSufix.Text = infoSuffixPrefix.Suffix;
             txtPrefix.Text = infoSuffixPrefix.Prefix;
             if (infoSuffixPrefix.PrefillWithZero == true)
             {
                 cbxPrefillWithZero.Checked = true;
                 txtWidthofNumericalPart.Text = infoSuffixPrefix.WidthOfNumericalPart.ToString();
             }
             else
             {
                 cbxPrefillWithZero.Checked = false;
                 txtWidthofNumericalPart.Text = infoSuffixPrefix.WidthOfNumericalPart.ToString();
             }
             txtNarration.Text = infoSuffixPrefix.Narration;
             btnSave.Text = "Update";
             btnDelete.Enabled = true;
             txtFromDate.Focus();
             txtWidthofNumericalPart.Enabled = true;
             if (cbxPrefillWithZero.Checked == true)
             {
                 txtWidthofNumericalPart.Enabled = true;
             }
             else
             {
                 txtWidthofNumericalPart.Enabled = false;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SPS20" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }