protected void btnSearch_Click(object sender, EventArgs e)
        {
            //Search and display items in the popup

            dt = (DataTable)Session["data"];
            if (dt.Rows.Count != 0)
            {
                saveGridValues();
            }

            List <String> cg = rs.getItemCategory();

            cg.Insert(0, "All");
            ddlPopupCategory.DataSource = cg;
            ddlPopupCategory.DataBind();


            String sCat = ddlCategory.SelectedValue.ToString();

            if (sCat == "All")
            {
                List <Stock> la = st.getStock();
                ItemDetailsGrid.DataSource = la;
                ItemDetailsGrid.DataBind();
            }
            else
            {
                List <Stock> lc = st.getStockByCategory(sCat);
                ItemDetailsGrid.DataSource = lc;
                ItemDetailsGrid.DataBind();
            }
            ddlPopupCategory.Text = ddlCategory.SelectedValue;
            mpe1.Show();
        }
        protected void btnPopupSearch_Click(object sender, EventArgs e)
        {
            String sCat = ddlPopupCategory.SelectedValue.ToString();

            ItemDetailsGrid.DataSource = stControl.getStockByCategory(sCat);
            ItemDetailsGrid.DataBind();
        }
Example #3
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            dt = (DataTable)Session["data"];
            if (dt.Rows.Count != 0)
            {
                try
                {
                    saveGridVaules();
                }
                catch (Exception ex)
                {
                    lblStatus.ForeColor = System.Drawing.Color.Red;
                    lblStatus.Text      = "Failed to remove the item";
                }
            }
            ddlPopupCategory.DataSource = ssControl.getCategoryList();
            ddlPopupCategory.DataBind();
            String category = ddlCategory.SelectedItem.Text;

            if (category != null)
            {
                itemList = ssControl.getStockByCategory(category);
                if (itemList != null)
                {
                    ItemDetailsGrid.DataSource = itemList;
                    ItemDetailsGrid.DataBind();
                }
                else
                {
                    lblStatus.ForeColor = System.Drawing.Color.Red;
                    lblStatus.Text      = "No items found for this category";
                }
            }
            mpe1.Show();
        }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            String category = ddlCategory.SelectedItem.Text;

            ddlPopupCategory.DataSource = cpControl.getItemCategory();
            ddlPopupCategory.DataBind();
            ItemDetailsGrid.DataSource = stControl.getStockByCategory(category);
            ItemDetailsGrid.DataBind();
            mpe1.Show();
        }
Example #5
0
        protected void btnPopupSearch_Click(object sender, EventArgs e)
        {
            String category = ddlPopupCategory.SelectedItem.Text;

            itemList = ssControl.getStockByCategory(category);
            if (itemList != null)
            {
                ItemDetailsGrid.DataSource = itemList;
                ItemDetailsGrid.DataBind();
            }
            else
            {
                lblStatus.ForeColor = System.Drawing.Color.Red;
                lblPopupStatus.Text = "No items found for this category";
            }
        }
        protected void btnPopupSearch_Click(object sender, EventArgs e)
        {
            String sCat = ddlPopupCategory.SelectedValue.ToString();

            if (sCat == "All")
            {
                List <Stock> la = st.getStock();
                ItemDetailsGrid.DataSource = la;
                ItemDetailsGrid.DataBind();
            }
            else
            {
                List <Stock> lc = st.getStockByCategory(sCat);
                ItemDetailsGrid.DataSource = lc;
                ItemDetailsGrid.DataBind();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //Populating Initial values

                lblReqID.Text   = rs.getCurrentReqID().ToString();
                lblReqDate.Text = System.DateTime.Today.Date.ToShortDateString();

                List <String> cg = rs.getItemCategory();
                cg.Insert(0, "All");
                ddlCategory.DataSource = cg;
                ddlCategory.DataBind();

                List <Stock> l = st.getStock();
                ItemDetailsGrid.DataSource = l;
                ItemDetailsGrid.DataBind();

                //Datatable definition

                dt.Columns.AddRange(new DataColumn[5] {
                    new DataColumn("ItemCode", typeof(String)),
                    new DataColumn("ItemCategory", typeof(string)),
                    new DataColumn("ItemDescription", typeof(string)),
                    new DataColumn("Quantity", typeof(int)),
                    new DataColumn("key", typeof(int))
                });

                Session["data"] = dt;

                lblComments.Visible = false;
                txtComments.Visible = false;
                btnCancel.Visible   = false;
                btnSave.Visible     = false;
            }
        }