Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
     if (_user != null)
     {
         if (!IsPostBack)
         {
             try
             {
                 double _News_ID = 0;
                 if (Request["id"] != null)
                 {
                     _News_ID = Convert.ToDouble(Request["id"]);
                 }
                 if (_News_ID > 0)
                 {
                     if (Request["Old_id"] != null)
                     {
                         this.TIT.Text = "<title>XEM, IN, VERSION BÀI VIẾT</title>";
                         LoadData_Version(_News_ID);
                     }
                     else
                     {
                         this.TIT.Text = "<title>XEM, IN CHI TIẾT</title>";
                         LoadData(_News_ID);
                     }
                 }
             }
             catch { }
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     this.Lbt_Delete.Attributes.Add("onclick", "return CheckConfirmDelete();");
     this.lbDelete.Attributes.Add("onclick", "return CheckConfirmDeleteDXL();");
     this.lbDuyet.Attributes.Add("onclick", "return CheckConfirmGuiTKTS();");
     this.Lbt_Send_Duyet.Attributes.Add("onclick", "return CheckConfirmGuiDuyet();");
     this.Lbt_TraLai.Attributes.Add("onclick", "return CheckConfirmTralai();");
     this.lbTralai.Attributes.Add("onclick", "return CheckConfirmTralaireturn();");
     this.lbDelet.Attributes.Add("onclick", "return CheckConfirmDeletereturn();");
     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);
             if (!IsPostBack)
             {
                 int tab_id = 0;
                 LoadCombox();
                 if (Request["Tab"] != null)
                 {
                     tab_id = Convert.ToInt32(Request["Tab"].ToString());
                 }
                 this.TabContainer1.ActiveTabIndex = tab_id;
                 this.TabContainer1_ActiveTabChanged(sender, e);
             }
         }
     }
 }
Пример #3
0
 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);
                 }
             }
         }
     }
 }
Пример #4
0
 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();
                 }
             }
         }
     }
 }
Пример #5
0
        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();
                        }
                    }
                }
            }
        }
Пример #6
0
 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);
             ActiverPermission();
             if (!IsPostBack)
             {
                 int tab_id = 0;
                 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);
                 }
                 LoadCombox();
             }
         }
     }
 }
Пример #7
0
 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();
             }
         }
     }
 }
Пример #8
0
        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);

                    if (!IsPostBack)
                    {
                        ddl_Madoituong.Enabled = false;
                        BindCombo();
                        BindData();
                        if (chk_Quytrinh.Checked)
                        {
                            ddl_Madoituong.Enabled = true;
                        }
                        else
                        {
                            ddl_Madoituong.Enabled = false;
                        }
                    }
                }
            }
        }
Пример #9
0
 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);
             if (!IsPostBack)
             {
                 LoadComboBox();
                 DataBind();
                 int pageback = 0;
                 try { pageback = int.Parse(Session["PageFromID"].ToString()); }
                 catch {; }
                 if (pageback == 2 || pageback == 3)
                 {
                     lbl_tien.Visible        = true;
                     txt_tiennhanbut.Visible = true;
                 }
                 else
                 {
                     lbl_tien.Visible        = false;
                     txt_tiennhanbut.Visible = false;
                 }
             }
         }
     }
 }
Пример #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
        if (Request["matinbai"] != null)
        {
            matinbai = double.Parse(Request["matinbai"].ToString());
        }

        obj                 = SetItem();
        matinbai            = Daltinbai.InsertT_Tinbai_WordOnline(obj);
        Session["matinbai"] = matinbai;
        Pathfolder          = Global.Pathfiledoc;
        if (freq.FileExtName == ".htm")
        {
            Filedoc = _user.UserID.ToString() + _user.UserName + matinbai.ToString() + "_" + Request["MaDoiTuong"].ToString() + ".htm";
        }
        else
        {
            Filedoc = _user.UserID.ToString() + _user.UserName + matinbai.ToString() + "_" + Request["MaDoiTuong"].ToString() + ".doc";
        }
        CreateFolderByUserName(Pathfolder);
        Filedoc = Server.MapPath("/" + Pathfolder + Filedoc);
        freq.SaveToFile(Filedoc);
        freq.Close();
        string filehtm     = _user.UserID.ToString() + _user.UserName + matinbai.ToString() + "_" + Request["MaDoiTuong"].ToString() + ".htm";
        string pathfilehtm = Server.MapPath("/" + Pathfolder + filehtm);

        Daltinbai.sp_updatenoidungtin(matinbai, ReadHtmlFile(pathfilehtm));
    }
