Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindGrid();
            }

            if (Session["CartList"] != null && ((List <InventoryCatalogue>)Session["CartList"]).Count != 0)
            {
                List <InventoryCatalogue> cartList = (List <InventoryCatalogue>)Session["CartList"];

                GridViewCheckOut.Visible    = true;
                GridViewCheckOut.DataSource = cartList;
                GridViewCheckOut.DataBind();

                LblCount.Text      = "Number of items requested: " + cartList.Count();
                LblCount.ForeColor = Color.Black;

                BtnCheckOut.Visible = true;
            }
            else
            {
                LblCount.Text            = "You can make stationery requisition now";
                LblCount.ForeColor       = Color.Black;
                GridViewCheckOut.Visible = false;
                BtnCheckOut.Visible      = false;
            }
        }
Ejemplo n.º 2
0
        protected void GridViewCheckOut_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            List <InventoryCatalogue> ic = (List <InventoryCatalogue>)Session["CartList"];

            GridViewCheckOut.PageIndex  = e.NewPageIndex;
            GridViewCheckOut.DataSource = ic;
            GridViewCheckOut.DataBind();
        }
Ejemplo n.º 3
0
        protected void GridViewCheckOut_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string ItemID = Convert.ToString(GridViewCheckOut.DataKeys[e.RowIndex].Values[0]);
            List <InventoryCatalogue> ic    = (List <InventoryCatalogue>)Session["CartList"];
            List <InventoryCatalogue> icNew = RequisitionLogic.DeleteOrder(ic, ItemID);

            GridViewCheckOut.DataSource = icNew;
            GridViewCheckOut.DataBind();
            Session["CartList"] = icNew;
            Response.Redirect("~/DepartmentEmployee/ViewCatalogue.aspx");
        }