Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["vType"] != null)
     {
         vType = Request.QueryString["vType"].ToString();
     }
     if (Request.QueryString["vKey"] != null)
     {
         strNumberArg = Request.QueryString["vKey"].ToString();
     }
     _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
     if (_user == null)
     {
         Response.Redirect(Global.ApplicationPath + "/Login.aspx", true);
     }
     if (!this.IsPostBack)
     {
         if (_user != null)
         {
             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();
         }
     }
 }
 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);
             }
         }
     }
 }
Esempio n. 3
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)
 {
     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)
             {
                 //HPCBusinessLogic.DAL.T_ThantoanTinbai obj = new HPCBusinessLogic.DAL.T_ThantoanTinbai();
                 //obj.GetLuongtoithieu();
                 //txt_luong.Text = obj.GetLuongtoithieu().ToString();
                 loadRole();
                 LoadCombox();
                 LoadTacgia();
                 type = int.Parse(cbo_types.SelectedValue);
             }
         }
     }
 }
 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();
                 }
             }
         }
     }
 }
 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();
                 }
             }
         }
     }
 }
Esempio n. 7
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;
                 }
             }
         }
     }
 }
Esempio n. 8
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();
     }
 }
        public void ProcessRequest(HttpContext context)
        {
            HPCBusinessLogic.NguoidungDAL _userDAL = new NguoidungDAL();
            SSOLib.ServiceAgent.T_Users   _user    = null;
            string prefixText = context.Request.QueryString["q"];

            _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
            string        userid = _user.UserID.ToString();// HPCSecurity.CurrentUser.Identity.ID.ToString();
            StringBuilder sb     = new StringBuilder();
            T_ButdanhDAL  _DAL   = new T_ButdanhDAL();
            DataSet       _ds;

            _ds = _DAL.Bin_T_ButdanhDynamic(userid, prefixText, false);
            if (_ds.Tables[0].Rows.Count > 0)
            {
                for (int _i = 0; _i < _ds.Tables[0].Rows.Count; _i++)
                {
                    sb.Append(string.Format("{0}|{1}", _ds.Tables[0].Rows[_i]["BD_Name"].ToString(), _ds.Tables[0].Rows[_i]["BD_ID"].ToString())).Append(Environment.NewLine);
                }
            }
            else
            {
                sb.Append(string.Format("{0}|{1}", prefixText, "0")).Append(Environment.NewLine);
            }
            context.Response.Write(sb.ToString());
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
     if (_user != null)
     {
         if (!IsPostBack)
         {
             LoadCombox();
             this.LoadData_DangXuly();
         }
     }
 }
Esempio n. 11
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"]));
     ActiverPemission();
     if (!IsPostBack)
     {
         string back        = "";
         string text_search = "";
         try { back = Request["Back"].ToString(); }
         catch {; }
         int pageindex = 0, tabindex = 0, langid = 0;
         LoadComboBox();
         if (!string.IsNullOrEmpty(back))
         {
             try { tabindex = int.Parse(Session["DuyetPS_TabID"].ToString()); }
             catch {; }
             try { text_search = Session["DuyetPS_TenPS"].ToString(); }
             catch {; }
             try { langid = int.Parse(Session["DuyetPS_Langid"].ToString()); }
             catch {; }
             try { pageindex = int.Parse(Session["DuyetPS_pagesindex"].ToString()); }
             catch {; }
             txtSearch_Cate.Text      = text_search;
             cboNgonNgu.SelectedValue = langid.ToString();
             if (tabindex == 0)
             {
                 TabContainer1.ActiveTabIndex = 0;
                 Pager_choduyet.PageIndex     = pageindex;
             }
             else if (tabindex == 1)
             {
                 TabContainer1.ActiveTabIndex = 1;
                 Pager_HuyXB.PageIndex        = pageindex;
             }
             else
             {
                 Pager_choduyet.PageIndex = 0;
             }
         }
         else
         {
             Pager_choduyet.PageIndex = 0;
         }
         LoadPSchoduyet();
         LoadPSdaduyet();
         LoadPShuyXB();
     }
 }
Esempio n. 12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
     if (_user == null)
     {
         Response.Redirect(HPCComponents.Global.ApplicationPath + "/login.aspx", true);
     }
     else
     {
         this.txt_FromDate.Text = DateTime.Now.Date.AddDays(-7).ToString("dd/MM/yyyy");
         this.txtToDate.Text    = DateTime.Now.ToString("dd/MM/yyyy");
     }
 }
