private void getStores() { string megaSQL = "SELECT cName, cID FROM bw_store_cat WHERE cName like '" + postUtilities.getStringFrmQString("storeLetter") + "%' ORDER BY cName"; int i = -1; int arrayLength = 1; string[] outputString; string[,] inputSQL = new string[arrayLength, 4]; string[,] inputParams = new string[0, 3]; i++; inputSQL[i, 0] = i.ToString(); inputSQL[i, 1] = megaSQL; inputSQL[i, 2] = "SQL"; inputSQL[i, 3] = "tblJobList"; sqlData objDAL = new sqlData(); DataSet DSdataSet = objDAL.getDataset(inputSQL, inputParams, out outputString); if (outputString[0].ToString() == "Success") { DataTable DT = DSdataSet.Tables[0]; DataRow DR; System.Text.StringBuilder sb = new System.Text.StringBuilder(); if (DT.Rows.Count > 0) { for (int k = 0; k < DT.Rows.Count; k++) { sb.Append("<a href=\"javascript:void(0);\" onclick=\"applyCatValue('" + DT.Rows[k]["cID"].ToString() + "-" + urlUtilities.codeStrURL(DT.Rows[k]["cName"].ToString()) + "');\">" + DT.Rows[k]["cName"].ToString() + "</a>"); } } else { sb.Append("No store categories available"); } ltStoreList.Text = sb.ToString(); } else { ltStoreList.Text = "No store categories available"; } }
private DataSet getDSdataSet() { int i = -1; int arrayLength = 2; string[,] inputSQL = new string[arrayLength, 4]; //inputSQL (sqlID, sqlText, commandtype, tableName) string[,] inputParams = new string[0, 3]; //inputParams (sqlID, paramName, paramValue) string[] outputString; //outputString (outputMessages) DataSet DSdataSet; //multi table dataset i++; inputSQL[i, 0] = i.ToString(); inputSQL[i, 1] = "SELECT * From " + cPreFix + "cat WHERE isLive=1 AND isLeftNav=1"; inputSQL[i, 2] = "SQL"; inputSQL[i, 3] = "tblSideNav"; i++; inputSQL[i, 0] = i.ToString(); inputSQL[i, 1] = "SELECT TOP 1 * From " + cPreFix + "store WHERE uID=" + userID.ToString(); inputSQL[i, 2] = "SQL"; inputSQL[i, 3] = "tblStore"; sqlData objDAL = new sqlData(); DSdataSet = objDAL.getDataset(inputSQL, inputParams, out outputString); userMsg = outputString[0].ToString(); sysMsg = outputString[1].ToString(); return(DSdataSet); }
private DataTable getCommentsFromDB() { DataTable DT = new DataTable(); if (postIDs != "") { string commentSQL = "SELECT C.commentID, C.postID, C.commentDate, C.commentText, (U.uFirstName + ' ' + U.uLastName) as userName, U.uID FROM bw_post_comment C LEFT OUTER JOIN bw_user U ON U.uID = C.uID WHERE postID in (" + postIDs + ")"; int i = -1; int arrayLength = 1; string[] outputString; string[,] inputSQL = new string[arrayLength, 4]; string[,] inputParams = new string[0, 3]; i++; inputSQL[i, 0] = i.ToString(); inputSQL[i, 1] = commentSQL; inputSQL[i, 2] = "SQL"; inputSQL[i, 3] = "DT"; sqlData objDAL = new sqlData(); DataSet DSdataSet = objDAL.getDataset(inputSQL, inputParams, out outputString); if (outputString[0].ToString() == "Success") { DT = DSdataSet.Tables[0]; } } return(DT); }
private void insertComment() { sqlData objDAL = new sqlData(); int i = -1; int arrayLength = 1; string[,] inputParams = new string[arrayLength, 2]; string[] outputString; //outputString (outputMessages) string megaSQL = "INSERT INTO bw_post_comment (uID, postID, commentText) VALUES (" + uID.ToString() + ", " + postID.ToString() + ",'" + comment + "'); SELECT @@IDENTITY;"; i++; inputParams[i, 0] = megaSQL; inputParams[i, 1] = ""; string strID = objDAL.ExecuteScalar(inputParams, out outputString); Response.ContentType = "text/plain"; Response.Clear(); Response.Write(strID); }
private DataSet getDSdataSet() { int i = -1; int arrayLength = 1; string[,] inputSQL = new string[arrayLength, 4]; //inputSQL (sqlID, sqlText, commandtype, tableName) string[,] inputParams = new string[0, 3]; //inputParams (sqlID, paramName, paramValue) string[] outputString; //outputString (outputMessages) DataSet DSdataSet; //multi table dataset i++; inputSQL[i, 0] = i.ToString(); inputSQL[i, 1] = getSQL(); inputSQL[i, 2] = "SQL"; inputSQL[i, 3] = "tblFeed"; sqlData objDAL = new sqlData(); DSdataSet = objDAL.getDataset(inputSQL, inputParams, out outputString); userMsg = outputString[0].ToString(); sysMsg = outputString[1].ToString(); return(DSdataSet); }
protected void Button1_Click(object sender, EventArgs e) { string P_str_filePath = "", P_str_fileExtName = "", P_str_mFileName, P_str_mPath; if ("" != uploadImg.FileName) { P_str_filePath = uploadImg.PostedFile.FileName; //获取文件路径 P_str_fileExtName = P_str_filePath.Substring(P_str_filePath.LastIndexOf(".") + 1); //获得扩展名 try { P_str_mPath = Server.MapPath("/images/"); //保存到指定的路径 P_str_mFileName = P_str_filePath.Substring(P_str_filePath.LastIndexOf("\\") + 1); //获得文件的名称 uploadImg.PostedFile.SaveAs(P_str_mPath + P_str_mFileName); //保存到指定的路径 string com = "update MEMBERS set PHOTO='/images/" + (P_str_mFileName) + "',TEL='" + this.telephone.Text + "',QQ='" + this.QQ.Text + "',WECHAT='" + this.wechat.Text + "',INTRO='" + this.intro.Text + "' where MID=00020030"; sqlData da = new sqlData(); da.ExceSQL(com); } catch (Exception err) { Response.Write(err.ToString()); } } Response.Redirect("/members/Tech-department1.aspx"); }
private void getStores() { string megaSQL = "select TOP 10 storeImg = (storeLogo), storeID, storeName from bw_store S LEFT OUTER JOIN bw_store_loc L ON L.locID = S.storeLocation LEFT OUTER JOIN bw_user U ON U.uID=S.uID WHERE uAllowed=1 AND uVarified=1 ORDER BY newID();"; int i = -1; int arrayLength = 1; string[] outputString; string[,] inputSQL = new string[arrayLength, 4]; string[,] inputParams = new string[0, 3]; i++; inputSQL[i, 0] = i.ToString(); inputSQL[i, 1] = megaSQL; inputSQL[i, 2] = "SQL"; inputSQL[i, 3] = "tblJobList"; sqlData objDAL = new sqlData(); DataSet DSdataSet = objDAL.getDataset(inputSQL, inputParams, out outputString); if (outputString[0].ToString() == "Success") { DataTable DT = DSdataSet.Tables[0]; DataRow DR; System.Text.StringBuilder sb = new System.Text.StringBuilder(); if (DT.Rows.Count > 0) { string storeName = ""; for (int k = 0; k < DT.Rows.Count; k++) { storeName = DT.Rows[k]["storeName"].ToString(); if (storeName == "") { storeName = "No name added"; } sb.Append("<div class=\"col-xs-6 lessPadding\"><div class=\"col-xs-12 noPadding rightStoreImg\" style=\"border-top:5px solid #c9c9c9; background:#c9c9c9 url(/getThumb.aspx?width=120&img=img/cImg/" + DT.Rows[k]["storeImg"].ToString() + ") top center no-repeat; background-size:auto 75%\">") .Append("<div class=\"rightStoreName\"><a style=\"padding:5px; display:block;\" href=\"/stores/" + DT.Rows[k]["storeID"].ToString() + "/" + urlUtilities.codeStrURL(DT.Rows[k]["storeName"].ToString()) + "/\">" + storeName + "</a></div></div></div>"); } } else { sb.Append("No stores available"); } ltStoreList.Text = sb.ToString(); } else { ltStoreList.Text = "No stores available"; } }