예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        lblErrorLot.Text    = "";
        lblErrorSpace.Text  = "";
        lblErrorLane.Text   = "";
        lbldeleteError.Text = "";

        ClientScript.RegisterStartupScript(GetType(), "SetHeaderMenu", String.Format("SetHeaderMenu('liInventory','{0}');", ResourceMgr.GetMessage("Inventory")), true);
        ViewState["spaceid"] = ViewState["spaceid"] == null ? 0 : ViewState["spaceid"];

        pageSize = 5;
        if (!IsPostBack)
        {
            //lblErrorLot.Visible = false;
            if (Request.QueryString["lotid"] != null)
            {
                hidLotId.Value   = Request.QueryString["lotid"];
                pnlSpace.Visible = true;
                pnlLot.Visible   = false;
                pnlLane.Visible  = false;
                LoadRows(1);
                DataSet ds = Lots.getParkingLotNumberByLotId(Convert.ToInt32(hidLotId.Value));
                //lblLotNumber.Visible = true;
                lblLotNumberSpace.Text = ds.Tables[0].Rows[0][0].ToString();
            }
            else if (Request.QueryString["fid"] != null)
            {
                hndfacilityId.Value = Request.QueryString["fid"];

                DataSet ds = Facility.GetFacilityNameByFacilityId(Conversion.ParseInt(hndfacilityId.Value));
                lblfacilityname.Text = ds.Tables[0].Rows[0][0].ToString();

                LoadLots(1, Conversion.ParseInt(hndfacilityId.Value));
            }
            else if (Request.QueryString["fids"] != null)
            {
                hndfacilityId.Value = Request.QueryString["fids"];
                DataSet ds = Facility.GetFacilityNameByFacilityId(Conversion.ParseInt(hndfacilityId.Value));
                lblfacilityname.Text = ds.Tables[0].Rows[0][0].ToString();

                LoadLots(1, Conversion.ParseInt(hndfacilityId.Value));
            }


            else
            {
                LoadLots(1);
            }
        }
        else
        {
            if (TotalItems > 0)
            {
                pgrLots.DrawPager(CurrentPage, TotalItems, pageSize, MaxPagesToShow);
            }

            if (TotalItemsR > 0)
            {
                pgrRows.DrawPager(CurrentPageR, TotalItemsR, pageSize, MaxPagesToShow);
            }

            if (TotalItemsR2 > 0)
            {
                pgrSpaces.DrawPager(CurrentPageR2, TotalItemsR2, pageSize, MaxPagesToShow);
            }
        }
    }