public void DataGrid_DaXB_EditCommand(object source, DataGridCommandEventArgs e)
        {
            if (e.CommandArgument.ToString().ToLower() == "edit")
            {
                int catID = Convert.ToInt32(this.DataGrid_DaXB.DataKeys[e.Item.ItemIndex].ToString());
                Session["PSDaXB_pagesindex"] = Pager_DaXB.PageIndex;
                Session["PSDaXB_Langid"]     = cboNgonNgu.SelectedValue;
                if (!string.IsNullOrEmpty(txtSearch_Cate.Text))
                {
                    Session["PSDaXB_TenPS"] = txtSearch_Cate.Text;
                }
                Session["PageFromID"] = 3;
                Response.Redirect("~/PhongSuAnh/Album_Edit.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + catID);
            }

            if (e.CommandArgument.ToString().ToLower() == "editdisplay")
            {
                int catID = Convert.ToInt32(this.DataGrid_DaXB.DataKeys[e.Item.ItemIndex].ToString());
                HPCBusinessLogic.DAL.T_Album_CategoriesDAL obj_Cate = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL();
                try
                {
                    bool check = obj_Cate.load_T_Album_Categories(catID).Status;
                    if (check)
                    {
                        obj_Cate.UpdateFromT_T_Album_CategoriesDynamic(" Status = 0 Where Cat_Album_ID = " + catID);
                    }
                    else
                    {
                        obj_Cate.UpdateFromT_T_Album_CategoriesDynamic(" Status = 1 Where Cat_Album_ID = " + catID);
                    }
                    this.LoadPSXB();
                }
                catch (Exception ex)
                { }
                finally
                {
                    obj_Cate = null;
                }
            }
            if (e.CommandArgument.ToString().ToLower() == "inputphoto")
            {
                int catID = Convert.ToInt32(this.DataGrid_DaXB.DataKeys[e.Item.ItemIndex].ToString());
                Session["PSDaXB_pagesindex"] = Pager_DaXB.PageIndex;
                Session["PSDaXB_Langid"]     = cboNgonNgu.SelectedValue;
                if (!string.IsNullOrEmpty(txtSearch_Cate.Text))
                {
                    Session["PSDaXB_TenPS"] = txtSearch_Cate.Text;
                }
                Session["PageFromID"] = 3;
                Response.Redirect("~/PhongSuAnh/PhotoAlbum_EditMullti.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + catID);
            }
        }
示例#2
0
        public void LoadImage()
        {
            int NewsID = int.Parse(lbl_News_ID.Text);
            int type   = 0; try { type = int.Parse(Request["TypeID"].ToString()); }

            catch {; }
            HPCBusinessLogic.ImageFilesDAL image = new HPCBusinessLogic.ImageFilesDAL();
            DataSet ds = new DataSet();
            string  loaitinbaiID = "", loaianhID = "", loaivideoID = "";

            loaitinbaiID = ConfigurationManager.AppSettings["NewsType"].ToString();
            loaianhID    = ConfigurationManager.AppSettings["ImageType"].ToString();
            loaivideoID  = ConfigurationManager.AppSettings["VideoType"].ToString();
            if (type.ToString() == loaitinbaiID)
            {
                HPCBusinessLogic.DAL.T_NewsDAL objnews = new HPCBusinessLogic.DAL.T_NewsDAL();
                lbl_tieude.Text = objnews.GetOneFromT_NewsByID(NewsID).News_Tittle;
            }
            else if (type.ToString() == loaianhID)
            {
                HPCBusinessLogic.DAL.T_Album_CategoriesDAL objnews = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL();
                lbl_tieude.Text = objnews.load_T_Album_Categories(NewsID).Cat_Album_Name;
            }

            ds = image.ListAllImagesInNews(NewsID, type);
            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                dgr_anh.DataSource = dt.DefaultView;
                dgr_anh.DataBind();
                foreach (DataGridItem item in dgr_anh.Items)
                {
                    item.Attributes.Add("onmouseover", "currColor=this.style.backgroundColor;this.style.backgroundColor='" + CommonLib.HPCOnmouseoverGrid() + "'");
                    item.Attributes.Add("onmouseout", "this.style.backgroundColor=currColor");
                    TextBox txt_tien = (TextBox)item.FindControl("txt_tien");
                    //txt_tien.Text = string.Format("{0:#,#}", txt_tien.Text).Replace(".", ",");
                    double _money = 0;
                    try
                    {
                        _money = double.Parse(txt_tien.Text);
                    }
                    catch
                    { _money = 0; }
                    txt_tien.Text = string.Format("{0:#,#}", _money).Replace(".", ",");
                }
            }
        }
示例#3
0
        public void LoadImage()
        {
            int NewsID = int.Parse(lbl_News_ID.Text);
            int type   = 1; try

            {
                if (Request["TypeID"] != null)
                {
                    type = int.Parse(Request["TypeID"].ToString());
                }
            }
            catch {; }
            string loaitinbaiID = string.Empty, loaianhID = string.Empty, loaivideoID = string.Empty;

            loaitinbaiID = ConfigurationManager.AppSettings["NewsType"].ToString();
            loaianhID    = ConfigurationManager.AppSettings["ImageType"].ToString();
            loaivideoID  = ConfigurationManager.AppSettings["VideoType"].ToString();
            if (type.ToString() == loaitinbaiID)
            {
                HPCBusinessLogic.DAL.T_NewsDAL objnews = new HPCBusinessLogic.DAL.T_NewsDAL();
                lbl_tieude.Text = objnews.GetOneFromT_NewsByID(NewsID).News_Tittle;
            }
            else if (type.ToString() == loaianhID)
            {
                HPCBusinessLogic.DAL.T_Album_CategoriesDAL objnews = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL();
                lbl_tieude.Text = objnews.load_T_Album_Categories(NewsID).Cat_Album_Name;
            }
            HPCBusinessLogic.ImageFilesDAL image = new HPCBusinessLogic.ImageFilesDAL();
            DataSet ds = new DataSet();

            ds = image.ListAllImagesInNews(NewsID, type);
            DataTable dt = ds.Tables[0];

            dgr_anh.DataSource = dt.DefaultView;
            dgr_anh.DataBind();
            //string _str_ID = "'";
            //string _strtextID = "'";
            //int i = 0;
            foreach (DataGridItem item in dgr_anh.Items)
            {
                item.Attributes.Add("onmouseover", "currColor=this.style.backgroundColor;this.style.backgroundColor='" + CommonLib.HPCOnmouseoverGrid() + "'");
                item.Attributes.Add("onmouseout", "this.style.backgroundColor=currColor");

                TextBox txt_tienNB = (TextBox)item.FindControl("txt_tiennhanbut");
                //TextBox txt_tacgia = (TextBox)item.FindControl("txt_nguonanh");
                //TextBox txt_tacgiaID = (TextBox)item.FindControl("txt_tacgiaID");
                //if (i == 0)
                //{
                //    _str_ID = _str_ID + txt_tacgiaID.ClientID;
                //    _strtextID = _strtextID + txt_tacgia.ClientID;
                //}
                //else
                //{
                //    _str_ID = _str_ID + "," + txt_tacgiaID.ClientID;
                //    _strtextID = _strtextID + "," + txt_tacgia.ClientID;
                //}
                //i++;
                if (!string.IsNullOrEmpty(txt_tienNB.Text))
                {
                    txt_tienNB.Text = string.Format("{0:#,#}", double.Parse(txt_tienNB.Text.Replace(",", ""))).Replace(".", ",");
                }
            }
            //_str_ID = _str_ID + "'";
            //_strtextID = _strtextID + "'";
            //System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", " AutoCompleteSearch_Author(" + _strtextID + "," + _str_ID + ");", true);
        }
        protected void link_HuyXB_Click(object sender, EventArgs e)
        {
            HPCBusinessLogic.DAL.T_Album_CategoriesDAL T_Album = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL();
            T_Album_Categories _obj = new T_Album_Categories();

            foreach (DataGridItem item in DataGrid_DaXB.Items)
            {
                Label    lblcatid  = (Label)item.FindControl("lblcatid");
                int      _id       = Convert.ToInt32(lblcatid.Text);
                TextBox  txtGhichu = (TextBox)item.FindControl("txtGhichu");
                CheckBox check     = (CheckBox)item.FindControl("optSelect");
                if (check.Checked)
                {
                    string _sql = "Update T_Album_Categories set Comment='" + txtGhichu.Text + "' where Cat_Album_ID =" + _id;
                    HPCDataProvider.Instance().ExecSql(_sql);
                    T_Album.Update_Status(_id, 5, _user.UserID);
                }
                WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "Hủy xuất bản", Request["Menu_ID"].ToString(), "[Xuất bản] [Hủy xuất bản Phóng sự ảnh: " + T_Album.load_T_Album_Categories(Convert.ToInt32(lblcatid.Text)).Cat_Album_Name + "]", _id, ConstAction.GocAnh);
            }
            LoadPSXB();
        }
