Example #1
0
 private void SearchGrid()
 {
     if (ddlCategory.SelectedValue != "0")
     {
         gridProduct.DataSource = DataSouceShowProduct.Where(x => x.CATEGORY_ID == Convert.ToInt32(ddlCategory.SelectedValue) &&
                                                             x.PRODUCT_CODE.ToUpper().Contains(txtProductCode.Text.ToUpper()));
     }
     else
     {
         gridProduct.DataSource = DataSouceShowProduct.Where(x => x.PRODUCT_CODE.ToUpper().Contains(txtProductCode.Text.ToUpper()));
     }
     gridProduct.DataBind();
 }
Example #2
0
        private void InitDataPopUp()
        {
            var cmd  = new ColorService();
            var list = cmd.GetALL();

            foreach (var item in list)
            {
                ddlColor.Items.Add(new ListItem(item.COLOR_NAME, item.COLOR_ID.ToString()));
            }

            var cmdType  = new TraceryService();
            var listType = cmdType.GetALL();

            foreach (var item in listType)
            {
                ddlColorType.Items.Add(new ListItem(item.COLOR_TYPE_NAME, item.COLOR_TYPE_ID.ToString()));
            }

            this.lblProduct.Text        = _product.PRODUCT_NAME;
            this.lblTxtProductCode.Text = _product.PRODUCT_CODE;
            this.lblPriceProduct.Text   = DataSouceShowProduct.Where(x => x.PRODUCT_ID == _product.PRODUCT_ID).FirstOrDefault().PRICE.ToString();
            this.lblPacking.Text        = _product.PRODUCT_PACKING_DESC;
        }