Пример #11
0
        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);

                    if (!IsPostBack)
                    {
                        Session["where_chuyenmuc"] = null;
                        cbo_Anpham.Items.Clear();
                        UltilFunc.BindCombox(cbo_Anpham, "Ma_AnPham", "Ten_AnPham", "T_Anpham", " 1=1 ", "---Chọn ấn phẩm---");
                        cbo_Anpham.SelectedIndex = UltilFunc.GetIndexControl(cbo_Anpham, HPCComponents.Global.DefaultCombobox);
                        if (Session["CurrentPage"] != null)
                        {
                            pages.PageIndex = int.Parse(Session["CurrentPage"].ToString());
                            Danhsach_ChuyenMuc();
                        }
                        else
                        {
                            Danhsach_ChuyenMuc();
                        }
                    }
                }
            }
        }
Пример #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);

            if (!IsPostBack)
            {
                if (Session["MaAnPham"] == null)
                {
                    Page.Response.Redirect("~/login.aspx", true);
                }
                PanelLisTin.Visible = true;
                PnlDetail.Visible   = false;
                if (Session["MaAnPham"] != null)
                {
                    UltilFunc.BindCombox(cboAnPham, "Ma_Anpham", "Ten_Anpham", "T_Anpham", "1=1", "---Tất cả---");
                    cboSoBao.Items.Clear();
                    bool Flag = bool.Parse(System.Configuration.ConfigurationManager.AppSettings["Flag"].ToString());
                    if (!Flag)
                    {
                        cboAnPham.SelectedValue = Session["MaAnPham"].ToString();
                        if (cboAnPham.SelectedIndex > 0)
                        {
                            UltilFunc.BindComboxSoBao(cboSoBao, int.Parse(cboAnPham.SelectedValue.ToString()), 0);

                            bintrang(int.Parse(cboAnPham.SelectedValue));
                        }
                        else
                        {
                            cboSoBao.DataSource = null;
                            cboSoBao.DataBind();
                        }
                    }
                }
            }
        }
Пример #13
0
 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();
             strMenuID = Request["Menu_ID"].ToString();
             if (!IsPostBack)
             {
                 if (Session["CurrentPage"] != null)
                 {
                     pages.PageIndex = int.Parse(Session["CurrentPage"].ToString());
                     LoadData();
                     Session["CurrentPage"] = null;
                 }
                 else
                 {
                     LoadData();
                 }
             }
         }
     }
 }
Пример #14
0
        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();

                        }

                    }
                }
            }

        }
Пример #15
0
        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();
                    }
                }
            }
        }
Пример #16
0
 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.getGetRole4UserMenu(_user.Ma_Nguoidung, Convert.ToInt32(Request["Menu_ID"]));
             //this.btnAddMenu.Enabled = _Role.R_Add;
             if (!IsPostBack)
             {
                 if (Session["CurrentPage"] != null)
                 {
                     pages.PageIndex        = int.Parse(Session["CurrentPage"].ToString());
                     Session["CurrentPage"] = null;
                     Danhsach_Khachhang();
                 }
                 else
                 {
                     Danhsach_Khachhang();
                 }
             }
         }
     }
 }
Пример #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (HttpContext.Current.Request.QueryString["vType"] != null)
     {
         strNumberArg = HttpContext.Current.Request.QueryString["vType"].ToString();
     }
     _user = _DAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
     if (_user == null)
     {
         Response.Redirect(Global.ApplicationPath + "/Login.aspx");
     }
     if (!this.IsPostBack)
     {
         if (_user != null)
         {
             LoadCM();
             txt_FromDate.Text = DateTime.Now.AddDays(-1).ToString("dd'/'MM'/'yyyy");
             txt_ToDate.Text   = DateTime.Now.ToString("dd'/'MM'/'yyyy");
             ListImages();
         }
     }
     else
     {
         string EventName = Request.Form["__EVENTTARGET"].ToString();
         if (EventName == "UploadSuccess")
         {
             ListImages();
         }
     }
 }