示例#5
0
 protected void link_send_Click(object sender, EventArgs e)
 {
     HPCBusinessLogic.DAL.T_Album_CategoriesDAL T_Album = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL();
     if (TabContainer1.ActiveTabIndex == 0)
     {
         foreach (DataGridItem item in grdListCate.Items)
         {
             Label    lblcatid = (Label)item.FindControl("lblcatid");
             int      _id      = int.Parse(lblcatid.Text);
             CheckBox check    = (CheckBox)item.FindControl("optSelect");
             if (check.Checked)
             {
                 T_Album.Update_Status(_id, 2, _user.UserID);
             }
             WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "Gửi duyệt", Request["Menu_ID"].ToString(), "[Gửi duyệt] [Phóng sự mới] [Thao tác Gửi duyệt Phóng sự ảnh: " + T_Album.load_T_Album_Categories(Convert.ToInt32(lblcatid.Text)).Cat_Album_Name + "]", _id, ConstAction.GocAnh);
         }
         LoadPSmoi();
     }
     else if (TabContainer1.ActiveTabIndex == 2)
     {
         foreach (DataGridItem item in DataGrid_tralai.Items)
         {
             Label    lblcatid = (Label)item.FindControl("lblcatid");
             CheckBox check    = (CheckBox)item.FindControl("optSelect");
             if (check.Checked)
             {
                 T_Album.Update_Status(int.Parse(lblcatid.Text), 2, _user.UserID);
             }
             WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "Gửi duyệt", Request["Menu_ID"].ToString(), "[Gửi duyệt] [Phóng sự trả lại] [Thao tác Gửi duyệt Phóng sự ảnh: " + T_Album.load_T_Album_Categories(Convert.ToInt32(lblcatid.Text)).Cat_Album_Name + "]", 0, ConstAction.GocAnh);
         }
         LoadPStralai();
     }
 }
