Esempio n. 1
0
        public List<ProductDetails> getSubCategory(string SubCategoryName)
        {

            List<ProductDetails> lst = new List<ProductDetails>();

            DBHelper helper = new DBHelper();
            SqlParameter[] param = new SqlParameter[1];
            param[0] = new SqlParameter(CONSTANT.SUB_CAT_NAME, SubCategoryName);

            DataSet ds = helper.executeSelectQuery(PROCEDURES.GET_SUB_CATEGORY_WISE_PRODUCT, param);

            if (ds != null)
            {

                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    ProductDetails sub = new ProductDetails();
                    sub.ProductName = row["Prod_Name"].ToString();
                    sub.ProductImage = row["Prod_Img"].ToString();
                    sub.ProductMRP = row["MRP"].ToString();
                    sub.ProductPrice = row["Selling Price"].ToString();
                    sub.ProductQuanity = row["packed_quantity"].ToString();
                    sub.ProductId = row["Prod_Id"].ToString();
                    sub.ProductBrand = row["Brand_Name"].ToString();
                    lst.Add(sub);
                }
            }


            return lst;

        }
Esempio n. 2
0
        public List<ProductDetails> GetProducts(string searchCondition)
        {

            List<ProductDetails> lst = new List<ProductDetails>();

            DBHelper helper = new DBHelper();
            SqlParameter[] param = new SqlParameter[1];
            param[0] = new SqlParameter(CONSTANT.PRODUCT_SEARCH_CRITERIA, searchCondition);

            DataSet ds = helper.executeSelectQuery(PROCEDURES.PRODUCT_SEARCH, param);

            if (ds != null)
            {

                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    ProductDetails sub = new ProductDetails();
                    sub.ProductName = row["Prod_Name"].ToString();
                    sub.ProductImage = row["Prod_Img"].ToString();
                    sub.ProductMRP = row["MRP"].ToString();
                    sub.ProductPrice = row["Selling Price"].ToString();
                    sub.ProductQuanity = row["packed_quantity"].ToString();
                    sub.ProductId = row["Prod_Id"].ToString();
                    sub.ProductBrand = row["Brand_Name"].ToString();
                    lst.Add(sub);
                }
            }


            return lst;

        }
Esempio n. 3
0
        public List<ProductDetails> GetAllProducts()
        {

            List<ProductDetails> lst = new List<ProductDetails>();

            DBHelper helper = new DBHelper();
           

            DataSet ds = helper.executeSelectQuery(PROCEDURES.GET_ALL_PRODUCTS);

            if (ds != null)
            {

                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    ProductDetails sub = new ProductDetails();
                    sub.ProductName = row["Prod_Name"].ToString();
                    sub.ProductImage = row["Prod_Img"].ToString();
                    sub.ProductMRP = row["MRP"].ToString();
                    sub.ProductPrice = row["Selling Price"].ToString();
                    sub.ProductQuanity = row["packed_quantity"].ToString();
                    sub.ProductId = row["Prod_Id"].ToString();
                    sub.ProductBrand = row["Brand_Name"].ToString();
                    lst.Add(sub);
                }
            }


            return lst;

        
    }
Esempio n. 4
0
        public ProductDetails GetProductBasedOnID(string productId)
        {

           // List<ProductDetails> lst = new List<ProductDetails>();

            DBHelper helper = new DBHelper();
            SqlParameter[] param = new SqlParameter[1];
            param[0] = new SqlParameter(CONSTANT.PRODUCT_ID, productId);
            ProductDetails productDetails = new ProductDetails();
            DataSet ds = helper.executeSelectQuery(PROCEDURES.GET_PRODUCT_ID_WISE_PRODUCT, param);

            if (ds != null)
            {

                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    
                    productDetails.ProductName = row["Prod_Name"].ToString();
                    productDetails.ProductImage = row["Prod_Img"].ToString();
                    productDetails.ProductMRP = row["MRP"].ToString();
                    productDetails.ProductPrice = row["Selling Price"].ToString();
                    productDetails.ProductQuanity = row["packed_quantity"].ToString();
                    productDetails.ProductId = row["Prod_Id"].ToString();
                    productDetails.ProductBrand = row["Brand_Name"].ToString();
                    //lst.Add(productDetails);
                }
            }


            return productDetails;

        }
Esempio n. 5
0
 public Item(ProductDetails productDetails, int qty)
 {
     Product = productDetails;
     Qty = qty;
 }