Esempio n. 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"]));

                    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);
                        //}
                    }
                }
            }
        }
Esempio n. 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 = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
             if (!IsPostBack)
             {
                 LoadCombox();
             }
         }
     }
 }
Esempio n. 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);
             this.LinkSend.Attributes.Add("onclick", "return  CheckConfirmAll('Bạn có muốn gửi duyệt không?');");
             if (!IsPostBack)
             {
                 LoadComboBox();
                 DataBind();
             }
         }
     }
 }
Esempio n. 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("~/Errors/AccessDenied.aspx");
             }
             _user     = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
             _Role     = _userDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"]));
             strMenuID = Request["Menu_ID"].ToString();
             if (!IsPostBack)
             {
                 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);
             this.btnReturnEdit.Attributes.Add("onclick", "return confirm('" + CommonLib.ReadXML("lblBanmuonhuyXB") + "');");
             if (!IsPostBack)
             {
                 LoadComboBox();
                 DataBind();
             }
         }
     }
 }
Esempio n. 18
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)
                 {
                     this.TIT.Text = "<title>" + CommonLib.ReadXML("titXemversion") + "</title>";
                     Search();
                 }
                 //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 { }
         }
     }
 }
Esempio n. 19
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"]));
             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);
                 }
             }
         }
     }
 }
Esempio n. 20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
     if (!IsPostBack)
     {
         try
         {
             string ticket = "";
             int    proId  = 0;
             int    id     = 0;
             if (Request["Ticket"] != null)
             {
                 ticket = Request["Ticket"].ToString();
             }
             if (Request["ProductID"] != null)
             {
                 proId = Convert.ToInt32(Request["ProductID"]);
             }
             if (Request["ID"] != null)
             {
                 id = Convert.ToInt32(Request["ID"]);
             }
             if (id > 0)
             {
                 if (proId == 1)
                 {
                     this.TIT.Text = "<title>XEM CHI TIẾT TIN NGUỒN</title>";
                 }
                 else
                 {
                     this.TIT.Text = "<title>XEM CHI TIẾT TIN TƯ LIỆU</title>";
                 }
                 LoadData(ticket, proId, id);
             }
         }
         catch { }
     }
 }
Esempio n. 21
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);
             ActiverPermission();
             if (!IsPostBack)
             {
                 LoadCombox();
                 int tab_id = 0;
                 int.TryParse(Request["Tab"] == null ? "0" : Request["Tab"], out tab_id);
                 this.TabContainer1.ActiveTabIndex = tab_id;
                 this.TabContainer1_ActiveTabChanged(sender, e);
             }
         }
     }
 }
Esempio n. 22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
     if (_user != null)
     {
         if (!Page.IsPostBack)
         {
             int          id    = int.Parse(Page.Request.QueryString["ID"].ToString());
             T_News       obj   = new T_News();
             T_NewsDAL    dal   = new T_NewsDAL();
             ChuyenmucDAL caDal = new ChuyenmucDAL();
             obj = dal.load_T_news(id);
             if (obj.CAT_ID > 0)
             {
                 this.litCatName.Text = caDal.GetOneFromT_ChuyenmucByID(int.Parse(obj.CAT_ID.ToString())).Ten_ChuyenMuc;
             }
             else
             {
                 this.litCatName.Text = "";
             }
             this.litDanNhap.Text = obj.News_Sub_Title.ToString();
             this.litTittle.Text  = obj.News_Tittle.ToString();
             this.LitSummery.Text = CleanHTMLFont(CleanHTMLSummary(obj.News_Summary.ToString()));
             this.litContent.Text = CleanHTMLFont(obj.News_Body.ToString());
             if (obj.News_Status == 6)
             {
                 this.LitDatePublisher.Text = obj.News_DateEdit.ToString("dd/MM/yyyy HH:mm") + " (GMT + 7)";
             }
             string count = this.litContent.Text;
             this.LitCount.Text = UltilFunc.WordCount(count) + " từ ";
         }
     }
     else
     {
         Response.Redirect("~/Errors/AccessDenied.aspx");
     }
 }