Пример #18
0
        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);
                    if (!IsPostBack)
                    {
                        UltilFunc.BindCombox(cbo_room, "Ma_Phongban", "Ten_Phongban", "T_Phongban", " 1=1", "---Select all---");

                        if (Request["ID"] != null)
                        {
                            GetItem(double.Parse(Request["ID"]));
                        }
                        if (nguoinhan != 0)
                        {
                            Linkhuycv.Visible = true;
                            linkSave.Text     = (string)HttpContext.GetGlobalResourceObject("cms.language", "lblHoanthanh");
                        }
                        else
                        {
                            Linkhuycv.Visible = false;
                            linkSave.Text     = (string)HttpContext.GetGlobalResourceObject("cms.language", "lblNhanviec");
                        }
                    }
                }
            }
        }
 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);
             if (!IsPostBack)
             {
                 LoadCombox();
                 type = int.Parse(cbo_types.SelectedValue);
                 if (type == 1)
                 {
                     LoadData();
                 }
                 else if (type == 2)
                 {
                     LoadGocAnh();
                 }
                 else if (type == 3)
                 {
                     LoadMutimedia();
                 }
                 else if (type == 4)
                 {
                     LoadThoiSuAnh();
                 }
             }
         }
     }
 }
Пример #20
0
        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);

                    //this.LinkButton6.Attributes.Add("onclick", "return CheckConfirmDelete();");
                    //this.LinkButton5.Attributes.Add("onclick", "return CheckConfirmGuiThuKyToaSoanDangXyLy();");
                    this.LinkButton3.Attributes.Add("onclick", "return CheckConfirmGuiThuKyToaSoanReturn();");
                    this.LinkButton4.Attributes.Add("onclick", "return CheckConfirmDeleteReturn();");
                    pages.PageIndex = 0;
                    if (!IsPostBack)
                    {
                        this.TabContainer1.ActiveTabIndex = 0;
                        this.TabContainer1_ActiveTabChanged(sender, e);

                        LoadCombox();
                        DataBind();
                    }
                }
            }
        }
Пример #21
0
        public void ProcessRequest(HttpContext context)
        {
            _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
            string prefixText = context.Request.QueryString["q"];

            string userid = HPCSecurity.CurrentUser.Identity.ID.ToString();

            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            string    sql = "select top 20 Ma_Nguoidung, LTRIM(RTRIM(Ten_Dangnhap))+case when Loai=1 then ' (CTV)' when Loai=0 then '' end as Ten_Dangnhap from T_Nguoidung where  (Trangthai_Xoa=0 or Trangthai_Xoa is null) and Ten_Dangnhap LIKE N'%" + prefixText + "%' and Ten_Dangnhap is not null ";
            DataTable dt  = new DataTable();

            dt = ulti.ExecSqlDataSet(sql).Tables[0];
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    sb.Append(string.Format("{0}|{1}", dt.Rows[i]["Ten_Dangnhap"].ToString(), dt.Rows[i]["Ma_Nguoidung"].ToString())).Append(Environment.NewLine);
                }
                context.Response.Write(sb.ToString());
            }
            else
            {
                sb.Append(string.Format("{0}|{1}", prefixText, "0")).Append(Environment.NewLine);
                context.Response.Write("Không có tác giả này!");
            }
        }
Пример #22
0
        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();
                    }
                }
            }
        }
