protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack.IsFalse())
     {
         String match = HttpContext.Current.Request.QueryString["Match"];
         if (match == "editVoucher")
         {
             InitializeCombo();
             InitializeSession();
             String      vocherNo = HttpContext.Current.Request.QueryString["VoucherNo"];
             Acc_Voucher item     = manager.GetAllAcc_Voucher(vocherNo);
             CustomList <Acc_Voucher> VoucherList = new CustomList <Acc_Voucher>();
             VoucherList.Add(item);
             AccVoucherList = VoucherList;
             PopulatePFVoucherInformation(item);
         }
         else
         {
             InitializeCombo();
             btnNew_Click(null, null);
         }
     }
     else
     {
         Page.ClientScript.GetPostBackEventReference(this, String.Empty);
         String eventTarget = Request["__EVENTTARGET"].IsNullOrEmpty() ? String.Empty : Request["__EVENTTARGET"];
         if (eventTarget == "SearchPFVoucher")
         {
             Acc_Voucher searchAccVoucher         = Session[StaticInfo.SearchSessionVarName] as Acc_Voucher;
             CustomList <Acc_Voucher> VoucherList = new CustomList <Acc_Voucher>();
             VoucherList.Add(searchAccVoucher);
             AccVoucherList = VoucherList;
             if (searchAccVoucher.IsNotNull())
             {
                 PopulatePFVoucherInformation(searchAccVoucher);
             }
         }
         else if (eventTarget == "vou_delete")
         {
             btnDelete_Click(null, null);
         }
     }
 }
Exemple #2
0
        protected void btnFind_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                //FormUtil.ClearForm(this, FormClearOptions.ClearAll, false);
                InitializeSession();

                CustomList <Acc_Voucher>    items   = manager.GetAllAcc_Voucher(VoucherType);
                Dictionary <string, string> columns = new Dictionary <string, string>();

                columns.Add("VoucherNo", "Voucher No");
                columns.Add("VoucherDate", "Voucher Date");

                StaticInfo.SearchItem(items, "Voucher", "SearchVoucher", FRAMEWORK.SearchColumnConfig.GetColumnConfig(typeof(Acc_Voucher), columns), 500);
            }
            catch (Exception ex)
            {
                ((PageBase)this.Page).ErrorMessage = ("Error: <br>" + ex.Message + "<br>Call Stack: <br>" + ex.StackTrace);
            }
        }