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(); } }
public void LoadPSdaduyet() { Pager_daduyet.PageSize = Global.MembersPerPage; HPCBusinessLogic.DAL.T_Album_CategoriesDAL _cateDAL = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL(); DataSet _ds; _ds = _cateDAL.Bind_T_Album_CategoriesDynamic(Pager_daduyet.PageIndex, Pager_daduyet.PageSize, WhereCondition(3)); int TotalRecords = Convert.ToInt32(_ds.Tables[1].Rows[0].ItemArray[0].ToString()); int TotalRecord = Convert.ToInt32(_ds.Tables[0].Rows.Count); if (TotalRecord == 0) { _ds = _cateDAL.Bind_T_Album_CategoriesDynamic(Pager_daduyet.PageIndex - 1, Pager_daduyet.PageSize, WhereCondition(3)); } DataGrid_XB.DataSource = _ds; DataGrid_XB.DataBind(); _ds.Clear(); Pager_daduyet.TotalRecords = CurrentPage_daduyet.TotalRecords = TotalRecords; CurrentPage_daduyet.TotalPages = Pager_daduyet.CalculateTotalPages(); CurrentPage_daduyet.PageIndex = Pager_daduyet.PageIndex; GetTotal(); foreach (DataGridItem item in DataGrid_XB.Items) { ImageButton btnview = (ImageButton)item.FindControl("btnViewPhoto"); Label lblcatid = (Label)item.FindControl("lblcatid"); btnview.Attributes.Add("onclick", "PopupWindow('T_Album_Categories_View.aspx?catps=" + lblcatid.Text + "')"); item.Attributes.Add("onmouseover", "currColor=this.style.backgroundColor;this.style.backgroundColor='" + CommonLib.HPCOnmouseoverGrid() + "'"); item.Attributes.Add("onmouseout", "this.style.backgroundColor=currColor"); } }
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); } }
public void grdListCategory_EditCommand(object source, DataGridCommandEventArgs e) { if (e.CommandArgument.ToString().ToLower() == "edit") { int catID = Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString()); Session["CurrentPage_QLPS"] = pages.PageIndex; Session["CurrentTab_QLPS"] = 0; if (!string.IsNullOrEmpty(txtSearch_Cate.Text)) { Session["QLPS_TenPS"] = txtSearch_Cate.Text; } Session["PageFromID"] = 1; Session["CurrentLangid_QLPS"] = cboNgonNgu.SelectedValue; Response.Redirect("~/PhongSuAnh/Album_Edit.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + catID + "&PageFromID=1"); } else if (e.CommandArgument.ToString().ToLower() == "delete") { HPCBusinessLogic.DAL.T_Album_CategoriesDAL obj_Cate = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL(); try { if (obj_Cate.CheckDelete_T_Album_Categories(Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString()))) { obj_Cate.DeleteFrom_T_Album_Categories(Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString())); Label lblTenPS = (Label)e.Item.FindControl("lblTenPS"); WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, lblTenPS.Text, Request["Menu_ID"].ToString(), "Xóa Phóng sự ảnh", 0, ConstAction.GocAnh); this.LoadPSmoi(); } else { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('Không được xóa khi còn bài viết trong danh mục này');", true); } } catch { } finally { obj_Cate = null; } } else if (e.CommandArgument.ToString().ToLower() == "inputphoto") { int catID = Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString()); Session["CurrentPage_QLPS"] = pages.PageIndex; if (!string.IsNullOrEmpty(txtSearch_Cate.Text)) { Session["QLPS_TenPS"] = txtSearch_Cate.Text; } Session["CurrentTab_QLPS"] = 0; Session["CurrentLangid_QLPS"] = cboNgonNgu.SelectedValue; Session["PageFromID"] = 1; Response.Redirect("~/PhongSuAnh/PhotoAlbum_EditMullti.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + catID); } }
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(".", ","); } } }
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(); }
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(); } }
public void LoadPSXB() { string where = " 1=1 and Cat_Album_Status_Approve = 4 AND Lang_ID IN (SELECT DISTINCT(T_Nguoidung_NgonNgu.Ma_Ngonngu) FROM T_Nguoidung_NgonNgu WHERE T_Nguoidung_NgonNgu.[Ma_Nguoidung] = " + _user.UserID + ")"; if (!String.IsNullOrEmpty(this.txtSearch_Cate.Text.Trim())) { where += " AND " + string.Format(" Cat_Album_Name like N'%{0}%'", UltilFunc.SqlFormatText(this.txtSearch_Cate.Text.Trim())); } if (cboNgonNgu.SelectedIndex > 0) { where += " AND Lang_ID=" + cboNgonNgu.SelectedValue.ToString(); } where += " Order by Cat_Album_ID DESC"; Pager_DaXB.PageSize = Global.MembersPerPage; HPCBusinessLogic.DAL.T_Album_CategoriesDAL _cateDAL = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL(); DataSet _ds; _ds = _cateDAL.Bind_T_Album_CategoriesDynamic(Pager_DaXB.PageIndex, Pager_DaXB.PageSize, where); int TotalRecords = Convert.ToInt32(_ds.Tables[1].Rows[0].ItemArray[0].ToString()); int TotalRecord = Convert.ToInt32(_ds.Tables[0].Rows.Count); if (TotalRecord == 0) { _ds = _cateDAL.Bind_T_Album_CategoriesDynamic(Pager_DaXB.PageIndex - 1, Pager_DaXB.PageSize, where); } DataGrid_DaXB.DataSource = _ds; DataGrid_DaXB.DataBind(); _ds.Clear(); Pager_DaXB.TotalRecords = curentPages_DaXB.TotalRecords = TotalRecords; curentPages_DaXB.TotalPages = Pager_DaXB.CalculateTotalPages(); curentPages_DaXB.PageIndex = Pager_DaXB.PageIndex; foreach (DataGridItem item in DataGrid_DaXB.Items) { ImageButton btnview = (ImageButton)item.FindControl("btnViewPhoto"); Label lblcatid = (Label)item.FindControl("lblcatid"); btnview.Attributes.Add("onclick", "PopupWindow('T_Album_Categories_View.aspx?catps=" + lblcatid.Text + "')"); item.Attributes.Add("onmouseover", "currColor=this.style.backgroundColor;this.style.backgroundColor='" + CommonLib.HPCOnmouseoverGrid() + "'"); item.Attributes.Add("onmouseout", "this.style.backgroundColor=currColor"); } }
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); }