/// <summary>
        /// Function to get details for vouchertype combobox for purchase invoice
        /// </summary>
        /// <returns></returns>
        public List<DataTable> VoucherTypeComboFillForPurchaseInvoice()
        {
            PurchaseDetailsSP SPPurchaseDetails = new PurchaseDetailsSP();
               List<DataTable> ListObj = new List<DataTable>();
               try
               {
               ListObj = SPPurchaseDetails.VoucherTypeComboFillForPurchaseInvoice();
               }
               catch (Exception ex)
               {
               MessageBox.Show("PIBll 5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);

               }
               return ListObj;
        }
        /// <summary>
        /// Function to get particular values from PurchaseDetails table based on purchasemasterid with pending quantity
        /// </summary>
        /// <param name="decPurchaseMasterId"></param>
        /// <param name="decPurchaseReturnMasterId"></param>
        /// <param name="decVoucherTypeId"></param>
        /// <returns></returns>
        public List<DataTable> PurchaseDetailsViewByPurchaseMasterIdWithRemaining(decimal decPurchaseMasterId, decimal decPurchaseReturnMasterId, decimal decVoucherTypeId)
        {
            PurchaseDetailsSP SPPurchaseDetails = new PurchaseDetailsSP();
               List<DataTable> ListObj = new List<DataTable>();
               try
               {
               ListObj = SPPurchaseDetails.PurchaseDetailsViewByPurchaseMasterIdWithRemaining(decPurchaseMasterId, decPurchaseReturnMasterId, decVoucherTypeId);
               }
               catch (Exception ex)
               {
               MessageBox.Show("PIBll 6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);

               }
               return ListObj;
        }
 public void PurchaseDetailsEdit(PurchaseDetailsInfo purchasedetailsinfo)
 {
     PurchaseDetailsSP SPPurchaseDetails = new PurchaseDetailsSP();
        try
        {
        SPPurchaseDetails.PurchaseDetailsEdit(purchasedetailsinfo);
        }
        catch (Exception ex)
        {
        MessageBox.Show("PIBll 31:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
 }
        /// <summary>
        /// Function to get particular values from PurchaseDetails table by productName
        /// </summary>
        /// <param name="decVoucherTypeId"></param>
        /// <param name="strProductName"></param>
        /// <returns></returns>
        public List<DataTable> PurchaseDetailsViewByProductNameForPI(decimal decVoucherTypeId, string strProductName)
        {
            PurchaseDetailsSP SPPurchaseDetails = new PurchaseDetailsSP();
               List<DataTable> ListObj = new List<DataTable>();
               try
               {
               ListObj = SPPurchaseDetails.PurchaseDetailsViewByProductNameForPI(decVoucherTypeId, strProductName);
               }
               catch (Exception ex)
               {
               MessageBox.Show("PIBll 8:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);

               }
               return ListObj;
        }
        /// <summary>
        /// Function to delete particular details based on the parameter
        /// </summary>
        /// <param name="PurchaseDetailsId"></param>
        public void PurchaseDetailsDelete(decimal PurchaseDetailsId)
        {
            PurchaseDetailsSP SPPurchaseDetails = new PurchaseDetailsSP();

               try
               {
               SPPurchaseDetails.PurchaseDetailsDelete(PurchaseDetailsId);
               }
               catch (Exception ex)
               {
               MessageBox.Show("PIBll 9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
               }
        }