/// <summary>
        /// Fill function to updation
        /// </summary>
        /// <param name="isPending"></param>
        public void FillRegisterOrReport(bool isPending)
        {
            try
            {
                PurchaseOrderMasterInfo infoPurchaseOrderMaster = new PurchaseOrderMasterInfo();

                VoucherTypeBll BllVoucherType = new VoucherTypeBll();
                PurchaseOrderBll BllPurchaseOrder = new PurchaseOrderBll();
                btnSave.Text = "Update";
                btnDelete.Enabled = true;
                txtOrderNo.ReadOnly = true;
                infoPurchaseOrderMaster = BllPurchaseOrder.PurchaseOrderMasterView(decPurchaseOrderMasterId);
                txtOrderNo.Text = infoPurchaseOrderMaster.InvoiceNo;
                strVoucherNo = infoPurchaseOrderMaster.VoucherNo.ToString();
                decPurchaseSuffixPrefixId = Convert.ToDecimal(infoPurchaseOrderMaster.SuffixPrefixId);
                decPurchaseVoucherId = Convert.ToDecimal(infoPurchaseOrderMaster.VoucherTypeId);
                isAutomatic = BllVoucherType.CheckMethodOfVoucherNumbering(decPurchaseVoucherId);
                decPurchaseOrderTypeId = decPurchaseVoucherId;
                txtDate.Text = infoPurchaseOrderMaster.Date.ToString("dd-MMM-yyyy");
                cmbCashOrParty.SelectedValue = infoPurchaseOrderMaster.LedgerId;
                txtDueDate.Text = infoPurchaseOrderMaster.DueDate.ToString("dd-MMM-yyyy");
                TimeSpan objTs = Convert.ToDateTime(txtDueDate.Text).Subtract(Convert.ToDateTime(txtDate.Text));
                txtDueDays.Text = objTs.Days.ToString();
                txtNarration.Text = infoPurchaseOrderMaster.Narration;
                cmbCurrency.SelectedValue = infoPurchaseOrderMaster.exchangeRateId;
                txtTotalAmount.Text = infoPurchaseOrderMaster.TotalAmount.ToString();
                List<DataTable> ListObj = new List<DataTable>();
                if (isPending)
                {
                    ListObj = BllPurchaseOrder.PurchaseOrderDetailsViewWithRemaining(decPurchaseOrderMasterId);
                }
                else
                {
                    ListObj = BllPurchaseOrder.PurchaseOrderDetailsViewByMasterId(decPurchaseOrderMasterId);
                }
                if (CheckCancelStatus(decPurchaseOrderMasterId))
                {
                    isCheck = true;
                    cbxCancel.Checked = true;
                    cbxCancel.Enabled = false;
                    isCheck = false;
                }
                else
                {
                    isCheck = true;
                    cbxCancel.Enabled = true;
                    //  cbxCancel.Checked = false;
                    isCheck = false;
                }
                dgvPurchaseOrder.Rows.Clear();
                for (int i = 0; i < ListObj[0].Rows.Count; i++)
                {
                    isAmountcalc = false;
                    dgvPurchaseOrder.Rows.Add();
                    dgvPurchaseOrder.Rows[i].HeaderCell.Value = string.Empty;
                    dgvPurchaseOrder.Rows[i].Cells["dgvtxtPurchaseOrderDetailsId"].Value = Convert.ToDecimal(ListObj[0].Rows[i]["purchaseOrderDetailsId"].ToString());
                    decPurchaseOrderDetailId = Convert.ToDecimal(ListObj[0].Rows[i]["purchaseOrderDetailsId"].ToString());
                    dgvPurchaseOrder.Rows[i].Cells["dgvtxtProductId"].Value = ListObj[0].Rows[i]["productId"].ToString();
                    dgvPurchaseOrder.Rows[i].Cells["dgvtxtProductCode"].Value = ListObj[0].Rows[i]["productCode"].ToString();
                    dgvPurchaseOrder.Rows[i].Cells["dgvtxtProductName"].Value = ListObj[0].Rows[i]["productName"].ToString();
                    dgvPurchaseOrder.Rows[i].Cells["dgvtxtQty"].Value = ListObj[0].Rows[i]["qty"].ToString();
                    UnitComboFill(Convert.ToDecimal(ListObj[0].Rows[i]["productId"].ToString()), i, dgvPurchaseOrder.Rows[i].Cells["dgvcmbUnit"].ColumnIndex);
                    dgvPurchaseOrder.Rows[i].Cells["dgvcmbUnit"].Value = Convert.ToDecimal(ListObj[0].Rows[i]["unitId"].ToString());
                    dgvPurchaseOrder.Rows[i].Cells["dgvtxtUnitConversionId"].Value = ListObj[0].Rows[i]["unitConversionId"].ToString();
                    dgvPurchaseOrder.Rows[i].Cells["dgvtxtUnitConversionRate"].Value = ListObj[0].Rows[i]["conversionRate"].ToString();
                    dgvPurchaseOrder.Rows[i].Cells["dgvtxtRate"].Value = ListObj[0].Rows[i]["rate"].ToString();
                    dgvPurchaseOrder.Rows[i].Cells["dgvtxtAmount"].Value = ListObj[0].Rows[i]["amount"].ToString();
                    dgvPurchaseOrder.Rows[i].Cells["dgvtxtProductName"].ReadOnly = true;
                    dgvPurchaseOrder.Rows[i].Cells["dgvtxtProductCode"].ReadOnly = true;
                    dgvPurchaseOrder.Rows[i].Cells["dgvtxtBarcode"].ReadOnly = true;
                }
                SerialNo();
                isAmountcalc = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("PO25:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }