/// <summary>
        /// Fills Discrepancy Reports to Datagrid
        /// </summary>
        /// <param name="dtDiscrepancy"></param>
        private void FillDiscrepancy()
        {
            //try
            //{
            iavCtrl = GetControl();

            DgvDiscrepancyReportList.DataSource = iavCtrl.DiscrepancyList;
            DgvDiscrepancyReportList.DataBind();
            //}
            //catch (Exception e)
            //{
            //    Logger.WriteErrorLog(e);
            //}
        }
 /// <summary>
 /// Fills Report Details to Label
 /// </summary>
 /// <param name="dtReportDetails"></param>
 //private void FillReportDetails()//DataTable dtReportDetails)
 //{
 //    try
 //    {
 //        lblVoucher.Text = "Text";
 //        lblBy.Text = "By";
 //        lblDateIssue.Text = "Date";
 //        //drdItemList.ValueField = "ID";
 //        //drdItemList.DataSource = dtDetails;
 //        //drdItemList.DataBind();
 //    }
 //    catch (Exception e)
 //    {
 //        Logger.WriteErrorLog(e);
 //    }
 //}
 /// <summary>
 /// Fills Report Data to Datagrid
 /// </summary>
 /// <param name="dtReport"></param>
 //private void FillReport()
 //{
 //    try
 //    {
 //        iavCtrl = GetControl();
 //        DataTable dtReport = iavCtrl.SelectDiscrepancy(Convert.ToInt16(voucherNo));
 //        DgvDiscrepancyReport.DataSource = dtReport;
 //        DgvDiscrepancyReport.DataBind();
 //    }
 //    catch (Exception e)
 //    {
 //        Logger.WriteErrorLog(e);
 //    }
 //}
 private IssueAdjustmentVoucherControl GetControl()
 {
     if (iavCtrl == null)
         iavCtrl = new IssueAdjustmentVoucherControl();
     return iavCtrl;
 }
        /// <summary>
        /// Loads the IssueAdjustmentVoucher form
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            //Response.Write(Util.CheckAdjustment());
            if (!IsPostBack)
            {
                if (Request.QueryString["discrepancyId"] == null)
                {

                    iavCtrl = new IssueAdjustmentVoucherControl();
                    StationeryStoreInventorySystemController.Util.PutSession(sessionKey, iavCtrl);
                }
                else
                {
                    iavCtrl = (IssueAdjustmentVoucherControl)StationeryStoreInventorySystemController.Util.GetSession(sessionKey);
                    int id = Converter.objToInt(Request.QueryString["discrepancyId"]);
                    WebGroupBox1.Visible = true;
                    DgvDiscrepancyReport.DataSource = iavCtrl.SelectDiscrepancy(id);
                    DgvDiscrepancyReport.DataBind();

                    lblDateIssue.Text = Converter.dateTimeToString(Converter.DATE_CONVERTER.DATE, DateTime.Now);
                    string[] array = iavCtrl.IssueAdjustment();
                     lblVoucher.Text = array[0];
                     lblAuthorizedName.Text = array[1];
                     lblBy.Text = array[2];
                }
            }
            else
            {

                iavCtrl = (IssueAdjustmentVoucherControl)StationeryStoreInventorySystemController.Util.GetSession(sessionKey);
            }

            FillDiscrepancy();
        }