private void getStores() { int i = -1, j = -1, arrayLength = 4, paramLength = 0; sqlConnectivity sql = new sqlConnectivity(); sql.inputSQL = new string[arrayLength, 4]; sql.inputParams = new string[paramLength, 3]; i++; sql.inputSQL[i, 0] = i.ToString(); sql.inputSQL[i, 2] = "SQL"; sql.inputSQL[i, 3] = "tblStores"; sql.inputSQL[i, 1] = getStoreListSQL(); //i++; sql.inputSQL[i, 0] = i.ToString(); sql.inputSQL[i, 2] = "SQL"; sql.inputSQL[i, 3] = "tblLocations"; sql.inputSQL[i, 1] = "SELECT * FROM bw_store_loc"; i++; sql.inputSQL[i, 0] = i.ToString(); sql.inputSQL[i, 2] = "SQL"; sql.inputSQL[i, 3] = "tblCat"; sql.inputSQL[i, 1] = "SELECT * FROM bw_store_cat"; i++; sql.inputSQL[i, 0] = i.ToString(); sql.inputSQL[i, 2] = "SQL"; sql.inputSQL[i, 3] = "tblStoreCount"; sql.inputSQL[i, 1] = "SELECT count(*) FROM bw_store S LEFT OUTER JOIN bw_user U ON U.uID=S.uID WHERE uAllowed=1 AND uVarified=1"; //i++; sql.inputSQL[i, 0] = i.ToString(); sql.inputSQL[i, 2] = "SQL"; sql.inputSQL[i, 3] = "tblSelectedLocations"; sql.inputSQL[i, 1] = "SELECT * FROM bw_store_loc WHERE locID IN (0" + locID + ")"; i++; sql.inputSQL[i, 0] = i.ToString(); sql.inputSQL[i, 2] = "SQL"; sql.inputSQL[i, 3] = "tblSelectedCats"; sql.inputSQL[i, 1] = "SELECT * FROM bw_store_cat WHERE cID IN (0" + catID + ")"; sql.getData(); if (sql.sysErr == "") { //genFunctions.createDrop("Please select location", "", "locName", "locID", ddLocation, sql.megaDataSet.Tables["tblLocations"]); genFunctions.createDrop("Please select category", "", "cName", "cID", ddCategory, sql.megaDataSet.Tables["tblCat"]); totalStores.Text = sql.megaDataSet.Tables["tblStoreCount"].Rows[0][0].ToString(); ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), scriptUtilities.getChosen(), true); //DataTable tblLoc = sql.megaDataSet.Tables["tblSelectedLocations"]; //for (int a = 0; a < tblLoc.Rows.Count; a++) //{ // storeFilters.InnerHtml += "<a href=\"javascript:void(0);\" onclick=\"removeFilter('loc_" + tblLoc.Rows[a][0].ToString() + "')\" class=\"btn btn-default btn-sm lessPadding\">" + tblLoc.Rows[a][1].ToString() + " <i class=\"glyphicon glyphicon-remove\"></i></a> "; // if (a > 0) hfLoc.Value += ","; // hfLoc.Value += tblLoc.Rows[a][0].ToString(); //} DataTable tblCats = sql.megaDataSet.Tables["tblSelectedCats"]; for (int b = 0; b < tblCats.Rows.Count; b++) { storeFilters.InnerHtml += "<a href=\"javascript:void(0);\" onclick=\"removeFilter(1, '" + tblCats.Rows[b][0].ToString() + "')\" class=\"btn btn-default btn-sm lessPadding\">" + tblCats.Rows[b][1].ToString() + " <i class=\"glyphicon glyphicon-remove\"></i></a> "; if (b > 0) { hfCat.Value += ","; } hfCat.Value += tblCats.Rows[b][0].ToString(); } hfStoreName.Value = storeName; if (storeName != "") { storeFilters.InnerHtml += "<a href=\"javascript:void(0);\" onclick=\"removeFilter(2, '')\" class=\"btn btn-default btn-sm lessPadding\">" + storeName + " <i class=\"glyphicon glyphicon-remove\"></i></a> "; } hfLoc.Value = locID; if (locID != "") { storeFilters.InnerHtml += "<a href=\"javascript:void(0);\" onclick=\"removeFilter(3, '')\" class=\"btn btn-default btn-sm lessPadding\">" + locID + " <i class=\"glyphicon glyphicon-remove\"></i></a> "; } getStoreList(sql.megaDataSet.Tables["tblStores"]); } else { sysErr.InnerHtml = sql.sysErr; } }
internal void getDS(store obj) { int i = -1, j = -1, arrayLength = 3, paramLength = 0; sqlConnectivity sql = new sqlConnectivity(); sql.inputSQL = new string[arrayLength, 4]; sql.inputParams = new string[paramLength, 3]; i++; sql.inputSQL[i, 0] = i.ToString(); sql.inputSQL[i, 2] = "SQL"; sql.inputSQL[i, 3] = "tblStore"; sql.inputSQL[i, 1] = getStoreSQL(obj); i++; sql.inputSQL[i, 0] = i.ToString(); sql.inputSQL[i, 2] = "SQL"; sql.inputSQL[i, 3] = "tblAlbum"; sql.inputSQL[i, 1] = "SELECT TOP 4 *, thumb =(SELECT TOP 1 imgName from bw_user_img WHERE albumID=A.albumID) FROM bw_user_img_album A WHERE uID=(SELECT TOP 1 uID FROM bw_store WHERE storeID=" + storeID.ToString() + ")"; i++; sql.inputSQL[i, 0] = i.ToString(); sql.inputSQL[i, 2] = "SQL"; sql.inputSQL[i, 3] = "tblPayMethod"; sql.inputSQL[i, 1] = "SELECT * FROM bw_storePayMeth A LEFT OUTER JOIN bw_paymentMethod B ON A.paymentMethID=B.paymentMethID WHERE storeID=" + storeID.ToString(); sql.getData(); //HttpContext.Current.Response.Write(sql.inputSQL[i, 1]); HttpContext.Current.Response.End(); if (sql.sysErr == "") { obj.megaDataSet = sql.megaDataSet; } else { obj.sysErr = sql.sysErr; } }
private void getMenu() { string cPreFix = System.Configuration.ConfigurationManager.AppSettings["cPreFix"]; int i = -1; int arrayLength = 1; sqlConnectivity sql = new sqlConnectivity(); sql.inputSQL = new string[arrayLength, 4]; sql.inputParams = new string[0, 3]; i++; sql.inputSQL[i, 0] = i.ToString(); sql.inputSQL[i, 2] = "SQL"; sql.inputSQL[i, 3] = "tblStore"; sql.inputSQL[i, 1] = "SELECT * FROM " + cPreFix + "store WHERE storeID=" + storeID.ToString(); sql.getData(); if (sql.sysErr == "") { DataTable tblStore = sql.megaDataSet.Tables["tblStore"]; if (tblStore.Rows.Count > 0) { DataRow DR = tblStore.Rows[0]; ltMenuImage.Text = DR["storeMenuDetail"].ToString(); if (DR["storeMenu"].ToString() != "") { ltMenuLink.Text = "<a href=\"/img/cImg/" + DR["storeMenu"].ToString() + "\">Download Catlog</a>"; } } } else { ltMenuImage.Text = "Error Occured, please contact administrator"; } }
internal void getImagesFromAlbum(store obj) { getFormat(obj); int i = -1, j = -1, arrayLength = 1, paramLength = 0; sqlConnectivity sql = new sqlConnectivity(); sql.inputSQL = new string[arrayLength, 4]; sql.inputParams = new string[paramLength, 3]; i++; sql.inputSQL[i, 0] = i.ToString(); sql.inputSQL[i, 2] = "SQL"; sql.inputSQL[i, 3] = "tblImages"; sql.inputSQL[i, 1] = "select * from bw_user_img I LEFT OUTER JOIN bw_user_img_album a on A.albumID=I.albumID WHERE I.albumID=" + postUtilities.getIntFrmQString("albumid"); //HttpContext.Current.Response.Write(sql.inputSQL[i, 1]); sql.getData(); if (sql.sysErr == "") { obj.megaDataSet = sql.megaDataSet; obj.varTopIndex = (obj.varItems.Length / 2) - 1; if (obj.megaDataSet.Tables["tblImages"].Rows.Count > 0) { obj.outPut = obj.template.Replace("[albumName]", obj.megaDataSet.Tables["tblImages"].Rows[0]["albumName"].ToString()).Replace(obj.varItems[obj.varTopIndex, 1], getAlbumImageList(obj)); } else { obj.outPut = ""; } } else { obj.sysErr = sql.sysErr; } }