private void LoadCombox()
        {
            UltilFunc.BindCombox(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 "), CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
            DataTable dt = _userDAL.GetAllUser_By_CatID(0);

            drop_User.Items.Clear();
            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    drop_User.Items.Add(new ListItem(CommonLib.ReadXML("lblTatca"), "0", true));
                    for (int i = 0; i <= dt.Rows.Count - 1; i++)
                    {
                        this.drop_User.Items.Add(new ListItem(dt.Rows[i]["Fullname"].ToString(), dt.Rows[i]["Ma_Nguoidung"].ToString()));
                    }
                }
            }
        }
        private void PopulateItem(int _id)
        {
            HPCInfo.T_Multimedia _obj = new HPCInfo.T_Multimedia();
            T_MultimediaDAL      _DAL = new T_MultimediaDAL();

            _obj = _DAL.GetOneFromT_MultimediaByID(_id);
            if (_obj != null)
            {
                this.txtVideoID.Text   = _obj.ID.ToString();
                this.txtTitle.Text     = _obj.Tittle;
                this.Txt_Desc.Text     = _obj.Contents;
                this.txtVideoPath.Text = _obj.URLPath;

                this.txtThumbnail.Text = _obj.URL_Images.ToString();
                if (_obj.URL_Images.Length > 2)
                {
                    this.ImgTemp.Src = HPCComponents.Global.UploadPathBDT + _obj.URL_Images;
                }
                else
                {
                    this.ImgTemp.Attributes.CssStyle.Add("display", "none");
                }
                HPCBusinessLogic.DAL.T_ButdanhDAL obj = new HPCBusinessLogic.DAL.T_ButdanhDAL();
                this.txt_tacgia.Text          = obj.GetBD_Name(_obj.AuthorID);
                this.ddlNgonNgu.SelectedIndex = UltilFunc.GetIndexControl(this.ddlNgonNgu, _obj.Languages_ID.ToString());
                this.ddlCategorys.Items.Clear();
                if (ddlNgonNgu.SelectedIndex > 0)
                {
                    UltilFunc.BindCombox(ddlCategorys, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham= " + this.ddlNgonNgu.SelectedValue + " AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha", " Order by Ten_ChuyenMuc ASC");
                    this.ddlCategorys.UpdateAfterCallBack = true;
                    this.ddlCategorys.SelectedIndex       = CommonLib.GetIndexControl(this.ddlCategorys, _obj.Category.ToString());
                }
                else
                {
                    this.ddlCategorys.DataSource = null;
                    this.ddlCategorys.DataBind();
                    this.ddlCategorys.UpdateAfterCallBack = true;
                }
                this.txt_tacgia.Text = _obj.Tacgia;
                this.txtGhichu.Text  = _obj.Comment;
                //try { ddl_chatluong.SelectedIndex = _obj.Chatluong; }
                //catch { ;}
            }
        }
        private void GetItem(int _id)
        {
            T_Phathanh  _obj    = new T_Phathanh();
            PhathanhDAL _objDAL = new PhathanhDAL();

            _obj = _objDAL.GetOneFromT_PhathanhByID(_id);
            this.ddl_AnPham.SelectedIndex = UltilFunc.GetIndexControl(ddl_AnPham, _obj.Ma_Anpham.ToString());

            if (_id > 0)
            {
                this.ddl_Sobao.Items.Clear();
                UltilFunc.BindCombox(ddl_Sobao, "Ma_Sobao", "Ten_Sobao", "T_Sobao", " Ma_AnPham = " + _obj.Ma_Anpham.ToString());
                this.ddl_Sobao.SelectedIndex = UltilFunc.GetIndexControl(ddl_Sobao, _obj.Ma_Sobao.ToString());
                this.txt_NgayPhatHanh.Text   = _obj.Ngay_Phathanh.ToString("dd/MM/yyyy");
            }
            this.txt_SoluongPH.Text  = _obj.Soluong_PH.ToString();
            this.txt_SoluongTon.Text = _obj.Soluong_ton.ToString();
            this.txt_Ghichu.Text     = _obj.Ghichu;
        }
Exemple #4
0
        protected void GVAnPhamLayout_OnRowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow && GVAnPhamLayout.EditIndex == e.Row.RowIndex)
            {
                DropDownList ddl_Layout = (DropDownList)e.Row.FindControl("ddl_Layout");
                UltilFunc.BindCombox(ddl_Layout, "Ma_Layout", "Mota", "T_Layout");
                Label lblLayout = (Label)e.Row.FindControl("lblLayout");
                if (Convert.ToInt32(lblLayout.Text.Trim()) > 0)
                {
                    ddl_Layout.Items.FindByValue(lblLayout.Text).Selected = true;
                }
                //GridViewRow gvRow = e.Row;
                //TextBox _trang = (TextBox)e.Row.FindControl("txt_Trang");
                //RequiredFieldValidator objReq = new RequiredFieldValidator();

                //objReq.ControlToValidate = "txt_Trang";

                //objReq.ErrorMessage = "Enter Value";
                //gvRow.Cells[1].Controls.Add(objReq);
            }
            if (e.Row.RowType == DataControlRowType.Footer)
            {
                DropDownList ddl_Layout = (DropDownList)e.Row.FindControl("ddl_Layout");
                UltilFunc.BindCombox(ddl_Layout, "Ma_Layout", "Mota", "T_Layout");
            }
            ImageButton btnDelete = (ImageButton)e.Row.FindControl("btnDelete");

            if (btnDelete != null)
            {
                btnDelete.Attributes.Add("onclick", "return confirm(\"Bạn có chắc chắn muốn xóa không?\");");
            }
            Label lblSTT = (Label)e.Row.FindControl("lblSTT");

            if (lblSTT != null)
            {
                lblSTT.Text = (pages.PageIndex * pages.PageSize + e.Row.RowIndex + 1).ToString();
            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover", "currColor=this.style.backgroundColor;this.style.backgroundColor='" + CommonLib.HPCOnmouseoverGrid() + "'");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currColor");
            }
        }
 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", "---All---");
                 BinddDropDownList(0);
                 BindData();
             }
         }
     }
 }
 private void LoadComboBox()
 {
     UltilFunc.BindCombox(ddlLang, "Ma_AnPham", "Ten_AnPham", "T_AnPham", " 1=1 ", CommonLib.ReadXML("lblTatca"));
     if (ddlLang.Items.Count >= 3)
     {
         ddlLang.SelectedIndex = Global.DefaultLangID;
     }
     else
     {
         ddlLang.SelectedIndex = UltilFunc.GetIndexControl(ddlLang, Global.DefaultCombobox);
     }
     if (ddlLang.SelectedIndex != 0)
     {
         UltilFunc.BindCombox(ddlCategorys, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham=" + this.ddlLang.SelectedValue.ToString() + " AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
     }
     else
     {
         UltilFunc.BindCombox(ddlCategorys, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham in (" + UltilFunc.GetLanguagesByUser(_user.UserID) + ") AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
     }
 }
 public void LoadCombox()
 {
     UltilFunc.BindCombox(cboNgonNgu, "Ma_AnPham", "Ten_AnPham", "T_AnPham", " 1=1 ", CommonLib.ReadXML("lblTatca"));
     if (cboNgonNgu.Items.Count >= 3)
     {
         cboNgonNgu.SelectedIndex = Global.DefaultLangID;
     }
     else
     {
         cboNgonNgu.SelectedIndex = UltilFunc.GetIndexControl(cboNgonNgu, Global.DefaultCombobox);
     }
     if (cboNgonNgu.SelectedIndex != 0)
     {
         UltilFunc.BindCombox(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham= " + this.cboNgonNgu.SelectedValue + " AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), (string)HttpContext.GetGlobalResourceObject("cms.language", "lblTatca"), "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
     }
     else
     {
         UltilFunc.BindCombox(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham= " + this.cboNgonNgu.SelectedValue + " and Ma_AnPham in (" + UltilFunc.GetLanguagesByUser(_user.UserID) + ") AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), (string)HttpContext.GetGlobalResourceObject("cms.language", "lblTatca"), "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
     }
 }
 public override void DataBind()
 {
     if (Request["ID"] != null && Request["ID"].ToString() != "" && Request["ID"].ToString() != String.Empty)
     {
         if (CommonLib.IsNumeric(Request["ID"]) == true)
         {
             HPCBusinessLogic.DAL.T_Album_CategoriesDAL dal = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL();
             int _id = Convert.ToInt32(Request["ID"].ToString());
             if (CheckPermission(_id))
             {
                 PopulateItem(_id);
                 if (dal.load_T_Album_Categories(_id).Lang_ID != 1)
                 {
                     cbo_lanquage.Enabled = false;
                 }
                 else
                 {
                     cbo_lanquage.Enabled = true;
                 }
             }
         }
     }
     else
     {
         if (cbo_lanquage.SelectedIndex > 0)
         {
             cbo_chuyenmuc.Items.Clear();
             if (cbo_lanquage.SelectedIndex >= 0)
             {
                 UltilFunc.BindCombox(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham= " + this.cbo_lanquage.SelectedValue + " AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
                 cbo_chuyenmuc.UpdateAfterCallBack = true;
             }
             else
             {
                 this.cbo_chuyenmuc.DataSource = null;
                 this.cbo_chuyenmuc.DataBind();
                 this.cbo_chuyenmuc.UpdateAfterCallBack = true;
             }
         }
     }
 }
        public void LoadCM()
        {
            UltilFunc.BindCombox(Drop_Lang, "ID", "TenNgonNgu", "T_NgonNgu", string.Format(" 1=1 AND ID IN ({0}) Order by ThuTu ", UltilFunc.GetLanguagesByUser(_user.UserID)), "---Tất cả---");

            if (Drop_Lang.Items.Count >= 3)
            {
                Drop_Lang.SelectedIndex = HPCComponents.Global.DefaultLangID;
            }
            else
            {
                Drop_Lang.SelectedIndex = UltilFunc.GetIndexControl(Drop_Lang, HPCComponents.Global.DefaultCombobox);
            }
            if (Drop_Lang.SelectedIndex != 0)
            {
                UltilFunc.BindCombox(Drop_Chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" 1=1 AND Ma_AnPham=" + this.Drop_Lang.SelectedValue.ToString() + " AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), "---Tất cả---", "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
            }
            else
            {
                UltilFunc.BindCombox(Drop_Chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" 1=1 AND Ma_AnPham in (" + UltilFunc.GetLanguagesByUser(_user.UserID) + ") AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), "---Tất cả---", "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
            }
        }
 public override void DataBind()
 {
     if (Request["ID"] != null && Request["ID"].ToString() != "" && Request["ID"].ToString() != String.Empty)
     {
         this.lblTitleCaption.Text = CommonLib.ReadXML("lblCapnhatbaiviet");
         if (CommonLib.IsNumeric(Request["ID"]) == true)
         {
             int ChildID = Convert.ToInt32(Request["ID"]);
             PopulateItem(ChildID);
         }
     }
     else
     {
         lblTitleCaption.Text = CommonLib.ReadXML("lblSuabaiviet");
         this.ImgTemp.Attributes.CssStyle.Add("display", "none");
         this.cbHienthiAnh.Checked = false;
         this.cbo_chuyenmuc.Items.Clear();
         UltilFunc.BindCombox(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham= " + this.cbo_lanquage.SelectedValue + " AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
         this.cbo_chuyenmuc.UpdateAfterCallBack = true;
     }
 }
 private void LoadCombox()
 {
     Drop_Ngonngu.Items.Clear();
     DropCM.Items.Clear();
     UltilFunc.BindCombox(Drop_Ngonngu, "ID", "TenNgonNgu", "T_NgonNgu", string.Format(" hoatdong=1 AND ID IN ({0}) Order by ThuTu ", UltilFunc.GetLanguagesByUser(_user.UserID)), "---Tất cả---");
     if (Drop_Ngonngu.Items.Count >= 3)
     {
         Drop_Ngonngu.SelectedIndex = HPCComponents.Global.DefaultLangID;
     }
     else
     {
         Drop_Ngonngu.SelectedIndex = UltilFunc.GetIndexControl(this.Drop_Ngonngu, HPCComponents.Global.DefaultCombobox);
     }
     if (Drop_Ngonngu.SelectedIndex != 0)
     {
         UltilFunc.BindCombox(DropCM, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" 1=1 and HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham= " + this.Drop_Ngonngu.SelectedValue + " AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), "---Tất cả---", "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
     }
     else
     {
         UltilFunc.BindCombox(DropCM, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" 1=1 and HoatDong = 1 and HienThi_BDT = 1 AND Ma_AnPham in (" + UltilFunc.GetLanguagesByUser(_user.UserID) + ") AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), "---Tất cả---", "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
     }
 }
Exemple #12
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)
         {
             UltilFunc.BindCombox(cbo_anpham, "Ma_Anpham", "Ten_Anpham", "T_Anpham", " 1=1", "---Chọn ấn phẩm---");
             cbo_anpham.SelectedValue = Global.DefaultCombobox;
             UltilFunc.BindComboxSoBao(cboSoBao, int.Parse(cbo_anpham.SelectedValue.ToString()), 0);
             bintrang(int.Parse(cbo_anpham.SelectedValue.ToString()));
         }
     }
 }
 private void PopulateItem(int _id)
 {
     HPCInfo.T_Album_Categories _cateObj = new HPCInfo.T_Album_Categories();
     HPCBusinessLogic.DAL.T_Album_CategoriesDAL _cateDAL = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL();
     _cateObj = _cateDAL.load_T_Album_Categories(_id);
     if (_cateObj != null)
     {
         Txt_tieudeAbum.Text             = _cateObj.Cat_Album_Name.ToString();
         txt_noidungAlbum.Text           = _cateObj.Cat_AlbumDesc.ToString();
         txtOrder.Text                   = _cateObj.Possition.ToString();
         lbl_status.Text                 = _cateObj.Cat_Album_Status_Approve.ToString();
         this.cbo_lanquage.SelectedValue = _cateObj.Lang_ID.ToString();
         this.cbo_chuyenmuc.Items.Clear();
         if (cbo_lanquage.SelectedIndex > 0)
         {
             UltilFunc.BindCombox(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham= " + this.cbo_lanquage.SelectedValue + " AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
             cbo_chuyenmuc.UpdateAfterCallBack = true;
             cbo_chuyenmuc.SelectedIndex       = CommonLib.GetIndexControl(cbo_chuyenmuc, _cateObj.Cat_Album_CATID.ToString());
         }
         else
         {
             this.cbo_chuyenmuc.DataSource = null;
             this.cbo_chuyenmuc.DataBind();
             this.cbo_chuyenmuc.UpdateAfterCallBack = true;
         }
         //ddlnews_chatluong.SelectedIndex = _cateObj.Chatluong;
         txt_Author_name.Text = _cateObj.Tacgia;
         if (_cateObj.TongtienTT > 0)
         {
             if (_cateObj.TongtienTT > 0)
             {
                 this.txt_tiennhanbut.Text = string.Format("{0:#,#}", _cateObj.TongtienTT).Replace(".", ",");
             }
         }
         this.txtGhichu.Text = _cateObj.Comment;
         HPCBusinessLogic.DAL.T_ButdanhDAL obj = new HPCBusinessLogic.DAL.T_ButdanhDAL();
         this.txt_Author_name.Text = obj.GetBD_Name(_cateObj.AuthorID);
     }
 }
Exemple #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 (UltilFunc.IsNumeric(Request["Menu_ID"]))
         {
             if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"])))
             {
                 Response.Redirect("~/Admin/Errors/AccessDenied.aspx");
             }
             _user          = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
             _Role          = _userDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"]));
             btnAdd.Visible = _Role.R_Read;
             if (!IsPostBack)
             {
                 if (_user == null)
                 {
                     Page.Response.Redirect("~/login.aspx", true);
                 }
                 else
                 {
                     cbo_loaibao.Items.Clear();
                     UltilFunc.BindCombox(this.cbo_loaibao, "Ma_AnPham", "Ten_AnPham", "T_AnPham", " 1=1 ", "---");
                     if (Session["CurrentPage"] != null)
                     {
                         pages.PageIndex        = int.Parse(Session["CurrentPage"].ToString());
                         Session["CurrentPage"] = null;
                         Danhsach_Sobao();
                     }
                     else
                     {
                         Danhsach_Sobao();
                     }
                 }
             }
         }
     }
 }
Exemple #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 (UltilFunc.IsNumeric(Request["Menu_ID"]))
                {
                    if (!HPCSecurity.IsAccept(Convert.ToInt32(Request["Menu_ID"])))
                    {
                        Response.Redirect("~/Errors/AccessDenied.aspx");
                    }
                    _user           = _userDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
                    _Role           = _userDAL.GetRole4UserMenu(_user.UserID, Convert.ToInt32(Request["Menu_ID"]));
                    btnAdd.Visible  = _Role.R_Read;
                    pages.PageIndex = 0;
                    if (!IsPostBack)
                    {
                        UltilFunc.BindCombox(cbo_room, "Ma_Phongban", "Ten_Phongban", "T_Phongban", " 1=1", "---All---");
                        BinddDropDownList(0);
                        int tab_id = 0;

                        if (Request["Tab"] != null)
                        {
                            tab_id = Convert.ToInt32(Request["Tab"].ToString());
                        }
                        if (tab_id == -1)
                        {
                            this.TabContainerListCV.ActiveTabIndex = 0;
                            this.TabContainer1_ActiveTabChanged(sender, e);
                        }
                        else
                        {
                            this.TabContainerListCV.ActiveTabIndex = tab_id;
                            this.TabContainer1_ActiveTabChanged(sender, e);
                        }
                    }
                }
            }
        }
 public void LoadCombox()
 {
     cbo_chuyenmuc.Items.Clear();
     cboNgonNgu.Items.Clear();
     UltilFunc.BindCombox(cboNgonNgu, "ID", "TenNgonNgu", "T_NgonNgu", string.Format(" hoatdong=1 AND ID IN ({0}) Order by ThuTu ASC ", UltilFunc.GetLanguagesByUser(_user.UserID)), CommonLib.ReadXML("lblTatca"));
     if (cboNgonNgu.Items.Count >= 3)
     {
         cboNgonNgu.SelectedIndex = HPCComponents.Global.DefaultLangID;
     }
     else
     {
         cboNgonNgu.SelectedIndex = UltilFunc.GetIndexControl(cboNgonNgu, Global.DefaultCombobox);
     }
     if (cboNgonNgu.SelectedIndex != 0)
     {
         UltilFunc.BindCombox(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham=" + this.cboNgonNgu.SelectedValue.ToString() + " AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
     }
     else
     {
         UltilFunc.BindCombox(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham in (" + UltilFunc.GetLanguagesByUser(_user.UserID) + ") AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
     }
     cbo_chuyenmuc.UpdateAfterCallBack = true;
     cboNgonNgu.UpdateAfterCallBack    = true;
 }
 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");
 }
Exemple #18
0
        protected void dgr_anh_EditCommand(object source, DataGridCommandEventArgs e)
        {
            if (e.CommandArgument.ToString().ToLower() == "edittt")
            {
                Label        lbl_CL       = (Label)e.Item.FindControl("lblchatluong");
                Label        lbl_CLID     = (Label)e.Item.FindControl("lblchatluongID");
                DropDownList Drop_CL      = (DropDownList)e.Item.FindControl("ddlnews_chatluong");
                ImageButton  Image_Edit   = (ImageButton)e.Item.FindControl("btnEdit");
                ImageButton  Image_Update = (ImageButton)e.Item.FindControl("btnUpdate");
                ImageButton  Image_Cancel = (ImageButton)e.Item.FindControl("btnCancel");

                if (lbl_CLID.Text.ToLower() != "null" && !string.IsNullOrEmpty(lbl_CLID.Text))
                {
                    Drop_CL.SelectedIndex = int.Parse(lbl_CLID.Text.Trim());
                }
                Image_Edit.Visible   = false;
                Image_Update.Visible = true;
                Image_Cancel.Visible = true;
                lbl_CL.Visible       = false;
                Drop_CL.Visible      = true;
            }
            else if (e.CommandArgument.ToString().ToLower() == "update")
            {
                Label        lbl_CL       = (Label)e.Item.FindControl("lblchatluong");
                Label        lbl_Nguonanh = (Label)e.Item.FindControl("lbl_Nguonanh");
                Label        lbl_CLID     = (Label)e.Item.FindControl("lblchatluongID");//
                DropDownList drop_heso    = (DropDownList)e.Item.FindControl("Drop_heso");
                DropDownList Drop_CL      = (DropDownList)e.Item.FindControl("ddlnews_chatluong");
                ImageButton  Image_Edit   = (ImageButton)e.Item.FindControl("btnEdit");
                ImageButton  Image_Update = (ImageButton)e.Item.FindControl("btnUpdate");
                ImageButton  Image_Cancel = (ImageButton)e.Item.FindControl("btnCancel");
                int          ImageID      = int.Parse(dgr_anh.DataKeys[e.Item.ItemIndex].ToString());
                lbl_CL.Text          = Drop_CL.SelectedItem.Text;
                lbl_CLID.Text        = Drop_CL.SelectedIndex.ToString();
                Image_Edit.Visible   = true;
                Image_Update.Visible = false;
                Image_Cancel.Visible = false;
                lbl_CL.Visible       = true;
                Drop_CL.Visible      = false;
                if (!string.IsNullOrEmpty(lbl_CLID.Text.Trim()))
                {
                    drop_heso.Items.Clear();
                    int chatluong = 0; try { chatluong = int.Parse(lbl_CLID.Text.Trim()); }
                    catch {; }
                    UltilFunc.BindCombox(drop_heso, "HesoID", "Heso", "T_HesoTT",
                                         " 1 = 1 and Heso>= (select LoaiTT_Tuheso from T_LoaihinhTT where LoaiTT_TLID=3 and LoaiTT_CLID = " + chatluong.ToString() + ")" +
                                         " and  Heso <= (select LoaiTT_Denheso from T_LoaihinhTT where LoaiTT_TLID=3 and LoaiTT_CLID = " + chatluong.ToString() + ") order by Heso", "0");

                    //if (lbl_CLID.Text.Trim() == "1")
                    //{
                    //    UltilFunc.BindCombox(drop_heso, "HesoID", "Heso", "T_HesoTT", " 1 = 1 and Heso>= (select LoaiTT_Tuheso from T_LoaihinhTT where  LoaiTT_Type=2 )" +
                    //        " and  Heso <= (select LoaiTT_Denheso from T_LoaihinhTT where   LoaiTT_Type=2 ) order by Heso", "0");
                    //}
                    //else
                    //{
                    //    drop_heso.DataSource = null;
                    //    drop_heso.DataBind();
                    //}
                }
                int type = 0; try { type = int.Parse(Request["TypeID"].ToString()); }
                catch {; }
                HPCBusinessLogic.ImageFilesDAL obj = new HPCBusinessLogic.ImageFilesDAL();
                //obj.UpdateChatluongAnh(ImageID, Drop_CL.SelectedIndex, lbl_Nguonanh.Text.Trim(), 0, type);
            }
            else if (e.CommandArgument.ToString().ToLower() == "back")
            {
                Label        lbl_CL       = (Label)e.Item.FindControl("lblchatluong");
                DropDownList Drop_CL      = (DropDownList)e.Item.FindControl("ddlnews_chatluong");
                ImageButton  Image_Edit   = (ImageButton)e.Item.FindControl("btnEdit");
                ImageButton  Image_Update = (ImageButton)e.Item.FindControl("btnUpdate");
                ImageButton  Image_Cancel = (ImageButton)e.Item.FindControl("btnCancel");
                Image_Edit.Visible   = true;
                Image_Update.Visible = false;
                Image_Cancel.Visible = false;
                lbl_CL.Visible       = true;
                Drop_CL.Visible      = false;
            }
        }
Exemple #19
0
 public void LoadCombox()
 {
     cboAnPham.Items.Clear();
     UltilFunc.BindCombox(cboAnPham, "Ma_Anpham", "Ten_Anpham", "T_Anpham", "1=1", "---Tất cả---");
     cboAnPham.SelectedValue = "0";
 }
 private void BindCombo()
 {
     UltilFunc.BindCombox(ddl_TenKH, "Ma_KhachHang", "Ten_khachhang", "T_Khachhang", " Loai_KH = 2 ", "---Chọn---");
 }
Exemple #21
0
 public void LoadTacgia()
 {
     this.Drop_Tacgia.Items.Clear();
     UltilFunc.BindCombox(Drop_Tacgia, "Ma_Nguoidung", "TenDaydu", "T_Nguoidung", "1=1 Order by TenDaydu ASC", (string)HttpContext.GetGlobalResourceObject("cms.language", "lblTatca"));
 }
Exemple #22
0
 public void LoadCombox()
 {
     UltilFunc.BindCombox(cbo_Anpham, "Ma_Anpham", "Ten_Anpham", "T_Anpham", " 1=1 ", (string)HttpContext.GetGlobalResourceObject("cms.language", "lblChonanpham"));
 }
Exemple #23
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");
 }
        protected void PopulateItem(int _ID)
        {
            //Lấy ID trong T_AutoSave
            AutoSavesDAL _dal        = new AutoSavesDAL();
            int          id_autoSave = _dal.Get_ID_AutoSave(_ID, _user.UserID);

            txtID.Text = id_autoSave.ToString();
            //end
            T_News obj_T_news = new T_News();

            HPCBusinessLogic.DAL.T_NewsDAL ObjDAl = new HPCBusinessLogic.DAL.T_NewsDAL();
            obj_T_news                = ObjDAl.load_T_news(_ID);
            this.Txt_tieude.Text      = obj_T_news.News_Tittle.ToString();
            this.txtTukhoa.Text       = ObjDAl.GetKeywordsByNewsID(_ID);
            this.txt_TieuDePhu.Text   = obj_T_news.News_Sub_Title.ToString();
            this.txt_tomtat.Text      = obj_T_news.News_Summary.ToString();
            this.txt_noidung.Text     = obj_T_news.News_Body.ToString();
            this.Txt_Comments.Text    = obj_T_news.News_Comment.ToString();
            this.txt_Author_name.Text = obj_T_news.News_AuthorName.ToString();
            this.txtThumbnail.Text    = obj_T_news.Images_Summary;
            if (obj_T_news.Images_Summary.ToString().Length > 0)
            {
                this.ImgTemp.Src = HPCComponents.Global.UploadPathBDT + obj_T_news.Images_Summary;
            }
            else
            {
                this.ImgTemp.Attributes.CssStyle.Add("display", "none");
            }

            this.cbo_lanquage.SelectedValue = obj_T_news.Lang_ID.ToString();

            this.chk_IsCategorys.Checked       = obj_T_news.News_IsCategorys;
            this.chk_IsHomePages.Checked       = obj_T_news.News_IsHomePages;
            this.chk_IsCategoryParrent.Checked = obj_T_news.News_IsCategoryParrent;
            this.chkNewsIsFocus.Checked        = obj_T_news.News_IsFocus;
            this.chkNewsIsHot.Checked          = obj_T_news.News_IsHot;
            this.chkHistorys.Checked           = obj_T_news.News_IsHistory;
            this.chkImages.Checked             = obj_T_news.News_IsImages;
            this.chkVideo.Checked = obj_T_news.News_IsVideo;
            if (obj_T_news.News_TienNB > 0.0)
            {
                this.txtTienNhuanBut.Text = string.Format("{0:#,#}", obj_T_news.News_TienNB).Replace(".", ",");
            }
            this.cbo_chuyenmuc.Items.Clear();
            if (cbo_lanquage.SelectedIndex > 0)
            {
                UltilFunc.BindCombox(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham= " + this.cbo_lanquage.SelectedValue + " AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
                cbo_chuyenmuc.UpdateAfterCallBack = true;
                cbo_chuyenmuc.SelectedIndex       = CommonLib.GetIndexControl(cbo_chuyenmuc, obj_T_news.CAT_ID.ToString());
            }
            else
            {
                this.cbo_chuyenmuc.DataSource = null;
                this.cbo_chuyenmuc.DataBind();
                this.cbo_chuyenmuc.UpdateAfterCallBack = true;
            }
            //bind bai viet lien quan
            if (obj_T_news.News_Realate.ToString().Trim() != "")
            {
                txtListID.Text = obj_T_news.News_Realate.ToString().Trim().Replace(",0", "");
            }
            LoadNewRealation();
            //Add By nvthai
            //obj_T_news.News_Priority == 1;
            txtVideoPath.Text            = obj_T_news.News_PhotoAtt;
            txtChuthichanh.Text          = obj_T_news.News_DescImages;
            this.cbHienthiAnh.Checked    = obj_T_news.Image_Hot;
            this.txtNguon.Text           = obj_T_news.News_Nguon;
            this.cbDisplayMobile.Checked = obj_T_news.News_DisplayMobile;
            this.cbMoreViews.Checked     = obj_T_news.News_Delete;
        }
 public void LoadCombox()
 {
     UltilFunc.BindCombox(cbokhachang, "Ma_KhachHang", "Ten_khachhang", "T_Khachhang", "1=1 and Loai_KH=1", "---Tất cả---");
     UltilFunc.BindCombox(cbo_loaibao, "Ma_Anpham", "Ten_Anpham", "T_Anpham", "1=1", "---Chọn loại báo---");
 }
Exemple #26
0
 private void LoadComboBox()
 {
     UltilFunc.BindCombox(cboNgonNgu, "Ma_AnPham", "Ten_AnPham", "T_AnPham", " 1=1 ", CommonLib.ReadXML("lblTatca"));
 }
Exemple #27
0
        protected void PopulateItem(int _id)
        {
            //Lấy ID trong T_AutoSave
            AutoSavesDAL _dal        = new AutoSavesDAL();
            int          id_autoSave = _dal.Get_ID_AutoSave(_id, _user.UserID);

            txtID.Text = id_autoSave.ToString();
            //end
            HPCBusinessLogic.DAL.T_NewsDAL _untilDAL = new HPCBusinessLogic.DAL.T_NewsDAL();
            HPCInfo.T_News _obj = new T_News();
            _obj = _untilDAL.load_T_news(_id);
            if (_obj != null)
            {
                cbo_lanquage.SelectedIndex = UltilFunc.GetIndexControl(cbo_lanquage, _obj.Lang_ID.ToString());
                cbo_chuyenmuc.Items.Clear();
                if (cbo_lanquage.SelectedIndex > 0)
                {
                    UltilFunc.BindCombox(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham= " + this.cbo_lanquage.SelectedValue + " AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha", " Order by Ten_ChuyenMuc ASC");
                    cbo_chuyenmuc.UpdateAfterCallBack = true;
                    cbo_chuyenmuc.SelectedIndex       = CommonLib.GetIndexControl(cbo_chuyenmuc, _obj.CAT_ID.ToString());
                }
                else
                {
                    this.cbo_chuyenmuc.DataSource = null;
                    this.cbo_chuyenmuc.DataBind();
                    this.cbo_chuyenmuc.UpdateAfterCallBack = true;
                }
                this.txt_Author_name.Text = _obj.News_AuthorName;
                this.Txt_tieude.Text      = _obj.News_Tittle;
                this.txt_TieuDePhu.Text   = _obj.News_Sub_Title;
                this.txt_noidung.Text     = _obj.News_Body;
                //this.ddlNews_Priority.SelectedValue = _obj.News_Priority.ToString();
                this.chk_IsCategorys.Checked       = _obj.News_IsCategorys;
                this.chk_IsHomePages.Checked       = _obj.News_IsHomePages;
                this.chk_IsCategoryParrent.Checked = _obj.News_IsCategoryParrent;
                this.chkHistorys.Checked           = _obj.News_IsHistory;
                this.chkImages.Checked             = _obj.News_IsImages;
                this.chkVideo.Checked = _obj.News_IsVideo;
                //if (_obj.News_TienNB > 0.0)
                //    this.txtTienNhuanBut.Text = _obj.News_TienNB.ToString();
                //System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "Comma('" + txtTienNhuanBut.ClientID + "');", true);
                if (_obj.News_TienNB > 0.0)
                {
                    this.txtTienNhuanBut.Text = string.Format("{0:#,#}", _obj.News_TienNB).Replace(".", ",");
                }
                //this.ddlNews_IsType.SelectedValue = _obj.News_IsType.ToString();
                this.chkNewsIsFocus.Checked = _obj.News_IsFocus;
                this.chkNewsIsHot.Checked   = _obj.News_IsHot;
                if (_obj.Images_Summary.Length > 0)
                {
                    this.ImgTemp.Src = HPCComponents.Global.TinPathBDT + "/" + _obj.Images_Summary;
                }
                else
                {
                    this.ImgTemp.Attributes.CssStyle.Add("display", "none");
                }
                this.Txt_Comments.Text = _obj.News_Comment;
                this.txt_tomtat.Text   = _obj.News_Summary;
                this.txtThumbnail.Text = _obj.Images_Summary;
                this.txtTukhoa.Text    = _untilDAL.GetKeywordsByNewsID(_id);
                //bind bai viet lien quan
                if (_obj.News_Realate.ToString().Trim() != "")
                {
                    txtListID.Text = _obj.News_Realate.ToString().Trim().Replace(",0", "");
                }
                LoadNewRealation();
                txtVideoPath.Text            = _obj.News_PhotoAtt;
                txtChuthichanh.Text          = _obj.News_DescImages;
                this.cbHienthiAnh.Checked    = _obj.Image_Hot;
                this.txtNguon.Text           = _obj.News_Nguon;
                this.cbDisplayMobile.Checked = _obj.News_DisplayMobile;
                this.cbMoreViews.Checked     = _obj.News_Delete;
            }
        }
 public void BindCombo()
 {
     ddl_AnPham.Items.Clear();
     UltilFunc.BindCombox(ddl_AnPham, "Ma_AnPham", "Ten_AnPham", "T_AnPham", " 1=1 ");
 }
Exemple #29
0
 public void LoadCombox()
 {
     UltilFunc.BindCombox(cboAnPham, "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(cbo_chuyenmuc, "Ma_Chuyenmuc", "Ten_Chuyenmuc", "T_Chuyenmuc", string.Format(" Ma_Chuyenmuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), (string)HttpContext.GetGlobalResourceObject("cms.language", "lblChonchuyenmuc"), "Ma_Chuyenmuc_Cha", " Order by Ten_ChuyenMuc");
 }
Exemple #30
0
 public void LoadCombox()
 {
     UltilFunc.BindCombox(cboKhachhang, "Ma_KhachHang", "Ten_khachhang", "T_Khachhang", " 1=1 and Loai_KH=1", "---Select all---");
     UltilFunc.BindCombox(cboAnPham, "Ma_Anpham", "Ten_Anpham", "T_Anpham", "1=1", "---Select all---");
     UltilFunc.BindCombox(cbokichthuoc, "Ma_Kichthuoc", "Ten_Kichthuoc", "T_Kichthuoc", "1=1", "---Select all---");
 }