Пример #23
0
        public ChuyenmucDetails[] BindDatatoDropdownChuyenmuc(object AnphamID)
        {
            _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
            DataTable dt = new DataTable();

            string _sql = string.Empty;

            _sql = "set dateformat dmy; SELECT Ma_ChuyenMuc,Ten_ChuyenMuc FROM 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= " + AnphamID + " AND Ma_Chuyenmuc_Cha = 0 ";
            int Rank = 0;

            try
            {
                dt = ulti.ExecSqlDataSet(_sql).Tables[0];
                foreach (DataRow dtrow in dt.Rows)
                {
                    ChuyenmucDetails _listchuyenmuc = new ChuyenmucDetails();

                    _listchuyenmuc.Ma_ChuyenMuc  = Convert.ToInt32(dtrow["Ma_ChuyenMuc"].ToString());
                    _listchuyenmuc.Ten_ChuyenMuc = dtrow["Ten_ChuyenMuc"].ToString();
                    details.Add(_listchuyenmuc);
                    BinTreeCategorys(Rank, dtrow["Ma_ChuyenMuc"].ToString());
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(details.ToArray());
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
     if (!IsPostBack)
     {
         if (Request["key"].ToString() == "1")
         {
             PanelInfor.Visible    = true;
             PanelPassword.Visible = false;
             btnSave.Text          = (string)HttpContext.GetGlobalResourceObject("cms.language", "lblLuuthongtin");
         }
         else
         {
             btnSave.Text          = (string)HttpContext.GetGlobalResourceObject("cms.language", "lblLuumatkhau");
             PanelInfor.Visible    = false;
             PanelPassword.Visible = true;
         }
         if (_user != null)
         {
             LoadComBo();
             PopulateItem(_user.UserID);
         }
         else
         {
             Page.Response.Redirect("~/login.aspx", true);
         }
     }
 }
Пример #25
0
 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);
             if (!IsPostBack)
             {
                 if (Session["CurrentPage"] != null)
                 {
                     pages.PageIndex = int.Parse(Session["CurrentPage"].ToString());
                     BindList_AnphamMau();
                 }
                 else
                 {
                     BindList_AnphamMau();
                 }
             }
         }
     }
 }
Пример #26
0
 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);
             if (!IsPostBack)
             {
                 LoadComboBox();
                 DataBind();
                 if (Request["Tab"] != null)
                 {
                     tab = int.Parse(Request["Tab"].ToString());
                 }
                 if (tab == 0)
                 {
                     linkbtn_SendTPBT.Visible = false;
                 }
                 else
                 {
                     linkbtn_SendTPBT.Visible = 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);
             ActiverPermisstion();
             if (!IsPostBack)
             {
                 int tab = 0;
                 if (Request["TabID"] != null && !string.IsNullOrEmpty(Request["TabID"].ToString()))
                 {
                     if (UltilFunc.IsNumeric(Request["TabID"]))
                     {
                         tab = int.Parse(Request["TabID"].ToString());
                     }
                 }
                 LoadComboBox();
                 TabContainer1.ActiveTabIndex = tab;
                 TabContainer1_ActiveTabChanged(sender, e);
             }
         }
     }
 }
Пример #28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     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.link_HuyXB.Visible = _Role.R_Pub;
     this.link_HuyXB.Attributes.Add("onclick", "return ConfirmQuestion('" + CommonLib.ReadXML("lblBanmuonhuyXB") + "','ctl00_MainContent_DataGrid_DaXB_ctl01_chkAll');");
     //this.LinkButton1.Visible = _Role.R_Pub;
     this.LinkButton1.Attributes.Add("onclick", "return ConfirmQuestion('" + CommonLib.ReadXML("lblBanmuonhuyXB") + "','ctl00_MainContent_DataGrid_DaXB_ctl01_chkAll');");
     if (!IsPostBack)
     {
         string back        = "";
         string text_search = "";
         try { back = Request["Back"].ToString(); }
         catch {; }
         int pageindex = 0, langid = 0;
         LoadComboBox();
         if (!string.IsNullOrEmpty(back))
         {
             try { text_search = Session["PSDaXB_TenPS"].ToString(); }
             catch {; }
             try { langid = int.Parse(Session["PSDaXB_Langid"].ToString()); }
             catch {; }
             try { pageindex = int.Parse(Session["PSDaXB_pagesindex"].ToString()); }
             catch {; }
             txtSearch_Cate.Text      = text_search;
             cboNgonNgu.SelectedValue = langid.ToString();
             Pager_DaXB.PageIndex     = pageindex;
         }
         LoadPSXB();
     }
 }
Пример #29
0
        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();
                        }
                    }
                }
            }
        }
Пример #30
0
        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);
                    }
                }
            }
        }