public int SettingsBanner() { string sql = "SELECT * FROM Settings"; int Style = 0; DataTable dt = db.myTable(sql); if (dt.Rows.Count > 0) { Style = b.toInt(dt.Rows[0]["StyleBannerImage"].ToString()); } return(Style); }
public static string loadMenuAll() { DataService db = new DataService(); basic b = new basic(); DataTable dt = db.myTable_sp("sp_Sel_Menu"); // DataTable dt1 = db.myTable_sp(); string s = ""; if (dt.Rows.Count > 0) { s += "<div class=\"menuTop\">"; s += "<ul id=\"nav\" class=\"mainmenuTop\">"; for (int i = 0; i < dt.Rows.Count; i++) { if (i < 2) { s += string.Format("<li> <a href=\"{0}\">{1}</a>", dt.Rows[i]["Link"].ToString(), dt.Rows[i]["Menu"].ToString()); } else { s += string.Format("<li> <a href=\"{0}?m={2}&c=0&page=1\">{1}</a>", dt.Rows[i]["Link"].ToString(), dt.Rows[i]["Menu"].ToString(), dt.Rows[i]["Id"].ToString()); } SqlParameter p = new SqlParameter("@where", b.toInt(dt.Rows[i]["Id"].ToString())); DataTable dt1 = db.myTable_sp("sp_Sel_Where_Pages", p); if (dt1.Rows.Count > 0) { s += "<ul id=\"nav1\" class=\"submenuTop\">"; for (int j = 0; j < dt1.Rows.Count; j++) { s += string.Format("<li> <a href=\"{0}?m={2}&c={3}&page=1\">{1}</a>", dt1.Rows[j]["Page"].ToString(), dt1.Rows[j]["Category"].ToString(), dt.Rows[i]["Id"].ToString(), dt1.Rows[j]["Id"].ToString()); s += "</li>"; } s += "</ul>"; } s += "</li>"; } s += "</ul>"; s += "</div>"; } return(s); }
// truyền vào login name trả về Id public int Id(string name) { int i = 0; SqlParameter n = new SqlParameter("@LoginName", name); DataTable dt = db.myTable_sp("[dbo].[sp_Sel_WhereName_Users]", n); if (dt.Rows.Count > 0) { i = b.toInt(dt.Rows[0][0].ToString()); } return(i); }