示例#6
0
 protected void btnLinkDelete_Click(object sender, EventArgs e)
 {
     HPCBusinessLogic.DAL.T_Album_CategoriesDAL objAlbumDAL = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL();
     if (TabContainer1.ActiveTabIndex == 0)
     {
         int AlbumID = 0;
         try
         {
             foreach (DataGridItem m_Item in grdListCate.Items)
             {
                 CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect");
                 if (chk_Select != null && chk_Select.Checked)
                 {
                     Label lblTenPS = (Label)m_Item.FindControl("lblTenPS");
                     AlbumID = int.Parse(grdListCate.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString());
                     WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "Xóa", Request["Menu_ID"].ToString(), "[Xóa] [Phóng sự ảnh mới] [Thao tác xóa Phóng sự ảnh: " + objAlbumDAL.load_T_Album_Categories(AlbumID).Cat_Album_Name + "]", 0, ConstAction.GocAnh);
                     objAlbumDAL.DeleteFrom_T_Album_Categories(AlbumID);
                 }
             }
             LoadPSmoi();
         }
         catch (Exception ex) { }
         finally { objAlbumDAL = null; }
     }
     else if (TabContainer1.ActiveTabIndex == 2)
     {
         foreach (DataGridItem item in DataGrid_tralai.Items)
         {
             CheckBox chk_Select = (CheckBox)item.FindControl("optSelect");
             if (chk_Select != null && chk_Select.Checked)
             {
                 int _ID = Convert.ToInt32(DataGrid_tralai.DataKeys[int.Parse(item.ItemIndex.ToString())].ToString());
                 WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "Xóa", Request["Menu_ID"].ToString(), "[Xóa] [Phóng sự ảnh bị trả lại] [Thao tác xóa Phóng sự ảnh: " + objAlbumDAL.load_T_Album_Categories(_ID).Cat_Album_Name + "]", 0, ConstAction.GocAnh);
                 objAlbumDAL.DeleteFrom_T_Album_Categories(_ID);
             }
         }
         LoadPStralai();
     }
 }