protected void Page_Load(object sender, EventArgs e)
        {
            using (var db = new bigshopeEntities())
            {
                var query = db.showBrands();
                DLBrnd.DataSource = query;
                DLBrnd.DataBind();

                var qury = db.showProcessor();
                DLProc.DataSource = qury;
                DLProc.DataBind();

                var qry = db.showGen();
                DLGen.DataSource = qry;
                DLGen.DataBind();
            }
        }
        private void FillCatagories()
        {
            using (var db = new bigshopeEntities())
            {
                var query_brnd = db.showBrands();
                GV_Brnds.DataSource = query_brnd;
                GV_Brnds.DataBind();

                var query_proc = db.showProcessor();
                GV_Proc.DataSource = query_proc;
                GV_Proc.DataBind();

                var query_gen = db.showGen();
                GV_Gen.DataSource = query_gen;
                GV_Gen.DataBind();
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            if (Request.QueryString["prod_id"] != null)
            {
                using (var db = new bigshopeEntities())
                {
                    int        prod_id = Convert.ToInt32(Request.QueryString["prod_id"]);
                    tblProduct p       = db.tblProducts.FirstOrDefault(v => v.prod_id == prod_id);
                    tbName.Text  = p.prod_name;
                    tbDesc.Text  = p.prod_desc;
                    tbPrice.Text = Convert.ToString(p.prod_price);
                    tbQty.Text   = Convert.ToString(p.prod_qnty);
                    tbRAM.Text   = p.prod_ram;
                }
            }
            using (var db = new bigshopeEntities())
            {
                var query_brnd = db.showBrands();
                slctBrand.DataSource     = query_brnd;
                slctBrand.DataValueField = "brnd_id";
                slctBrand.DataTextField  = "brnd_name";
                slctBrand.DataBind();
                slctBrand.Items.Insert(0, new ListItem("-- Select a brand --", "0"));

                var query_proc = db.showProcessor();
                slctProc.DataSource     = query_proc;
                slctProc.DataValueField = "proc_id";
                slctProc.DataTextField  = "proc_name";
                slctProc.DataBind();
                slctProc.Items.Insert(0, new ListItem("-- Select a processor --", "0"));

                var query_gen = db.showGen();
                slctGen.DataSource     = query_gen;
                slctGen.DataValueField = "gen_id";
                slctGen.DataTextField  = "gen_name";
                slctGen.DataBind();
                slctGen.Items.Insert(0, new ListItem("-- Select a generation --", "0"));
            }
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            if (Request.QueryString["brnd_id"] != null)
            {
                using (var db = new bigshopeEntities())
                {
                    int brnd_id = Convert.ToInt32(Request.QueryString["brnd_id"]);
                    var qryBrnd = db.showProdByBrnds(brnd_id);
                    RP.DataSource = qryBrnd;
                    RP.DataBind();
                }
            }

            else if (Request.QueryString["proc_id"] != null)
            {
                using (var db = new bigshopeEntities())
                {
                    int proc_id = Convert.ToInt32(Request.QueryString["proc_id"]);
                    var qryProc = db.showProdByProc(proc_id);
                    RP.DataSource = qryProc;
                    RP.DataBind();
                }
            }

            else if (Request.QueryString["gen_id"] != null)
            {
                using (var db = new bigshopeEntities())
                {
                    int gen_id = Convert.ToInt32(Request.QueryString["gen_id"]);
                    var qryGen = db.showProdByProc(gen_id);
                    RP.DataSource = qryGen;
                    RP.DataBind();
                }
            }

            else if (Request.QueryString["search"] != null)
            {
                using (var db = new bigshopeEntities())
                {
                    var qrySrch = db.searchProducts(Request.QueryString["search"].ToString());
                    RP.DataSource = qrySrch;
                    RP.DataBind();
                }
            }

            else
            {
                using (var db = new bigshopeEntities())
                {
                    var query = db.showProducts();
                    RP.DataSource = query;
                    RP.DataBind();

                    var queryBrnd = db.showBrands();
                    DLBrnd.DataSource = queryBrnd;
                    DLBrnd.DataBind();

                    var quryProc = db.showProcessor();
                    DLProc.DataSource = quryProc;
                    DLProc.DataBind();

                    var qryGen = db.showGen();
                    DLGen.DataSource = qryGen;
                    DLGen.DataBind();
                }
            }
        }