Пример #1
0
        public void LoadCombox()
        {
            _Anphamdefault = UltilFunc.GetColumnValuesOne("T_AnPham", " Ma_AnPham", "Ma_QT=" + _Ma_QTBT);
            UltilFunc.BindCombox(cbo_Anpham, "Ma_Anpham", "Ten_Anpham", "T_Anpham", " Ma_QT in (select Ma_QTBT from T_NguoidungQTBT where Ma_Nguoidung=" + _user.UserID + ")", (string)HttpContext.GetGlobalResourceObject("cms.language", "lblChonanpham"));
            if (_Anphamdefault > 0)
                cbo_Anpham.SelectedValue = _Anphamdefault.ToString();

            cbo_chuyenmuc.Items.Clear();
            cboSoBao.Items.Clear();
            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");

            }
            else
            {
                cbo_chuyenmuc.DataSource = null;
                cbo_chuyenmuc.DataBind();

                cboSoBao.DataSource = null;
                cboSoBao.DataBind();
            }
            bintrang(int.Parse(cbo_Anpham.SelectedValue));
        }
Пример #2
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();

                        }

                    }
                }
            }

        }
Пример #3
0
 private void LoadCombox()
 {
     UltilFunc.BindCombox(ddlLang, "ID", "TenNgonNgu", "T_NgonNgu", " Hoatdong=1 and ID=" + HPCComponents.Global.DefaultCombobox + " and ID in (select Ma_Ngonngu from T_Nguoidung_NgonNgu where Ma_Nguoidung=" + _user.UserID + ")", "---Tất cả---");
     ddlLang.SelectedIndex = UltilFunc.GetIndexControl(ddlLang, HPCComponents.Global.DefaultCombobox);
     if (ddlLang.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= " + ddlLang.SelectedValue, "-Chọn chuyên mục-", "Ma_Chuyenmuc_Cha");
     }
 }
Пример #4
0
        protected void cbo_AnPham_SelectedIndexChanged(object sender, EventArgs e)
        {
            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, (string)HttpContext.GetGlobalResourceObject("cms.language", "lblChonchuyenmuc"), "Ma_Chuyenmuc_Cha");
            }
            else
            {
                cbo_chuyenmuc.DataSource = null;
                cbo_chuyenmuc.DataBind();
            }
        }
Пример #5
0
 protected void ddlLang_SelectedIndexChanged(object sender, EventArgs e)
 {
     cbo_chuyenmuc.Items.Clear();
     if (ddlLang.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= " + ddlLang.SelectedValue, "-Chọn chuyên mục-", "Ma_Chuyenmuc_Cha");
         cbo_chuyenmuc.UpdateAfterCallBack = true;
     }
     else
     {
         cbo_chuyenmuc.DataSource = null;
         cbo_chuyenmuc.DataBind();
         cbo_chuyenmuc.UpdateAfterCallBack = true;
     }
 }
Пример #6
0
        protected void cbo_anpham_SelectedIndexChanged(object sender, EventArgs e)
        {
            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();
            }

        }
Пример #7
0
        private void LoadComboBox()
        {
            int     id  = int.Parse(Page.Request.QueryString["ID"].ToString());
            T_Idiea obj = new T_Idiea();

            HPCBusinessLogic.DAL.T_IdieaDAL dal = new HPCBusinessLogic.DAL.T_IdieaDAL();
            int _curentID = dal.GetOneFromT_IdieaByID(id).User_Created;

            UltilFunc.BindCombox(ddlLang, "ID", "TenNgonNgu", "T_NgonNgu", " Hoatdong=1 and ID=" + HPCComponents.Global.DefaultCombobox + " and ID in (select Ma_Ngonngu from T_Nguoidung_NgonNgu where Ma_Nguoidung=" + _user.UserID + ")", "---Tất cả---");

            ddlLang.SelectedIndex = UltilFunc.GetIndexControl(ddlLang, HPCComponents.Global.DefaultCombobox);
            if (ddlLang.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= " + ddlLang.SelectedValue, "-Chọn chuyên mục-", "Ma_Chuyenmuc_Cha");
            }
            UltilFunc.BindCombox(ddlGroup, "Ma_nhom", "Ten_nhom", "T_Nhom", " 1=1  Order by Ten_Nhom", "");
            BindComboxNguoiNhan(0);
        }
        protected void cboAnPham_SelectedIndexChanged(object sender, EventArgs e)
        {
            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, "-Chọn chuyên mục-", "Ma_Chuyenmuc_Cha");
            }
            else
            {
                cbo_chuyenmuc.DataSource = null;
                cbo_chuyenmuc.DataBind();

                cboSoBao.DataSource = null;
                cboSoBao.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 (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();
                    }
                }
            }
        }
