/// <summary>
 /// Loads the ViewAdjustmentVoucherList form
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["voucherNo"] == null)
         {
             vavlCtrl = new ViewAdjustmentVoucherListControl();
             StationeryStoreInventorySystemController.Util.PutSession(sessionKey, vavlCtrl);
         }
         else
         {
             if (Request.QueryString["action"] != null)
             {
                 vavlCtrl = new ViewAdjustmentVoucherListControl();
                 StationeryStoreInventorySystemController.Util.PutSession(sessionKey, vavlCtrl);
             }
             else
             {
                 vavlCtrl = (ViewAdjustmentVoucherListControl)StationeryStoreInventorySystemController.Util.GetSession(sessionKey);
             }
             voucherNo = Request.QueryString["voucherNo"].ToString();
             vavlCtrl.SelectStockAdjustmentVoucher(voucherNo);
             FillAdjustmentDetails(vavlCtrl.StockAdjustmentDetail);
             WebGroupBox1.Visible = true;
         }
         FillAdjustmentList(vavlCtrl.StockAdjustmentList);
     }
     else
     {
         vavlCtrl = (ViewAdjustmentVoucherListControl)StationeryStoreInventorySystemController.Util.GetSession(sessionKey);
     }
 }
 ///// <summary>
 ///// Fills Adjustment Report Data to Datagrid
 ///// </summary>
 ///// <param name="dtAdjustmentReport"></param>
 //private void FillAdjustmentReport()
 //{
 //    try
 //    {
 //        vavlCtrl = GetControl();
 //        DataTable dtAdjustmentReport = vavlCtrl.StockAdjustmentDetail;
 //        DgvAdjustmentVoucher.DataSource = dtAdjustmentReport;
 //        DgvAdjustmentVoucher.DataBind();
 //    }
 //    catch (Exception e)
 //    {
 //        Logger.WriteErrorLog(e);
 //    }
 //}
 private ViewAdjustmentVoucherListControl GetControl()
 {
     if (vavlCtrl == null)
         vavlCtrl = new ViewAdjustmentVoucherListControl();
     return vavlCtrl;
 }
 /// <summary>
 /// Fills Adjustment List to Datagrid
 /// </summary>
 /// <param name="dtAdjustmentList"></param>
 private void FillAdjustmentList(DataTable dtAdjustmentList)
 {
     try
     {
         vavlCtrl = GetControl();
         if (dtAdjustmentList != null)
         {
             DgvAdjustmentVoucherList.DataSource = dtAdjustmentList;
             DgvAdjustmentVoucherList.DataBind();
         }
     }
     catch(Exception e)
     {
         Logger.WriteErrorLog(e);
     }
 }