Ejemplo n.º 1
0
 /// <summary>
 /// Its the fill function to update or delete
 /// </summary>
 public void FillFunction()
 {
     try
     {
         PDCClearanceMasterInfo infoPDCClearance = new PDCClearanceMasterInfo();
         PDCClearanceMasterSP Sppdcclerance = new PDCClearanceMasterSP();
         infoPDCClearance = Sppdcclerance.PDCClearanceMasterView(decPDCClearanceEditId);
         VoucherTypeComboFill();
         strVoucherNo = infoPDCClearance.VoucherNo;
         strInvoiceNo = infoPDCClearance.InvoiceNo;
         txtvoucherNo.Text = strInvoiceNo;
         decSufixprefixPdcpayableID = infoPDCClearance.SuffixPrefixId;
         decPDCclearanceVoucherTypeId = infoPDCClearance.VoucherTypeId;
         VoucherTypeSP spVoucherType = new VoucherTypeSP();
         isAutomatic = spVoucherType.CheckMethodOfVoucherNumbering(decPDCclearanceVoucherTypeId);
         if (isAutomatic)
         {
             txtvoucherNo.ReadOnly = true;
         }
         else
         {
             txtvoucherNo.ReadOnly = false;
         }
         if (infoPDCClearance.PDCClearanceMasterId != 0)
         {
             PDCClearanceMasterSP sppdcClearance = new PDCClearanceMasterSP();
             txtvoucherNo.Text = infoPDCClearance.VoucherNo;
             dtpVoucherDate.Value = infoPDCClearance.Date;
             txtVoucherDate.Text = dtpVoucherDate.Value.ToString("dd-MMM-yyyy");
             txtNarration.Text = infoPDCClearance.Narration;
             cmbvouchertype.Text = infoPDCClearance.Type;
             InvoiceNumberCombofill(cmbvouchertype.Text.ToString(), decMasterIdEdit);
             cmbStatus.Text = infoPDCClearance.Status;
             cmbInvoiceNo.SelectedValue = decMasterIdEdit;
             btnSave.Text = "Update";
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PC14:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }