protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); this.LinkDelete.Visible = _Role.R_Delete; this.LinkDelete.Attributes.Add("onclick", "return ConfirmQuestion('Bạn có chắc muốn xóa?','ctl00_MainContent_grdListTemplate_ctl01_chkAll');"); if (!IsPostBack) { if (Session["CurrentPage"] != null) { pages.PageIndex = int.Parse(Session["CurrentPage"].ToString()); LoadData(); Session["CurrentPage"] = null; } else { LoadData(); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); pages.PageIndex = 0; if (!IsPostBack) { LoadCombox(); int tab_id = 0; if (Session["CurrentPage"] != null) { pages.PageIndex = int.Parse(Session["CurrentPage"].ToString()); } this.TabContainer1.ActiveTabIndex = tab_id; this.TabContainer1_ActiveTabChanged(sender, e); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _userDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); linkAddNews.Visible = _Role.R_Read; linkRoleCateSaves.Attributes.Add("onclick", "getIDSelect()"); if (!string.IsNullOrEmpty(Convert.ToString(Session["culture"]))) { _lang = Convert.ToString(Session["culture"]); } if (!IsPostBack) { UltilFunc.BindCombox(cbo_anpham, "Ma_Anpham", "Ten_Anpham", "T_Anpham", "1=1", "Chọn ấn phẩm"); cbo_anpham.SelectedValue = Global.DefaultCombobox; BindData(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); if (!IsPostBack) { LoadCombox(); } else { string EventName = Request.Form["__EVENTTARGET"].ToString(); if (EventName == "UploadImageSuccess") { LoadData_FilePDF(); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (UltilFunc.IsNumeric(Request["Menu_ID"])) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, MenuID); btnUpload.Enabled = _Role.R_Write; btnDelete.Enabled = _Role.R_Delete; if (!IsPostBack) { if (Session["CurrentPage"] != null) { pageappro.PageIndex = int.Parse(Session["CurrentPage"].ToString()); LoadDataApprovied(); } else { LoadDataApprovied(); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (UltilFunc.IsNumeric(Request["Menu_ID"])) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _userDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); btnAdd.Visible = _Role.R_Read; if (!IsPostBack) { lblMessError.Text = ""; if (Session["CurrentPage"] != null) { pages.PageIndex = int.Parse(Session["CurrentPage"].ToString()); BindList_Phongban(); } else { BindList_Phongban(); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); Ma_QTBT = UltilFunc.GetColumnValuesOne("T_NguoidungQTBT", "Ma_QTBT", "Ma_Nguoidung=" + _user.UserID); if (!IsPostBack) { if (Ma_QTBT != 0) { LoadData(); } else { Page.Response.Redirect("~/login.aspx", true); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (UltilFunc.IsNumeric(Request["Menu_ID"])) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Admin/Errors/AccessDenied.aspx"); } _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _userDAL.GetRole4UserMenu(_user.UserID, MenuID); this.btnAdd.Visible = _Role.R_Read; if (!IsPostBack) { if (Session["CurrentPage"] != null) { pages.PageIndex = int.Parse(Session["CurrentPage"].ToString()); Session["CurrentPage"] = null; Danhsach_Yeucau(); } else { Danhsach_Yeucau(); } } } }
protected void Page_Load(object sender, EventArgs e) { { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); this.btnXoaAnh.Attributes.Add("onclick", "return ConfirmQuestion('Bạn có chắc muốn xóa?','ctl00_MainContent_dgrListPhotoOfNews_ctl01_chkAll');"); } if (!IsPostBack) { if (_user == null) { Page.Response.Redirect("~/login.aspx", true); } } else { string EventName = Request.Form["__EVENTTARGET"].ToString(); if (EventName == "UploadImageSuccess") { LoadDataImage(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) Response.Redirect("~/Errors/AccessDenied.aspx"); _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); if (!IsPostBack) { LoadCombox(); cbo_anpham.SelectedValue = Global.DefaultCombobox; cbo_chuyenmuc.Items.Clear(); if (cbo_anpham.SelectedIndex > 0) { UltilFunc.BindCombox_CategoryDequy(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", " WHERE Hoatdong=1 and Ma_ChuyenMuc in (select Ma_ChuyenMuc from T_Nguoidung_Chuyenmuc where Ma_Nguoidung = " + _user.UserID.ToString() + ") and Ma_AnPham= " + cbo_anpham.SelectedValue, CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha"); } else { cbo_chuyenmuc.DataSource = null; cbo_chuyenmuc.DataBind(); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (UltilFunc.IsNumeric(Request["Menu_ID"])) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _userDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); this.LinkCancel.Attributes.Add("onclick", "return ConfirmQuestion('Bạn có chắc muốn xóa?','ctl00_MainContent_grdListCate');"); if (Page.Request.Params["status"] != null) { if (CommonLib.IsNumeric(Page.Request.Params["status"].ToString())) { status = int.Parse(Page.Request.Params["status"].ToString()); } } if (Page.Request.Params["Tab"] != null) { if (CommonLib.IsNumeric(Page.Request.Params["Tab"].ToString())) { tab = int.Parse(Page.Request.Params["Tab"].ToString()); } } //LangID = PopulateItem(cat_id).Lang_ID; try { pageback = int.Parse(Session["PageFromID"].ToString()); } catch {; } if (!IsPostBack) { CheckPermission(); //if () //{ if (Request["BackID"] != null && Request["BackID"] != "") { int page_index = 0; try { page_index = int.Parse(Session["PageIndex_DetailCAT"].ToString()); } catch {; } pages.PageIndex = page_index; } LoadData(status); //} } } } }
public override T_RolePermission GetRole4UserMenu(int User_ID, int Menu_ID) { string _sql = "Sp_GetRoleForUserMenu"; SqlService _sqlservice = new SqlService(connectionString); T_RolePermission _role = new T_RolePermission(); SqlDataReader _reader; try { _sqlservice.AddParameter("@User_ID", SqlDbType.Int, User_ID); _sqlservice.AddParameter("@Menu_ID", SqlDbType.Int, Menu_ID); _reader = _sqlservice.ExecuteSPReader(_sql); if (_reader.HasRows) { _reader.Read(); if (_reader["Doc"] != DBNull.Value) { _role.R_Read = Convert.ToBoolean(_reader["Doc"]); } if (_reader["Ghi"] != DBNull.Value) { _role.R_Write = Convert.ToBoolean(_reader["Ghi"]); } if (_reader["Xoa"] != DBNull.Value) { _role.R_Delete = Convert.ToBoolean(_reader["Xoa"]); } _reader.Close(); } else { _role.R_Read = false; _role.R_Write = false; _role.R_Delete = false; } } catch (Exception ex) { throw ex; } finally { _sqlservice.Disconnect(); } return(_role); }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); } if (!IsPostBack) { } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); Ma_QTBT = UltilFunc.GetColumnValuesOne("T_NguoidungQTBT", "Ma_QTBT", "Ma_Nguoidung=" + _user.UserID); if (!IsPostBack) { if (Ma_QTBT == 0) { Page.Response.Redirect("~/login.aspx", true); } LoadCombox(); cbo_chuyenmuc.Items.Clear(); cboSoBao.Items.Clear(); if (cboAnPham.SelectedIndex > 0) { UltilFunc.BindComboxSoBao(cboSoBao, int.Parse(cboAnPham.SelectedValue.ToString()), 1); UltilFunc.BindCombox_CategoryDequy(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", " WHERE Ma_ChuyenMuc in (select Ma_ChuyenMuc from T_Nguoidung_Chuyenmuc where Ma_Nguoidung = " + _user.UserID.ToString() + ") and Ma_AnPham= " + cboAnPham.SelectedValue, CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha"); } else { cbo_chuyenmuc.DataSource = null; cbo_chuyenmuc.DataBind(); cboSoBao.DataSource = null; cboSoBao.DataBind(); } LoadData(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (UltilFunc.IsNumeric(Request["Menu_ID"])) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _userDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); ActiverPermission(); if (!IsPostBack) { LoadData(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (UltilFunc.IsNumeric(Request["Menu_ID"])) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Admin/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, MenuID); this.linkSave.Visible = _Role.R_Write; if (!IsPostBack) { BindData(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _userDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); if (!IsPostBack) { int tab_id = 0; if (Request["Tab"] != null) { tab_id = Convert.ToInt32(Request["Tab"].ToString()); if (tab_id == 0) { this.TabContainer1.ActiveTabIndex = 0; this.TabContainer1_ActiveTabChanged(sender, e); } if (tab_id == 1) { this.TabContainer1.ActiveTabIndex = 1; this.TabContainer1_ActiveTabChanged(sender, e); } } else { this.TabContainer1.ActiveTabIndex = 0; this.TabContainer1_ActiveTabChanged(sender, e); } LoadComboBox(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (UltilFunc.IsNumeric(Request["Menu_ID"])) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _userDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); this.LinkCancel.Attributes.Add("onclick", "return ConfirmQuestion('" + CommonLib.ReadXML("lbBanmuonxoa") + "','ctl00_MainContent_grdListCate');"); if (Page.Request.Params["id"] != null) { if (CommonLib.IsNumeric(Page.Request.Params["id"].ToString())) { cat_id = int.Parse(Page.Request.Params["id"].ToString()); } } lblTenPhongsu.Text = PopulateItem(cat_id).Cat_Album_Name; LangID = PopulateItem(cat_id).Lang_ID; if (!IsPostBack) { if (CheckPermission(cat_id)) { if (Request["BackID"] != null && Request["BackID"] != "") { int page_index = 0; try { page_index = int.Parse(Session["PageIndex_DetailCAT"].ToString()); } catch {; } pages.PageIndex = page_index; } LoadData(cat_id); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); } if (!IsPostBack) { UltilFunc.BindCombox(cbo_anpham, "Ma_Anpham", "Ten_Anpham", "T_Anpham", " 1=1", "---Chọn ấn phẩm---"); cbo_anpham.SelectedValue = Global.DefaultCombobox; UltilFunc.BindComboxSoBao(cboSoBao, int.Parse(cbo_anpham.SelectedValue.ToString()), 0); bintrang(int.Parse(cbo_anpham.SelectedValue.ToString())); } } }
protected void Page_Load(object sender, EventArgs e) { { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); if (!IsPostBack) { if (_user != null) { LoadCombox(); cbo_Sobao.Items.Clear(); if (cbo_Anpham.SelectedIndex > 0) { UltilFunc.BindComboxSoBao(cbo_Sobao, int.Parse(cbo_Anpham.SelectedValue.ToString()), 0); bintrang(int.Parse(cbo_Anpham.SelectedValue.ToString())); } else { cbo_Sobao.DataSource = null; cbo_Sobao.DataBind(); } } else { Page.Response.Redirect("~/login.aspx", true); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (UltilFunc.IsNumeric(Request["Menu_ID"])) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _userDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); btnAdd.Visible = _Role.R_Read; pages.PageIndex = 0; if (!IsPostBack) { UltilFunc.BindCombox(cbo_room, "Ma_Phongban", "Ten_Phongban", "T_Phongban", " 1=1", "---All---"); BinddDropDownList(0); int tab_id = 0; if (Request["Tab"] != null) { tab_id = Convert.ToInt32(Request["Tab"].ToString()); } if (tab_id == -1) { this.TabContainerListCV.ActiveTabIndex = 0; this.TabContainer1_ActiveTabChanged(sender, e); } else { this.TabContainerListCV.ActiveTabIndex = tab_id; this.TabContainer1_ActiveTabChanged(sender, e); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (UltilFunc.IsNumeric(Request["Menu_ID"])) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Admin/Errors/AccessDenied.aspx"); } _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _userDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); btnAdd.Visible = _Role.R_Read; if (!IsPostBack) { if (_user == null) { Page.Response.Redirect("~/login.aspx", true); } else { cbo_loaibao.Items.Clear(); UltilFunc.BindCombox(this.cbo_loaibao, "Ma_AnPham", "Ten_AnPham", "T_AnPham", " 1=1 ", "---"); if (Session["CurrentPage"] != null) { pages.PageIndex = int.Parse(Session["CurrentPage"].ToString()); Session["CurrentPage"] = null; Danhsach_Sobao(); } else { Danhsach_Sobao(); } } } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _userDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); btn_add.Visible = _Role.R_Read; string menuID = Request["Menu_ID"].ToString(); lblMenuID.Value = menuID; lblIPAddress.Value = IpAddress(); if (!IsPostBack) { BindData(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); DisableClientCaching(); if (!IsPostBack) { LoadCombox(); BindCombo(); } } } CreateGrid(); this.Trang_Bao.Value = ""; }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); this.btn_chamnhuanbut.Attributes.Add("onclick", "return CheckConfirmGuiTinbai('Are you sure you want royalties photo?',ctl00_MainContent_DataGrid_tinbaiAnh_ctl01_chkAll);"); if (!IsPostBack) { LoadCombox(); cbo_chuyenmuc.Items.Clear(); cboSoBao.Items.Clear(); if (cboAnPham.SelectedIndex > 0) { UltilFunc.BindComboxSoBao(cboSoBao, int.Parse(cboAnPham.SelectedValue.ToString()), 1); UltilFunc.BindCombox_CategoryDequy(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", " WHERE Ma_ChuyenMuc in (select Ma_ChuyenMuc from T_Nguoidung_Chuyenmuc where Ma_Nguoidung = " + _user.UserID.ToString() + ") and Ma_AnPham= " + cboAnPham.SelectedValue, CommonLib.ReadXML("lblChonchuyenmuc"), "Ma_Chuyenmuc_Cha"); } else { cbo_chuyenmuc.DataSource = null; cbo_chuyenmuc.DataBind(); cboSoBao.DataSource = null; cboSoBao.DataBind(); } LoadData(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) { Response.Redirect("~/Errors/AccessDenied.aspx"); } _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); this.btnXoaAnh.Attributes.Add("onclick", "return ConfirmQuestion('" + (string)HttpContext.GetGlobalResourceObject("cms.language", "lblBanmuonxoa") + "','ctl00_MainContent_dgrListPhotoOfNews_ctl01_chkAll');"); } Ma_QTBT = UltilFunc.GetColumnValuesOne("T_NguoidungQTBT", "Ma_QTBT", "Ma_Nguoidung=" + _user.UserID); if (Request["DT_id"] != null) { MaDetai = double.Parse(Request["DT_id"]); } else { MaDetai = 0; } if (Request["ID"] != null) { _id_newsonline = UltilFunc.GetColumnValuesOne("T_News", "News_ID", "RefID=" + Request["ID"]); _statusvnonline = UltilFunc.GetColumnValuesOne("T_News", "News_Status", "RefID=" + Request["ID"]); MaDetai = UltilFunc.GetColumnValuesOne("T_Vitri_Tinbai", "Ma_Congviec", "Ma_Tinbai=" + Request["ID"]); } if (!IsPostBack) { if (_user == null) { Page.Response.Redirect("~/login.aspx", true); } else { cbo_AnPham.Enabled = true; LoadCombox(); if (Request["ID"] != null) { txtID.Text = Request["ID"].ToString(); PopulateItem(int.Parse(Request["ID"].ToString())); } else { Session["matinbai"] = null; } BindDoiTuongGuiBai(); } } else { string EventName = Request.Form["__EVENTTARGET"].ToString(); if (EventName == "UploadImageSuccess") { LoadDataImage(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["Menu_ID"] != null && Request["Menu_ID"].ToString() != "" && Request["Menu_ID"].ToString() != String.Empty) { if (CommonLib.IsNumeric(Request["Menu_ID"]) == true) { if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"]))) Response.Redirect("~/Errors/AccessDenied.aspx"); _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"])); _Ma_QTBT = UltilFunc.GetColumnValuesOne("T_NguoidungQTBT", " Ma_QTBT", "Ma_Nguoidung=" + _user.UserID); this.LinkAdd.Visible = _Role.R_Read; this.LinkDelete.Visible = _Role.R_Delete; Pager7.PageIndex = 0; if (!IsPostBack) { if (_user != null) { LoadCombox(); if (Session["LoaibaoE"] != null && Session["SobaoE"] != null) { cbo_Anpham.SelectedValue = Session["LoaibaoE"].ToString(); if (cbo_Anpham.SelectedIndex > 0) { UltilFunc.BindComboxSoBao(cboSoBao, int.Parse(cbo_Anpham.SelectedValue.ToString()), 0); UltilFunc.BindCombox_CategoryDequy(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", " WHERE Ma_ChuyenMuc in (select Ma_ChuyenMuc from T_Nguoidung_Chuyenmuc where Ma_Nguoidung = " + _user.UserID.ToString() + ") and Ma_AnPham= " + cbo_Anpham.SelectedValue, (string)HttpContext.GetGlobalResourceObject("cms.language", "lblChonchuyenmuc"), "Ma_Chuyenmuc_Cha"); bintrang(int.Parse(cbo_Anpham.SelectedValue.ToString())); } cboSoBao.SelectedValue = Session["SobaoE"].ToString(); if (Session["TrangE"] != null) cboPage.SelectedValue = Session["TrangE"].ToString(); } int tab_id = 0; if (Session["CurrentPage"] != null) Pager7.PageIndex = int.Parse(Session["CurrentPage"].ToString()); if (Request["Tab"] != null) { tab_id = Convert.ToInt32(Request["Tab"].ToString()); } if (tab_id == -1) { this.TabContainer1.ActiveTabIndex = 0; this.TabContainer1_ActiveTabChanged(sender, e); } else { this.TabContainer1.ActiveTabIndex = tab_id; this.TabContainer1_ActiveTabChanged(sender, e); } GetTotalRecordTinBai(); BindDoiTuongGuiBai(); } else Page.Response.Redirect("~/login.aspx", true); } } } }
protected void Save_Click() { int Menu_ID = 0; string NoiDung = string.Empty; string SoTu = string.Empty; string NgayHT = string.Empty; string NguoiNhan = string.Empty; string tieudecv = string.Empty; string ip = string.Empty; try { System.Globalization.CultureInfo mProvider = new System.Globalization.CultureInfo("en-US", false); if (mContext.Request.QueryString["mn_id"] != "undefined") { Menu_ID = int.Parse(mContext.Request.QueryString["mn_id"], mProvider); } if (mContext.Request.QueryString["nguoinhan"] != "undefined") { NguoiNhan = mContext.Request.QueryString["nguoinhan"].ToString(); } if (mContext.Request.QueryString["tieudecv"] != "undefined") { tieudecv = mContext.Request.QueryString["tieudecv"].ToString(); } if (mContext.Request.QueryString["noidung"] != "undefined") { NoiDung = mContext.Request.QueryString["noidung"].ToString(); } if (mContext.Request.QueryString["sotu"] != "undefined") { SoTu = mContext.Request.QueryString["sotu"].ToString(); } if (mContext.Request.QueryString["ngayht"] != "undefined") { NgayHT = mContext.Request.QueryString["ngayht"].ToString(); } if (mContext.Request.QueryString["ip"] != "undefined") { ip = mContext.Request.QueryString["ip"].ToString(); } HPCBusinessLogic.NguoidungDAL _NguoidungDAL = new NguoidungDAL(); T_Users _user; T_RolePermission _Role = null; _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Menu_ID); #region GhiLog Lichsu_Thaotac_HethongDAL actionDAL = new Lichsu_Thaotac_HethongDAL(); T_Lichsu_Thaotac_Hethong action = new T_Lichsu_Thaotac_Hethong(); action.Ma_Nguoidung = _user.UserID; action.TenDaydu = _user.UserFullName; action.HostIP = ip; action.NgayThaotac = DateTime.Now; #endregion CongviecDAL _cvDAL = new CongviecDAL(); T_Congviec _cv = SetItem(NoiDung, SoTu, NgayHT, NguoiNhan, tieudecv); double _return = _cvDAL.InsertT_Congviec(_cv); action.Thaotac = "[Thêm mới công việc]-->[mã công việc:" + _return.ToString() + " ]"; actionDAL.InserT_Lichsu_Thaotac_Hethong(action); mContext.Response.Write("1"); } catch { mContext.Response.Write("0"); } }