コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                Session["ObjVoucher"] = null;
                this.CheckFromURL();
                this.GetVoucherId();
                this.LoadInitialData();
                this.SetData();
            }

            if (IsCallback)
            {
                DataSet ds;
                if (Session["VoucherPOList"] == null)
                {
                    ds = new PODAO().GetAllPayablePOs();
                    Session["VoucherPOList"] = ds;
                }
                else
                {
                    ds = (DataSet)Session["VoucherPOList"];
                }
                dxgvPODetails.DataSource = ds;
                dxgvPODetails.DataBind();
            }
        }
        catch (Exception ex)
        {
            ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void Page_Load(object sender, EventArgs e)");
            Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false);
        }
    }
コード例 #2
0
    protected void dxgvPODetails_BeforePerformDataSelect(object sender, EventArgs e)
    {
        try
        {
            if ((sender as ASPxGridView).GetMasterRowKeyValue() == null)
            {
                return;
            }
            Int32 POId = Int32.Parse((sender as ASPxGridView).GetMasterRowKeyValue().ToString());
            PO tempPO = new PO();
            tempPO.POId = POId;
            DataSet ds = new PODAO().GetPOItemsByPOID(tempPO);
            (sender as ASPxGridView).DataSource = ds;

        }
        catch (Exception ex)
        {
            ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void dxgvPODetails_BeforePerformDataSelect(object sender, EventArgs e)");
            if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty)
                Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false);
            else
                Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false);
        }
    }