private void getInfoPages() { if (!String.IsNullOrEmpty(Request.QueryString["id"])) { int id = ToSQL.SQLToInt(Request.QueryString["id"]); DataRow row = _db.Get_Info_Pages(id); if (row != null) { txtTitle.Text = BaseView.GetStringFieldValue(row, "title"); txtDesc.Text = BaseView.GetStringFieldValue(row, "desc"); lbIDKey.Text = BaseView.GetStringFieldValue(row, "keywords"); txtTieuDe.Text = BaseView.GetStringFieldValue(row, "tieude"); txtTomTat.Text = BaseView.GetStringFieldValue(row, "tomtat"); txtContent.Text = BaseView.GetStringFieldValue(row, "noidung"); txtUrl.Text = BaseView.GetStringFieldValue(row, "url"); txtCssClass.Text = BaseView.GetStringFieldValue(row, "code"); imgBS.ImageUrl = "~/uploadFile/" + BaseView.GetStringFieldValue(row, "HinhAnh"); chkHienThi.Checked = BaseView.GetBooleanFieldValue(row, "isHome"); string[] keywords = BaseView.GetStringFieldValue(row, "keywords").Split(','); string tags = ""; for (int i = 0; i < keywords.Length - 1; i++) { string[] ids = keywords[i].Split('-'); int idKey = ToSQL.SQLToInt(ids[ids.Length - 1]); DataRow rowK = _db.get_info_words(idKey); if (row != null) { tags += BaseView.GetStringFieldValue(rowK, "keywords") + ", "; } } lbkeyWord.Text = tags; } } }
protected void Page_Load(object sender, EventArgs e) { HttpCookie cookie = Request.Cookies["adminUserName"]; if (cookie == null) { Response.Redirect("~/admin-us/account/login.aspx"); } DataRow rUser = _db.get_Info_user_cms(ReadCookie("adminUserName")); //DataTable dt = null; if (BaseView.GetBooleanFieldValue(rUser, "isAdmin") != true) { //hpAdmin.Visible = false; //ltAdmin.Visible = false; } if (!IsPostBack) { string createDate = BaseView.GetStringFieldValue(rUser, "CreateDate"); string name = BaseView.GetStringFieldValue(rUser, "hoten"); string URLImages = BaseView.GetStringFieldValue(rUser, "URLImages") == "" ? "~/admin-us/upload/user/noimg.png" : "~/admin-us/upload/user/" + BaseView.GetStringFieldValue(rUser, "URLImages"); lbTen.Text = lbTen2.Text = name; ltCreateDate.Text = createDate.Trim() == "" ? DateTime.Now.ToString() : createDate; imgAcc.ImageUrl = imgAcc2.ImageUrl = URLImages; } }
private void getItem(int id) { DataRow r = _db.get_Info_Menu(id); if (r != null) { txtTen.Text = BaseView.GetStringFieldValue(r, "name"); txtID.Text = BaseView.GetStringFieldValue(r, "id"); txtURL.Text = BaseView.GetStringFieldValue(r, "url"); txtIndex.Text = BaseView.GetStringFieldValue(r, "numberSort"); ddlKieu.SelectedValue = BaseView.GetStringFieldValue(r, "styleShow"); try { ddlparent.SelectedValue = BaseView.GetStringFieldValue(r, "isparent"); } catch { } bool rd = BaseView.GetBooleanFieldValue(r, "isActived"); if (rd == true) { rdkhonghienthi.Checked = false; rdhienthi.Checked = true; } if (rd == false) { rdhienthi.Checked = false; rdkhonghienthi.Checked = true; } } }
private void getInfoUser(string username) { DBClass _db = new DBClass(); DataRow r = _db.get_Info_user_cms(username); if (r != null) { txtUserName.Text = BaseView.GetStringFieldValue(r, "username"); txtHoTen.Text = BaseView.GetStringFieldValue(r, "hoten"); txtDienThoai.Text = BaseView.GetStringFieldValue(r, "sodt"); txtEmail.Text = BaseView.GetStringFieldValue(r, "email"); string URLImages = BaseView.GetStringFieldValue(r, "URLImages") == "" ? "~/admin-us/upload/user/noimg.png" : "~/admin-us/upload/user/" + BaseView.GetStringFieldValue(r, "URLImages"); imgBS.ImageUrl = URLImages; bool user = BaseView.GetBooleanFieldValue(r, "isAdmin"); if (user == true) { ddlUser.SelectedValue = "1"; getQuyen(); } else { ddlUser.SelectedValue = "0"; getQuyen(); } } }
public bool CheckCurrentAdmin() { DataRow rUser = _db.get_Info_user_cms(BaseView.ReadCookie("adminUserName")); if (rUser != null) { return(BaseView.GetBooleanFieldValue(rUser, "isAdmin")); } return(false); }
private void getInfoUser(string username) { DataRow r = _db.get_Info_user_cms(username); if (r != null) { txtUserName.Text = BaseView.GetStringFieldValue(r, "username"); txtHoTen.Text = BaseView.GetStringFieldValue(r, "hoten"); txtDienThoai.Text = BaseView.GetStringFieldValue(r, "sodt"); txtEmail.Text = BaseView.GetStringFieldValue(r, "email"); string URLImages = BaseView.GetStringFieldValue(r, "URLImages") == "" ? "~/admin-us/upload/user/noimg.png" : "~/admin-us/upload/user/" + BaseView.GetStringFieldValue(r, "URLImages"); imgBS.ImageUrl = URLImages; bool user = BaseView.GetBooleanFieldValue(r, "isAdmin"); if (user == true) { ddlUser.SelectedValue = "1"; getQuyen(); } else { ddlUser.SelectedValue = "0"; getQuyen(); } } r = _db.get_Info_KhuVuc(username); for (int i = 0; i < chkQuan.Items.Count - 1; i++) { chkQuan.Items[i].Selected = false; } if (r != null) { getQuan(0); string _khuVuc = BaseView.GetStringFieldValue(r, "KhuVuc"); ddlTinh.SelectedValue = BaseView.GetStringFieldValue(r, "Tinh"); getQuan(ToSQL.SQLToInt(ddlTinh.SelectedValue)); string[] kvArr = _khuVuc.Split('-'); if (kvArr.Length > 0) { for (int i = 0; i < chkQuan.Items.Count - 1; i++) { for (int j = 0; j < kvArr.Length; j++) { if (chkQuan.Items[i].Value == kvArr[j]) { chkQuan.Items[i].Selected = true; } } } } } }
private void getItem(int id) { DataRow r = _db.get_Info_DanhMucTin(id); if (r != null) { txtTen.Text = BaseView.GetStringFieldValue(r, "TenDanhMuc"); txtID.Text = BaseView.GetStringFieldValue(r, "maDanhMuc"); txtMota.Text = BaseView.GetStringFieldValue(r, "motaDanhMuc"); txtKeys.Text = BaseView.GetStringFieldValue(r, "keywords"); txtNoiDung.Text = BaseView.GetStringFieldValue(r, "noidung"); chkMenu.Checked = BaseView.GetBooleanFieldValue(r, "isNews"); imgDaiDien.ImageUrl = "~/uploadFile/DanhMuc/" + BaseView.GetStringFieldValue(r, "HinhAnh"); } }
protected void Page_Load(object sender, EventArgs e) { HttpCookie cookie = Request.Cookies["adminUserName"]; if (cookie == null) { Response.Redirect("~/admin-us/account/login.aspx"); } DataRow rUser = _db.get_Info_user_cms(ReadCookie("adminUserName")); //DataTable dt = null; if (BaseView.GetBooleanFieldValue(rUser, "isAdmin") != true) { accManager.Visible = false; } }
private bool isAdmin() { HttpCookie cookie = Request.Cookies["adminUserName"]; if (cookie == null) { Response.Redirect("~/admin-us/account/login.aspx"); } DataRow rUser = _db.get_Info_user_cms(ReadCookie("adminUserName")); //DataTable dt = null; if (BaseView.GetBooleanFieldValue(rUser, "isAdmin") != true) { box_manager.Visible = false; return(false); } return(true); }
protected void Page_Load(object sender, EventArgs e) { HttpCookie cookie = Request.Cookies["adminUserName"]; if (cookie == null) { Response.Redirect("~/admin-us/account/login.aspx"); } DataRow rUser = _db.get_Info_user_cms(ReadCookie("adminUserName")); //DataTable dt = null; if (BaseView.GetBooleanFieldValue(rUser, "isAdmin") != true) { hpAdmin.Visible = false; ltAdmin.Visible = false; } if (!IsPostBack) { //lbTen.Text = BaseView.GetStringFieldValue(rUser, "hoten"); //ltNameLeft.Text = BaseView.GetStringFieldValue(rUser, "hoten"); } }
private void getItem(int id) { DataRow r = _db.get_info_slider(id);// Edit if (r != null) { txtTen.Text = BaseView.GetStringFieldValue(r, "name"); txtID.Text = BaseView.GetStringFieldValue(r, "id"); txtUrl.Text = BaseView.GetStringFieldValue(r, "url"); string hinh = BaseView.GetStringFieldValue(r, "filename"); if (hinh.Trim() != "") { hinh = "~/uploadFile/slider/" + hinh; } else if (hinh.Trim() == "") { hinh = "~/uploadFile/slider/noImg.png"; } imgBS.ImageUrl = hinh; chkSudung.Checked = BaseView.GetBooleanFieldValue(r, "isActived"); } }