Пример #10
0
        protected void PopulateItem(int _ID)
        {
            T_Idiea obj_Idiea = new T_Idiea();

            HPCBusinessLogic.DAL.T_IdieaDAL obj_DAL = new HPCBusinessLogic.DAL.T_IdieaDAL();
            obj_Idiea             = obj_DAL.GetOneFromT_IdieaByID(_ID);
            Txt_tieude.Text       = obj_Idiea.Title;
            ddlLang.SelectedValue = obj_Idiea.Lang_ID.ToString();
            cbo_chuyenmuc.Items.Clear();
            if (ddlLang.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= " + ddlLang.SelectedValue, "-Chọn chuyên mục-", "Ma_Chuyenmuc_Cha");

                cbo_chuyenmuc.SelectedIndex = CommonLib.GetIndexControl(cbo_chuyenmuc, obj_Idiea.Cat_ID.ToString());
            }
            else
            {
                this.cbo_chuyenmuc.DataSource = null;
                this.cbo_chuyenmuc.DataBind();
            }

            txt_noidung.Text = obj_Idiea.Comment;
        }
        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();
                    }
                }
            }
        }
Пример #12
0
 public void LoadCombox()
 {
     UltilFunc.BindCombox(cboAnPham, "Ma_Anpham", "Ten_Anpham", "T_Anpham", "1=1", CommonLib.ReadXML("lblTatca"));
     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() + ") ", CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha");
 }
Пример #13
0
 public void LoadCombox()
 {
     UltilFunc.BindCombox(cbo_Anpham, "Ma_Anpham", "Ten_Anpham", "T_Anpham", " Ma_QT in (select Ma_QTBT from T_NguoidungQTBT where Ma_Nguoidung=" + _user.UserID + ")", (string)HttpContext.GetGlobalResourceObject("cms.language", "lblChonanpham"));
     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() + ")", (string)HttpContext.GetGlobalResourceObject("cms.language", "lblChonchuyenmuc"), "Ma_Chuyenmuc_Cha");
 }
Пример #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"]));

                    _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);

                    }
                }
            }
        }
Пример #15
0
        private void PopulateItem(int _id)
        {
            T_TinBai     _obj   = new T_TinBai();
            ChuyenmucDAL _dalcm = new ChuyenmucDAL();

            _obj            = _Daltinbai.load_T_news(_id);
            Txt_tieude.Text = _obj.Tieude;
            Ma_QTBT         = _obj.Ma_QTBT;
            DataTable dtnguoitao = _Daltinbai.Sp_SelectOneNguoitaoTinBai(_id).Tables[0];

            if (dtnguoitao != null && dtnguoitao.Rows.Count > 0)
            {
                if (int.Parse(dtnguoitao.Rows[0][0].ToString()) != _user.UserID)
                {
                    txt_PVCTV.Text            = _obj.TacGia;
                    HiddenFieldTacgiatin.Text = _obj.Ma_TacGia.ToString();
                    txt_PVCTV.ReadOnly        = true;
                }
                else
                {
                    txt_PVCTV.Text            = _obj.TacGia;
                    HiddenFieldTacgiatin.Text = _obj.Ma_TacGia.ToString();
                }
            }
            else
            {
                txt_PVCTV.Text            = _obj.TacGia;
                HiddenFieldTacgiatin.Text = _obj.Ma_TacGia.ToString();
            }

            if (_obj.GhiChu != "")
            {
                Txt_Comments.Text = _obj.GhiChu;
            }
            else
            {
                Txt_Comments.Text = "";
            }
            if (_obj.Ma_Anpham > 0)
            {
                cbo_AnPham.SelectedIndex = CommonLib.GetIndexControl(cbo_AnPham, _obj.Ma_Anpham.ToString());
            }

            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, (string)HttpContext.GetGlobalResourceObject("cms.language", "lblChonchuyenmuc"), "Ma_Chuyenmuc_Cha");

                cbo_chuyenmuc.SelectedIndex = CommonLib.GetIndexControl(cbo_chuyenmuc, _obj.Ma_Chuyenmuc.ToString());
            }
            else
            {
                cbo_chuyenmuc.DataSource = null;
                cbo_chuyenmuc.DataBind();
            }
            checkbaoonline.Checked = _obj.VietNamNews;
            checkbizbub.Checked    = _obj.Bizhub;

            LoadDataImage();
        }