public static string GetField(string field, string tb, string wh) { DataSet dataSet = UpdateData.UpdateBySql(string.Concat(new string[] { "SELECT ", field, " FROM ", tb, " WHERE ", wh })); DataRowCollection rows = dataSet.Tables[0].Rows; string result; if (rows.Count > 0) { result = rows[0][0].ToString(); } else { result = ""; } return(result); }
public static int GetLichID_From_Url(string link) { int result; if (link.Length > 2) { HttpContext current = HttpContext.Current; DataSet dataSet = UpdateData.UpdateBySql("SELECT Lichhoc_ID FROM tbl_Lichhoc WHERE Lower(Lichhoc_Code)='" + link.ToLower() + "'"); DataRowCollection rows = dataSet.Tables[0].Rows; if (rows.Count > 0) { result = Convert.ToInt32(rows[0][0]); } else { result = 0; } } else { result = 0; } return(result); }
public static void RaovatCount(int id) { UpdateData.UpdateBySql("UPDATE tbl_Raovat SET Raovat_Count=Raovat_Count+1 WHERE Raovat_ID=" + id); }
public static void UpdateCount(int id) { UpdateData.UpdateBySql("UPDATE tbl_Content SET Content_Count=Content_Count+1 WHERE Content_ID=" + id); }
public string LoadVote(string Vote_ModuleID) { HttpContext current = HttpContext.Current; string text = current.Session["vlang"].ToString(); string text2 = "<script language='javascript'>\r\n\t\t\t<!--\r\n\t\t\tfunction openWindow(url, width , height)\r\n\t\t\t{\r\n\t\t\t\tvar def = 'status=no,resizable=no,scrollbars=yes,toolbar=no,location=no,fullscreen=no,titlebar=yes,height='.concat(height).concat(',').concat('width=').concat(width).concat(',');\r\n\t\t\t\tdef = def.concat('top=').concat((screen.height - height)/2).concat(',');\r\n\t\t\t\tdef = def.concat('left=').concat((screen.width - width)/2);\r\n\t\t\t\twindow.open(url, '_blank', def);\r\n\t\t\t}\r\n\t\t\tfunction Votes(id , url)\r\n\t\t\t{\r\n\t\t\t\tvar objs = document.getElementsByName(id);\t\t\t\t\r\n\t\t\t\tvar sQID = '';\r\n\t\t\t\tfor(var i = 0 ; i < objs.length ; i++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif(objs[i].checked) sQID += objs[i].value;\r\n \r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(url.lastIndexOf('?') != -1) url += '&QID=' + sQID;\r\n\t\t\t\telse url += '?QID=' + sQID;\r\n\t\t\t\topenWindow(url, 490 , 250);\r\n\t\t\t}\r\n\t\t\t//-->\r\n\t\t\t</script>"; if (this.IsHasVote(Vote_ModuleID)) { DataSet dataSet = UpdateData.UpdateBySql(string.Concat(new object[] { "SELECT TOP 1 * FROM tbl_Vote WHERE lang=", current.Session["vlang"], " AND Vote_IsUse=1 AND Vote_ModuleID=", Vote_ModuleID })); DataRowCollection rows = dataSet.Tables[0].Rows; if (rows.Count > 0) { string text3 = rows[0]["Vote_ID"].ToString(); string str = rows[0]["Vote_Question"].ToString(); text2 += "<table width='100%'>"; text2 += "<tr>"; text2 = text2 + "<td colspan='2'><b>" + str + "</b></td>"; text2 += "</tr>"; for (int i = 1; i <= 5; i++) { string text4 = rows[0]["Vote_Selection" + i].ToString(); if (text4.Length > 0) { string str2 = ""; if (i == 1) { str2 = "checked"; } text2 += "<tr>"; text2 = text2 + "<td align='left' width='2%'>" + string.Format("<input type='radio' value='{0}_{1}' " + str2 + " name='{0}_radio' id='{0}_radio'>", text3, i) + "</td>"; text2 = text2 + "<td style='padding:2px;' align='left'>" + text4 + "</td>"; text2 += "</tr>"; } } text2 += "<tr>"; string text5 = text2; text2 = string.Concat(new string[] { text5, "<td colspan='2' style='padding-top:6px;' align='center'><img src='", ApplicationSetting.URLImages, "/Vote_Button", text, ".gif' style='cursor:pointer;' onclick=\"", string.Format("javascript:Votes('{0}_radio','{1}')", text3, "VoteResult.aspx"), "\"> " }); text5 = text2; text2 = string.Concat(new string[] { text5, "<img src='", ApplicationSetting.URLImages, "/Vote_Result", text, ".gif' style='cursor:pointer;' onclick=\"", string.Format("javascript:openWindow('{0}',490,250)", "VoteResult.aspx?QID=" + text3 + "_"), "\"></td>" }); text2 += "</tr>"; text2 += "</table>"; } } return(text2); }
public static string LoadSkinP(string code, int p) { HttpContext current = HttpContext.Current; StringBuilder stringBuilder = new StringBuilder(); DataSet dataSet = UpdateData.UpdateBySql("SELECT Skintype_ID,Skintype_Viewtype,Skintype_Vspace,Skintype_Hspace,Skintype_Height,Skintype_Width,Skintype_Limit,Skintype_Target FROM tbl_Skintype WHERE Skintype_Status=1 AND Skintype_Code='" + code + "'"); DataRowCollection rows = dataSet.Tables[0].Rows; if (rows.Count > 0) { string text = rows[0]["Skintype_ID"].ToString(); bool flag = Convert.ToBoolean(rows[0]["Skintype_Viewtype"]); string text2 = rows[0]["Skintype_Vspace"].ToString(); string text3 = rows[0]["Skintype_Hspace"].ToString(); int num = Convert.ToInt32(rows[0]["Skintype_Limit"]); string text4 = rows[0]["Skintype_Target"].ToString().Trim(); string text5 = string.Concat(new object[] { "SELECT top ", num, " Skin_ID,Skin_Name,Skin_Url,Skin_Height,Skin_Width,Skin_Link FROM tbl_Skin WHERE Skin_Status=1 AND Skintype_ID=", text }); if (p != 0) { if (ModControl.GetLevel(p) == 2) { p = ModControl.GetOldP(p); } if (ModControl.GetLevel(p) == 3) { p = ModControl.GetOldP(ModControl.GetOldP(p)); } text5 = text5 + " AND Mod_ID=" + p; } else { text5 += " AND Mod_ID=-1"; } text5 += " ORDER BY Skin_Pos"; string text6 = flag ? "<br />" : ""; DataSet dataSet2 = UpdateData.UpdateBySql(text5); DataRowCollection rows2 = dataSet2.Tables[0].Rows; for (int i = 0; i < rows2.Count; i++) { string text7 = rows2[0]["Skin_ID"].ToString(); string text8 = rows2[i]["Skin_Name"].ToString(); string text9 = ApplicationSetting.URLRoot + rows2[i]["Skin_Url"].ToString(); string text10 = rows2[i]["Skin_Height"].ToString(); string text11 = rows2[i]["Skin_Width"].ToString(); string text12 = rows2[i]["Skin_Link"].ToString(); if (Path.GetExtension(text9) == ".swf") { stringBuilder.Append(string.Concat(new string[] { "<a target=\"", text4, "\" href=\"", ApplicationSetting.URLRoot, "aspx/SaveProcess.aspx?id=", text7, "&url=", text12, "\"><script type=\"text/javascript\">swf('", text9, "','", text11, "','", text10, "');</script></a>", text6 })); } else if (flag) { if (text12 != "") { stringBuilder.Append(string.Concat(new string[] { "<a target=\"", text4, "\" href=\"", ApplicationSetting.URLRoot, "aspx/SaveProcess.aspx?id=", text7, "&url=", text12, "\"><img src=\"", text9, "\" width=\"", text11, "\" height=\"", text10, "\" vspace=\"", text2, "\" border=\"0\" alt=\"", text8, "\"></a>", text6 })); } else { stringBuilder.Append(string.Concat(new string[] { "<img src=\"", text9, "\" width=\"", text11, "\" height=\"", text10, "\" border=\"0\" vspace=\"", text2, "\" alt=\"", text8, "\"><br>" })); } } else if (text12 != "") { stringBuilder.Append(string.Concat(new string[] { "<a target=\"", text4, "\" href=\"", ApplicationSetting.URLRoot, "aspx/SaveProcess.aspx?id=", text7, "&url=", text12, "\"><img src=\"", text9, "\" width=\"", text11, "\" hspace=\"", text3, "\" height=\"", text10, "\" border=\"0\" alt=\"", text8, "\"></a>" })); } else { stringBuilder.Append(string.Concat(new string[] { "<img src=\"", text9, "\" width=\"", text11, "\" height=\"", text10, "\" hspace=\"", text3, "\" border=\"0\" alt=\"", text8, "\">" })); } } } return(stringBuilder.ToString()); }
public string BuildMenuTop(string UserID) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(""); stringBuilder.Append("<ul class=\"nav navbar-nav pull-left\">"); DataSet dataSet = (DataSet)HttpContext.Current.Cache["mydata"]; if (dataSet == null) { dataSet = UpdateData.UpdateBySql("SELECT * FROM tbl_ModAdmin WHERE ModAdmin_Parent=0 ORDER BY ModAdmin_Pos"); HttpContext.Current.Cache.Insert("mydata", dataSet, null, DateTime.Now.AddHours(1.0), Cache.NoSlidingExpiration); } DataRowCollection rows = dataSet.Tables[0].Rows; for (int i = 0; i < rows.Count; i++) { string text = " AND tbl_ModAdmin.ModAdmin_ID IN (SELECT ModAdmin_ID FROM tbl_ModUser WHERE UserID='" + UserID + "')"; string text2 = rows[i]["ModAdmin_ID"].ToString(); if (this.HasChildren(text2, text)) { string texti = rows[i]["ModAdmin_Icon"].ToString(); stringBuilder.Append("\t<li class=\"dropdown messages-menu\">"); stringBuilder.Append(" <a href=\"#\"><i class=\"" + texti + " fa-2x\"></i><br>" + rows[i]["ModAdmin_Name"].ToString() + "</a>"); string str = " ORDER BY ModAdmin_Pos "; text = string.Concat(new string[] { " AND ModAdmin_Status=1 AND ModAdmin_Parent=", text2, " AND tbl_ModAdmin.ModAdmin_ID IN (SELECT ModAdmin_ID FROM tbl_ModUser WHERE UserID='", UserID, "')" }); string sql = "SELECT * FROM tbl_ModAdmin WHERE 1=1" + text + str; DataSet dataSet2 = UpdateData.UpdateBySql(sql); DataRowCollection rows2 = dataSet2.Tables[0].Rows; stringBuilder.Append("<ul class=\"dropdown-menu\">"); for (int j = 0; j < rows2.Count; j++) { string text3 = rows2[j]["ModAdmin_ID"].ToString(); string text4 = rows2[j]["ModAdmin_Path"].ToString(); string text5 = FunctionDB.URLRoot + "adcadmin/" + rows2[j]["ModAdmin_Icon"].ToString(); string text10 = rows2[j]["ModAdmin_Icon"].ToString(); string text6 = rows2[j]["ModAdmin_Name"].ToString(); stringBuilder.Append(string.Concat(new string[] { "<li class=\"p\"><a href=\"#\" onclick=\"javascript:location.href='", FunctionDB.URLRoot, "adcadmin/", text4, "'\"><i class=\"" + text10 + "\"></i> ", text6, "</a></li>" })); } stringBuilder.Append("</ul>"); stringBuilder.Append("</li>"); } } stringBuilder.Append("</ul>"); return(stringBuilder.ToString()); }
//quyeths 29/11/2016 GetModTypefrommodID public static string GetModtypeFromModID(int modid) { return(UpdateData.SQLScalar("Select Modtype_ID from tbl_Mod Where Mod_ID=" + modid)); }
public static string GetShopCatID(object modid) { return(UpdateData.SQLScalar("Select ShopCatID from tbl_MapModShopCat Where ModID=" + modid)); }
public static string GetModUrl(object modid) { HttpContext current = HttpContext.Current; return(UpdateData.SQLScalar("Select NameAscii from Shop_Category Where ID=" + modid + " AND lang=" + current.Session["vlang"])); }
//Thaodv modify 11/08/2016 public static string GetModName(object modid) { HttpContext current = HttpContext.Current; return(UpdateData.SQLScalar("SELECT Name FROM Shop_Category WHERE ID =" + modid + " AND lang=" + current.Session["vlang"])); }