Esempio n. 23
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)
                    {
                        LoadComboBox();
                        if (Session["AsdLogolist_LangID"] != null && !string.IsNullOrEmpty(Session["AsdLogolist_LangID"].ToString()))
                        {
                            string langid = "0";
                            langid = Session["AsdLogolist_LangID"].ToString().Trim();
                            cbo_lanquage.SelectedValue = langid;
                        }
                        Session["AsdLogolist_LangID"] = null;
                        Session["AsdLogolist_CATID"]  = null;

                        if (Session["CurrentPage"] != null)
                        {
                            pages.PageIndex        = int.Parse(Session["CurrentPage"].ToString());
                            Session["CurrentPage"] = null;
                        }
                        LoadData();
                    }
                }
            }
        }
Esempio n. 24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _user = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
     if (_user != null)
     {
         if (!IsPostBack)
         {
             try
             {
                 double _ID = 0;
                 if (Request["id"] != null)
                 {
                     _ID = Convert.ToDouble(Request["id"]);
                 }
                 if (_ID > 0)
                 {
                     _obj            = DAL.GetOneFromT_Photo_EventsByID(_ID);
                     Image1.ImageUrl = ConfigurationManager.AppSettings["tinpathbdt"].ToString() + _obj.Photo_Medium;
                 }
             }
             catch { }
         }
     }
 }
