Пример #1
0
        public void LoadDataImage()
        {
            string where = "";
            if (Request["ID"] != null)
            {
                where = " Ma_TinBai=" + Request["ID"].ToString();
            }
            else
            {
                where = " Ma_Anh not in (select Ma_Anh from T_Tinbai_Anh) and  NguoiTao=" + _user.UserID + " and NgayTao>='" + DateTime.Now.ToString("dd/MM/yyyy") + "'";
            }

            DataSet _ds = _daltinanh.Sp_SelectTinAnhDynamic(where, "NgayTao DESC");

            this.dgrListImages.DataSource = _ds;
            this.dgrListImages.DataBind();

            string _chuthich  = string.Empty;
            string _tacgiaanh = string.Empty;

            if (dgrListImages.Items.Count > 0)
            {
                foreach (DataListItem m_Item in dgrListImages.Items)
                {
                    Label       _labeldesc     = m_Item.FindControl("lbdesc") as Label;
                    Label       _Labellbtacgia = m_Item.FindControl("lbtacgia") as Label;
                    TextBox     txtChuthich    = m_Item.FindControl("txtChuthich") as TextBox;
                    TextBox     txtTacgia      = m_Item.FindControl("txtTacgia") as TextBox;
                    ImageButton btnUpdate      = m_Item.FindControl("btnUpdate") as ImageButton;
                    ImageButton btnCancel      = m_Item.FindControl("btnCancel") as ImageButton;
                    if (_labeldesc != null)
                    {
                        _chuthich = _labeldesc.Text.Trim();
                    }
                    if (_Labellbtacgia != null)
                    {
                        _tacgiaanh = _Labellbtacgia.Text.Trim();
                    }
                    if (_chuthich == "")
                    {
                        _labeldesc.Visible  = false;
                        txtChuthich.Visible = true;
                        txtChuthich.Text    = Global.RM.GetString("Nhapchuthichanh");
                        btnUpdate.Visible   = true;
                        btnCancel.Visible   = true;
                    }
                    if (_tacgiaanh == "")
                    {
                        _Labellbtacgia.Visible = false;
                        txtTacgia.Visible      = true;
                        txtTacgia.Text         = Global.RM.GetString("Nhaptacgiaanh");
                        btnUpdate.Visible      = true;
                        btnCancel.Visible      = true;
                    }
                }
            }
        }
Пример #2
0
        public void LoadDataImage()
        {
            string where = "";
            if (Request["ID"] != null)
            {
                where = " Duyet=1 and Ma_TinBai=" + Request["ID"].ToString();
            }
            else
            {
                where = " Duyet=1 and Ma_Anh not in (select Ma_Anh from T_Tinbai_Anh) and  NguoiTao=" + _user.UserID + " and NgayTao>='" + DateTime.Now.ToString("dd/MM/yyyy") + "'";
            }

            DataSet _ds = _daltinanh.Sp_SelectTinAnhDynamic(where, "NgayTao DESC");

            this.dgrListImages.DataSource = _ds;
            this.dgrListImages.DataBind();

            string _chuthich  = string.Empty;
            string _tacgiaanh = string.Empty;

            if (dgrListImages.Items.Count > 0)
            {
                foreach (DataListItem m_Item in dgrListImages.Items)
                {
                    int _ID = int.Parse(this.dgrListImages.DataKeys[m_Item.ItemIndex].ToString());
                    _objimg = _dalanh.GetOneFromT_AnhByID(_ID);
                    Label   _labeldesc     = m_Item.FindControl("lbdesc") as Label;
                    Label   _Labellbtacgia = m_Item.FindControl("lbtacgia") as Label;
                    TextBox txtChuthich    = m_Item.FindControl("txtChuthich") as TextBox;
                    TextBox txtTacgia      = m_Item.FindControl("txtTacgia") as TextBox;

                    ImageButton btnUpdate = m_Item.FindControl("btnUpdate") as ImageButton;
                    ImageButton btnCancel = m_Item.FindControl("btnCancel") as ImageButton;

                    if (_objimg.Chuthich == "")
                    {
                        _labeldesc.Visible  = false;
                        txtChuthich.Visible = true;

                        btnUpdate.Visible = true;
                        btnCancel.Visible = true;
                    }
                    if (_objimg.Ma_Nguoichup == 0)
                    {
                        _Labellbtacgia.Visible = false;
                        txtTacgia.Visible      = true;

                        btnUpdate.Visible = true;
                        btnCancel.Visible = true;
                    }
                }
            }
        }
        public void LoadDataImageTinBai(string _matinbai)
        {
            TinBaiAnhDAL _daltinanh = new TinBaiAnhDAL();

            string where = string.Empty;

            where = " Ma_TinBai=" + _matinbai;
            DataSet _ds = _daltinanh.Sp_SelectTinAnhDynamic(where, "NgayTao DESC");

            this.DataListAnh.DataSource = _ds;
            this.DataListAnh.DataBind();
        }