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; }
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; }
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; }
public List<string> GetUserID(string mode, string user_id) { List<string> lst = new List<string>(); DBHelper helper = new DBHelper(); SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter(CONSTANT.MODE, mode); param[1] = new SqlParameter(CONSTANT.USER_ID, user_id); DataSet ds = helper.executeSelectQuery(PROCEDURES.DELETE_USER_OPERTAION, param); if (ds != null) { foreach (DataRow item in ds.Tables[0].Rows) { lst.Add(item[0].ToString()); } } return lst; }
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; }
public string getUserDetais() { DBHelper helper = new DBHelper(); DataTable dt = helper.executeSelectQuery(PROCEDURES.GET_USER_DETAIS).Tables[0]; if (dt != null) { return (JSONConvertor.getJSONData(dt)); } else { return null; } }
public List<Category> Categories() { List<Category> cat = new List<Category>(); DBHelper helper = new DBHelper(); Category catg = null; DataSet ds = helper.executeSelectQuery(PROCEDURES.GET_ALL_CATEGORIES); foreach (DataRow row in ds.Tables[0].Rows) { catg = new Category(); catg.Cat_Id = Convert.ToInt32(row[0]); catg.Cat_Name=row[1].ToString(); cat.Add(catg); } return cat; }
public DataTable Categories() { //List<Category> cat = new List<Category>(); DBHelper helper = new DBHelper(); //Category catg = null; DataTable dt = helper.executeSelectQuery(PROCEDURES.GET_ALL_CATEGORIES).Tables[0]; return dt; //foreach (DataRow row in ds.Tables[0].Rows) //{ // catg = new Category(); // catg.Cat_Id = Convert.ToInt32(row[0]); // catg.Cat_Name=row[1].ToString(); // cat.Add(catg); //} //return cat; //System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); //List<Dictionary<string, object>> rows = new List<Dictionary<string, object>>(); //Dictionary<string, object> row; //foreach (DataRow dr in dt.Rows) //{ // row = new Dictionary<string, object>(); // foreach (DataColumn col in dt.Columns) // { // row.Add(col.ColumnName, dr[col]); // } // rows.Add(row); //} //return serializer.Serialize(rows); }
public string LoginCheck(User_Details _user) { DBHelper helper = new DBHelper(); SqlParameter []param=new SqlParameter[2]; param[0]=new SqlParameter(CONSTANT.UID,_user.User_ID); string flag = string.Empty; param[1]=new SqlParameter(CONSTANT.PASSWORD,_user.User_Password); DataTable dt= helper.executeSelectQuery(PROCEDURES.LOGIN_CHECK, param).Tables[0]; if (dt != null && dt.Rows.Count > 0) { foreach (DataRow item in dt.Rows) { flag = item["Role_Name"].ToString(); } } return flag; }
public List<SubCategoryDetails> getAllSubCategory() { List<SubCategoryDetails> AllCategory = new List<SubCategoryDetails>(); DBHelper helper = new DBHelper(); DataSet ds = helper.executeSelectQuery(PROCEDURES.GET_ALL_CATEGORY); if(ds!=null) { foreach (DataRow row in ds.Tables[0].Rows) { SubCategoryDetails sub = new SubCategoryDetails(); sub.Cat_Name=row["Cat_Name"].ToString(); sub.Sub_Cat_Id=Convert.ToInt32(row["Sub_Cat_Id"]); sub.Sub_Cat_Name = row["Sub_Cat_Name"].ToString(); AllCategory.Add(sub); } } return AllCategory; }
public Dictionary<string, string> GetSUBClassificationBasedOnID(string id) { DBHelper helper = new DBHelper(); SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter(CONSTANT.ID, id); Dictionary<string, string> lst = new Dictionary<string, string>(); DataSet ds = helper.executeSelectQuery(PROCEDURES.GET_SUBCLASSFICATION_BASED_ON_SUB_CATEGORY, param); if (ds != null) { foreach (DataRow row in ds.Tables[0].Rows) { lst.Add(row["Sub_Class_id"].ToString(), row["Sub_Class_Name"].ToString()); } } return lst; }
public string PasswordExist(string user_id,string password) { DBHelper helper = new DBHelper(); string str = string.Empty; SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter(CONSTANT.USER_ID, user_id); param[1] = new SqlParameter(CONSTANT.PASSWORD, password); DataSet ds = helper.executeSelectQuery(PROCEDURES.PASSWORD_EXISTS, param); if (ds != null) { foreach (DataRow item in ds.Tables[0].Rows) { str = item[0].ToString(); } } return str; }
public List<Category> GetCategoryForPagination() { List<Category> catlst = new List<Category>(); DBHelper helper = new DBHelper(); DataSet ds = helper.executeSelectQuery(PROCEDURES.GET_CATEGORY); if (ds != null) { foreach (DataRow row in ds.Tables[0].Rows) { Category cat = new Category(); cat.Cat_Id = Convert.ToInt32(row["Cat_Id"]); cat.Cat_Name = row["Cat_Name"].ToString(); catlst.Add(cat); } } return catlst; }
public string EnterProduct(string image, string product, string SubCategoryId, string BrandID) { DBHelper helper = new DBHelper(); SqlParameter[] param = new SqlParameter[4]; param[0] = new SqlParameter(CONSTANT.CAT_ID , image ); param[1] = new SqlParameter(CONSTANT.SUB_CAT_NAME, product); param[2] = new SqlParameter(CONSTANT.CAT_ID , SubCategoryId ); param[3] = new SqlParameter(CONSTANT.SUB_CAT_NAME, BrandID); DataTable dt = helper.executeSelectQuery(PROCEDURES.INSERT_PRODUCT, param).Tables[0]; if (dt != null) { return JSONConvertor.getJSONData(dt); } else { return string.Empty; } }
public Dictionary<string,string> GetCategory() { DBHelper helper = new DBHelper(); Dictionary<string, string> lst = new Dictionary<string,string>(); DataSet ds = helper.executeSelectQuery(PROCEDURES.GET_CATEGORY); if (ds != null) { foreach (DataRow row in ds.Tables[0].Rows) { lst.Add(row["Cat_Id"].ToString(), row["Cat_Name"].ToString()); } } return lst; }
public List<SubClassification> getSubClassificationList(string cat_id, string sub_cat_id) { DBHelper helper = new DBHelper(); SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter(CONSTANT.SUB_CATEGORY_ID, sub_cat_id); param[1] = new SqlParameter(CONSTANT.CAT_ID, cat_id); DataSet ds = helper.executeSelectQuery(PROCEDURES.GET_SUB_CLASSIFICATION, param); List<SubClassification> subClassificationList = new List<SubClassification>(); if (ds != null) { foreach (DataRow row in ds.Tables[0].Rows) { SubClassification subClassification = new SubClassification(); subClassification.Sub_Class_id = Convert.ToInt32(row["Sub_Class_id"]); subClassification.Sub_Class_Name=row["Sub_Class_Name"].ToString(); subClassification.Sub_Cat_Name=row["Sub_Cat_Name"].ToString(); subClassification.Sub_Cat_Id=Convert.ToInt32(row["Sub_Cat_Id"]); subClassificationList.Add(subClassification); } } return subClassificationList; }
public List<ProductDetails> Get_product_list() { List<ProductDetails> products = new List<ProductDetails>(); DBHelper helper = new DBHelper(); DataSet ds = helper.executeSelectQuery(PROCEDURES.GET_PRODUCTS); if (ds != null) { foreach (DataRow row in ds.Tables[0].Rows) { ProductDetails product = new ProductDetails(); product.Prod_Id = row["Prod_Id"].ToString(); product.Prod_Name = row["Prod_Name"].ToString(); product.Prod_Img = row["Prod_Img"].ToString(); product.Brand_Name = row["Brand_Name"].ToString(); product.SubCategory = row["Sub_Cat_Name"].ToString(); //product. = row["Prod_Img"].ToString(); product.Price = Convert.ToSingle(row["Price"]); product.Offer_Price = Convert.ToSingle(row["offer_price"]); product.Purchase_Price = Convert.ToSingle(row["Purchase_Price"]); product.Prod_Quantity = row["packed_quantity"].ToString(); product.SubClassification = row["SubClassification"].ToString(); product.Total_Quantity = Convert.ToInt32(row["Availabe_qty"]); products.Add(product); } } return products; }
public string EnterBrand(string Brand) { //List<Category> cat = new List<Category>(); DBHelper helper = new DBHelper(); SqlParameter[] param=new SqlParameter[1]; param[0] = new SqlParameter(CONSTANT.BRAND_NAME, Brand); //Category catg = null; DataTable dt = helper.executeSelectQuery(PROCEDURES.INSERT_BRAND, param).Tables[0]; if(dt!=null) { return JSONConvertor.getJSONData(dt); } else { return string.Empty; } }
public string getdata() { DBHelper helper = new DBHelper(); DataTable dt = helper.executeSelectQuery(PROCEDURES.GET_CATEGORY).Tables[0]; if (dt != null) { return JSONConvertor.getJSONData(dt); } else { return string.Empty; } }
public List<Brand> GetBrands() { List<Brand> brandlst = new List<Brand>(); DBHelper helper = new DBHelper(); DataSet ds = helper.executeSelectQuery(PROCEDURES.GET_ALL_BRANDS); if (ds != null) { foreach (DataRow row in ds.Tables[0].Rows) { Brand brand= new Brand(); brand.Brand_Id = Convert.ToInt32 (row["Brand_Id"]); brand.Brand_Name = row["Brand_Name"].ToString(); brandlst.Add(brand); } } return brandlst; }