Esempio n. 25
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Expires     = -1;
            try
            {
                HttpPostedFile postedFile = context.Request.Files["Filedata"];
                int            inStock    = 0;
                try
                {
                    inStock = int.Parse(context.Request.QueryString["inStock"].ToString().Trim());
                }
                catch {; }
                int WaterMark = 0;
                try
                {
                    WaterMark = int.Parse(context.Request.QueryString["watermark"].ToString().Trim());
                }
                catch {; }
                int spacevalue = 0;
                try { spacevalue = int.Parse(ConfigurationManager.AppSettings["SpaceValue"].ToString()); }
                catch {; }
                string _logo = context.Server.MapPath("../Dungchung/Images/IconHPC/LoGoBaoNongNghiep.png");

                string[] sArrProdID = null;
                char[]   sep        = { '?' };
                string[] sArrVkey   = null;
                string   strUserID  = string.Empty;
                char[]   sep2       = { ',' };
                sArrProdID = context.Request.QueryString["user"].ToString().Trim().Split(sep);
                sArrVkey   = sArrProdID[0].ToString().Trim().Split(sep2);
                string chuyenmuc          = sArrVkey[sArrVkey.Length - 1];
                string _urlSave           = string.Empty;
                string FolderCat          = string.Empty;
                string savepath           = string.Empty;
                string tempPath           = string.Empty;
                string strRootPathVirtual = string.Empty;
                _user     = _userDAL.GetUserByUserName(sArrVkey[0].ToString());
                strUserID = _user.UserID.ToString();
                string vType = sArrVkey[1].ToString();
                if (vType == "1")
                {
                    FolderCat = "/Article/";
                }
                else if (vType == "2")
                {
                    FolderCat = "/Ads/";
                }
                else if (vType == "3")
                {
                    if (inStock != 0)
                    {
                        FolderCat = "/InStock/";
                    }
                    else
                    {
                        FolderCat = "/Video/";
                    }
                }
                else if (vType == "4")
                {
                    FolderCat = "/FileAttach/";
                }
                else
                {
                    FolderCat = string.Empty;
                }
                tempPath           = System.Configuration.ConfigurationManager.AppSettings["UploadPathBDT"] + FolderCat + sArrVkey[0].ToString() + "/";
                strRootPathVirtual = tempPath + DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Day.ToString() + "/";
                savepath           = context.Server.MapPath(strRootPathVirtual);


                string filename   = getFileNameUnique(savepath + @"\", postedFile.FileName, Path.GetFileNameWithoutExtension(postedFile.FileName), Path.GetExtension(postedFile.FileName.ToString()));
                string _extenfile = Path.GetExtension(filename.ToString());
                string strFileNameWithoutExtension = System.IO.Path.GetFileNameWithoutExtension(postedFile.FileName).Trim();
                if (!Directory.Exists(savepath))
                {
                    Directory.CreateDirectory(savepath);
                }
                if (_extenfile.ToLower().Contains(".jpg") ||
                    _extenfile.ToLower().Contains(".gif") ||
                    _extenfile.ToLower().Contains(".png") ||
                    _extenfile.ToLower().Contains(".bmp") ||
                    _extenfile.ToLower().Contains(".jpeg"))
                {
                    postedFile.SaveAs(savepath + @"\" + filename);
                }
                double CATID = 0;
                try { CATID = double.Parse(chuyenmuc); }
                catch {; }

                string _imagesEndWatermark = getFileNameUnique(savepath + @"\", postedFile.FileName, Path.GetFileNameWithoutExtension(filename), _extenfile);

                _urlSave = UrlPathImage_RemoveUpload(strRootPathVirtual + _imagesEndWatermark);
                if (_extenfile.ToLower() != ".flv" && _extenfile.ToLower() != ".swf" && _extenfile.ToLower() != ".mp3" && _extenfile.ToLower() != ".mp4" && _extenfile.ToLower() != ".wmv" && _extenfile.ToLower() != ".doc" && _extenfile.ToLower() != ".docx" && _extenfile.ToLower() != ".xls" && _extenfile.ToLower() != ".rar" && _extenfile.ToLower() != ".txt" && _extenfile.ToLower() != ".pdf")
                {
                    if (WaterMark > 0)
                    {
                        Bitmap Imagemark = new Bitmap(_logo);
                        HPCImageResize.SaveImage2Server(savepath, filename, "mark_" + _imagesEndWatermark, _imagesEndWatermark, _logo, Convert.ToInt32(HPCComponents.Global.VNPResizeImages), Convert.ToInt32(HPCComponents.Global.VNPResizeImages), WaterMark, spacevalue);
                    }
                    else
                    {
                        HPCImageResize.SaveImage2Server(savepath, filename, _imagesEndWatermark, Convert.ToInt32(HPCComponents.Global.VNPResizeImages), Convert.ToInt32(HPCComponents.Global.VNPResizeImages));
                    }
                }
                else
                {
                    postedFile.SaveAs(Path.Combine(savepath, _imagesEndWatermark));
                }

                //phan insert co so du lieu
                T_ImageFiles  _obj = new T_ImageFiles();
                ImageFilesDAL _DAL = new ImageFilesDAL();
                _obj = SetItem(_imagesEndWatermark, postedFile.ContentLength, _urlSave, _extenfile, Convert.ToInt16(strUserID), Convert.ToInt16(vType), 0);
                int _idReturn = _DAL.InsertT_ImageFiles(_obj);
                if (inStock != 0)
                {
                    _DAL.UpdateStatusDataByID(" AuthorID =1 Where ID =" + _idReturn);
                }
                context.Response.Write(savepath + "/" + _imagesEndWatermark);
                context.Response.StatusCode = 200;
            }
            catch (Exception ex)
            {
                context.Response.Write("Error: " + ex.Message);
            }
        }
Esempio n. 26
0
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     context.Response.Expires     = -1;
     try
     {
         HttpPostedFile postedFile = context.Request.Files["Filedata"];
         string[]       sArrProdID = null;
         char[]         sep        = { '?' };
         string[]       sArrVkey   = null;
         string         strUserID  = "";
         char[]         sep2       = { ',' };
         sArrProdID = context.Request.QueryString["user"].ToString().Trim().Split(sep);
         sArrVkey   = sArrProdID[0].ToString().Trim().Split(sep2);
         string _urlSave           = "";
         string FolderCat          = "";
         string savepath           = "";
         string tempPath           = "";
         string strRootPathVirtual = "";
         _user     = _userDAL.GetUserByUserName(sArrVkey[0].ToString());
         strUserID = _user.UserID.ToString();
         string vType   = sArrVkey[1].ToString();
         string AlbumID = sArrVkey[2].ToString();
         if (vType == "1")
         {
             FolderCat = "/Article/";
         }
         else if (vType == "2")
         {
             FolderCat = "/Ads/";
         }
         else if (vType == "3")
         {
             FolderCat = "/Video/";
         }
         else if (vType == "4")
         {
             FolderCat = "/Photo24/";
         }
         else
         {
             FolderCat = "";
         }
         tempPath           = System.Configuration.ConfigurationManager.AppSettings["UploadPathBDT"] + FolderCat + sArrVkey[0].ToString() + "/";
         strRootPathVirtual = tempPath + DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Day.ToString() + "/";
         savepath           = context.Server.MapPath(strRootPathVirtual);
         string filename   = DateTime.Now.Millisecond.ToString() + "_" + postedFile.FileName;
         string _extenfile = Path.GetExtension(filename.ToString().Trim()).Replace(".", "");
         if (!Directory.Exists(savepath))
         {
             Directory.CreateDirectory(savepath);
         }
         postedFile.SaveAs(savepath + @"\" + filename);
         string _logo = context.Server.MapPath("../Dungchung/Images/IconHPC/LoGoDongDau.png");
         string _imagesEndWatermark = DateTime.Now.ToString("yyyyMMdd").ToString() + DateTime.Now.ToString("HHmmss") + DateTime.Now.Millisecond + UltilFunc.ReplaceCharsRewrite(filename.Replace(Path.GetExtension(filename.ToString().Trim()), "")) + "." + _extenfile;
         _urlSave = UrlPathImage_RemoveUpload(strRootPathVirtual + _imagesEndWatermark);
         // Begin BO CT EDIT Đóng dấu ảnh
         if (Convert.ToBoolean(Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["WatermarkImages"])))
         {
             HPCImageResize.SaveImage2Server(savepath, filename, "rez_" + filename, _imagesEndWatermark, _logo, Convert.ToInt32(HPCComponents.Global.VNPResizeImages), Convert.ToInt32(HPCComponents.Global.VNPResizeImages));
         }
         else// Không đóng dấu ảnh //END
         {
             HPCImageResize.SaveImage2Server(savepath, filename, _imagesEndWatermark, Convert.ToInt32(HPCComponents.Global.VNPResizeImages), Convert.ToInt32(HPCComponents.Global.VNPResizeImages));
         }
         // INSERT DATABASE
         //phan insert co so du lieu
         HPCInfo.T_Album_Photo _obj = new HPCInfo.T_Album_Photo();
         HPCBusinessLogic.DAL.T_Album_PhotoDAL _cateDAL = new HPCBusinessLogic.DAL.T_Album_PhotoDAL();
         _obj = setItem_Album_Photo(Convert.ToInt32(AlbumID.ToString()), filename, filename, postedFile.ContentLength.ToString(), "", "", _extenfile, 1, 0, _urlSave);
         _cateDAL.InsertT_Album_Photo(_obj);
         context.Response.Write(savepath + "/" + filename);
         context.Response.StatusCode = 200;
     }
     catch (Exception ex)
     {
         context.Response.Write("Error: " + ex.Message);
     }
 }
Esempio n. 27
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"]));
             this.ActiverPerssion();
             if (!IsPostBack)
             {
                 string back        = "";
                 string text_search = "";
                 try { back = Request["Back"].ToString(); }
                 catch {; }
                 int pageindex = 0, tabindex = 0, langid = 0;
                 LoadComboBox();
                 if (!string.IsNullOrEmpty(back))
                 {
                     try { text_search = Session["QLPS_TenPS"].ToString(); }
                     catch {; }
                     try { langid = int.Parse(Session["CurrentLangid_QLPS"].ToString()); }
                     catch {; }
                     try { pageindex = int.Parse(Session["CurrentPage_QLPS"].ToString()); }
                     catch {; }
                     try { tabindex = int.Parse(Session["CurrentTab_QLPS"].ToString()); }
                     catch {; }
                     txtSearch_Cate.Text      = text_search;
                     cboNgonNgu.SelectedValue = langid.ToString();
                     if (tabindex == 0)
                     {
                         pages.PageIndex = pageindex;
                         TabContainer1.ActiveTabIndex = tabindex;
                     }
                     else if (tabindex == 2)
                     {
                         Pager_tralai.PageIndex       = pageindex;
                         TabContainer1.ActiveTabIndex = tabindex;
                     }
                     else
                     {
                         TabContainer1.ActiveTabIndex = 0; pages.PageIndex = 0;
                     }
                     Session["CurrentPage_QLPS"]   = null;
                     Session["CurrentTab_QLPS"]    = null;
                     Session["CurrentLangid_QLPS"] = null;
                 }
                 else
                 {
                     TabContainer1.ActiveTabIndex = 0; pages.PageIndex = 0;
                 }
                 int tab_id = 0;
                 int.TryParse(Request["Tab"] == null ? "0" : Request["Tab"], out tab_id);
                 this.TabContainer1.ActiveTabIndex = tab_id;
                 this.TabContainer1_ActiveTabChanged(sender, e);
                 //LoadPSmoi();
                 //LoadPStralai();
                 //LoadPSdaduyet();
                 //LoadPSchoduyet();
             }
         }
     }
 }