public void LoadCM() { string where = string.Format(" hoatdong=1 AND ID!=1 AND ID IN ({0}) Order by ThuTu ", UltilFunc.GetLanguagesByUser(_user.UserID)); NgonNgu_DAL _DAL = new NgonNgu_DAL(); DataSet _ds; _ds = _DAL.BindGridT_NgonNgu(0, 5000, where); int TotalRecords = Convert.ToInt32(_ds.Tables[1].Rows[0].ItemArray[0].ToString()); int TotalRecord = Convert.ToInt32(_ds.Tables[0].Rows.Count); DataTable _dv = _ds.Tables[0]; dgCategorysCopy.DataSource = _dv; dgCategorysCopy.DataBind(); }
protected void but_Trans_Click(object sender, EventArgs e) { double _IDVideo = 0.0; ArrayList arNgu = new ArrayList(); foreach (DataGridItem m_Item in this.dgCategorysCopy.Items) { CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect"); if (chk_Select != null && chk_Select.Checked) { arNgu.Add(double.Parse(this.dgCategorysCopy.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString())); } } ArrayList arrTin = new ArrayList(); if (TabContainer1.ActiveTabIndex == 0) { foreach (DataGridItem m_Item in dgData_ChoXuatban.Items) { CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect"); if (chk_Select != null && chk_Select.Checked) { arrTin.Add(double.Parse(dgData_ChoXuatban.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString())); } } } T_MultimediaDAL _DAL = new T_MultimediaDAL(); NgonNgu_DAL _LanguagesDAL = new NgonNgu_DAL(); if (arrTin.Count > 0) { for (int j = 0; j < arrTin.Count; j++) { double Video_ID = double.Parse(arrTin[j].ToString()); if (_DAL.GetOneFromT_MultimediaByID(int.Parse(Video_ID.ToString())).Languages_ID == 1) { for (int i = 0; i < arNgu.Count; i++) { //Thực hiện dịch ngữ int Lang_ID = int.Parse(arNgu[i].ToString()); if (!HPCShareDLL.HPCDataProvider.Instance().ExitsTranlate_T_Multimedia(int.Parse(Video_ID.ToString()), Lang_ID)) { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("LANQUAGE_ALERT") + "');", true); //return; } else { _IDVideo = _DAL.Copy_To_T_Multimedia(int.Parse(Video_ID.ToString()), Lang_ID, 2, DateTime.Now, _user.UserID, _user.UserID); if (_IDVideo > 0) { WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Copy]", Request["Menu_ID"], "[Copy] [Media]: [Multimedia chờ xuất bản] [Thao tác copy bài sang chuyên trang: " + UltilFunc.GetTenNgonNgu(Lang_ID) + "]", _IDVideo, ConstAction.AmThanhHinhAnh); } } } } else { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("LANQUAGE_ALERT_EXITS") + "');", true); return; } } } else { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhandich") + "');", true); ModalPopupExtender1.Hide(); } if (_IDVideo > 0) { ModalPopupExtender1.Hide(); Load_Choxuatban(); } }
protected void but_Trans_Click(object sender, EventArgs e) { double _IDAlbum = 0.0; ArrayList arNgu = new ArrayList(); foreach (DataGridItem m_Item in dgCategorysCopy.Items) { CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect"); if (chk_Select != null && chk_Select.Checked) { arNgu.Add(double.Parse(dgCategorysCopy.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString())); } } ArrayList arrTin = new ArrayList(); foreach (DataGridItem m_Item in DataGrid_Choduyet.Items) { CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect"); if (chk_Select != null && chk_Select.Checked) { arrTin.Add(double.Parse(DataGrid_Choduyet.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString())); } } T_Album_PhotoDAL tt = new HPCBusinessLogic.DAL.T_Album_PhotoDAL(); T_Album_CategoriesDAL _Album_CateDAL = new T_Album_CategoriesDAL(); NgonNgu_DAL _LanguagesDAL = new NgonNgu_DAL(); if (arrTin.Count > 0) { for (int j = 0; j < arrTin.Count; j++) { double News_ID = double.Parse(arrTin[j].ToString()); if (_Album_CateDAL.load_T_Album_Categories(int.Parse(News_ID.ToString())).Lang_ID == 1) { for (int i = 0; i < arNgu.Count; i++) { //Thực hiện dịch ngữ int Lang_ID = int.Parse(arNgu[i].ToString()); if (!HPCShareDLL.HPCDataProvider.Instance().ExitsTranlate_T_Album_Photo(int.Parse(News_ID.ToString()), Lang_ID)) { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("LANQUAGE_ALERT") + "');", true); //return; } else { _IDAlbum = _Album_CateDAL.Copy_To_T_Album_Categories(int.Parse(News_ID.ToString()), Lang_ID, 2, DateTime.Now, _user.UserID, _user.UserID); if (_IDAlbum > 0) { tt.Copy_To_T_Album_Photo(int.Parse(News_ID.ToString()), int.Parse(_IDAlbum.ToString()), Lang_ID, DateTime.Now, _user.UserID); WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Copy]", Request["Menu_ID"], "[Copy] [Phóng sự ảnh]: [Duyệt Phóng sự ảnh] [Thao tác copy bài sang chuyên trang: " + UltilFunc.GetTenNgonNgu(Lang_ID) + "]", _IDAlbum, ConstAction.GocAnh); } } } } else { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("LANQUAGE_ALERT_EXITS") + "');", true); return; } } } else { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhandich") + "');", true); } if (_IDAlbum > 0) { ModalPopupExtender1.Hide(); this.LoadPSchoduyet(); } ////Tao cache ////UltilFunc.GenCacheHTML(); }
protected void but_Trans_Click(object sender, EventArgs e) { ArrayList arNgu = new ArrayList(); foreach (DataGridItem m_Item in this.dgCopyNgonNgu.Items) { CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect"); if (chk_Select != null && chk_Select.Checked) { arNgu.Add(double.Parse(this.dgCopyNgonNgu.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString())); } } ArrayList arrTin = new ArrayList(); foreach (DataGridItem m_Item in grdListCate.Items) { CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect"); if (chk_Select != null && chk_Select.Checked) { arrTin.Add(double.Parse(grdListCate.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString())); } } T_Photo_EventDAL tt = new T_Photo_EventDAL(); NgonNgu_DAL _LanguagesDAL = new NgonNgu_DAL(); T_NgonNgu _obj = new T_NgonNgu(); if (arrTin.Count > 0) { for (int j = 0; j < arrTin.Count; j++) { double News_ID = double.Parse(arrTin[j].ToString()); if (tt.GetOneFromT_Photo_EventsByID(int.Parse(News_ID.ToString())).Lang_ID == 1) { for (int i = 0; i < arNgu.Count; i++) { //Thực hiện dịch ngữ int Lang_ID = int.Parse(arNgu[i].ToString()); if (!HPCShareDLL.HPCDataProvider.Instance().ExitsTranlate_T_Photo_Even(int.Parse(News_ID.ToString()), Lang_ID)) { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("LANQUAGE_ALERT") + "');", true); //return; } else { tt.InsertT_Photo_Events_SendLanger(int.Parse(News_ID.ToString()), int.Parse(News_ID.ToString()), Lang_ID); _obj = _LanguagesDAL.GetOneFromT_NgonNguByID(Lang_ID); string _ActionsCode = "[Thời sự qua ảnh] [Duyệt ảnh thời sự] [Dịch ngữ] [Ngữ: " + _obj.TenNgonNgu + "] [Ảnh: " + tt.GetOneFromT_Photo_EventsByID(News_ID).Photo_Name + "]"; WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Dịch ngữ]", Convert.ToInt32(Request["Menu_ID"]), _ActionsCode, int.Parse(News_ID.ToString()), ConstAction.TSAnh); } } } else { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("LANQUAGE_ALERT_EXITS") + "');", true); return; } } } else { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('Bạn chưa chọn mục cần dịch ngữ!');", true); } LoadData(status); ModalPopupExtender1.Hide(); }
protected void dgCategorysCopy_EditCommand(object source, DataGridCommandEventArgs e) { if (e.CommandArgument.ToString().ToLower() == "editcopy") { double _IDAlbum = 0.0; DataGridItem m_ItemCat = e.Item; int Lang_ID = int.Parse(dgCategorysCopy.DataKeys[m_ItemCat.ItemIndex].ToString()); ArrayList arrTin = new ArrayList(); foreach (DataGridItem m_Item in DataGrid_Choduyet.Items) { CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect"); if (chk_Select != null && chk_Select.Checked) { arrTin.Add(double.Parse(DataGrid_Choduyet.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString())); } } T_Album_PhotoDAL tt = new HPCBusinessLogic.DAL.T_Album_PhotoDAL(); T_Album_CategoriesDAL _Album_CateDAL = new T_Album_CategoriesDAL(); NgonNgu_DAL _LanguagesDAL = new NgonNgu_DAL(); if (arrTin.Count > 0) { for (int j = 0; j < arrTin.Count; j++) { double News_ID = double.Parse(arrTin[j].ToString()); if (_Album_CateDAL.load_T_Album_Categories(int.Parse(News_ID.ToString())).Lang_ID == 1) { if (!HPCShareDLL.HPCDataProvider.Instance().ExitsTranlate_T_Album_Photo(int.Parse(News_ID.ToString()), Lang_ID)) { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("LANQUAGE_ALERT") + "');", true); //return; } else { _IDAlbum = _Album_CateDAL.Copy_To_T_Album_Categories(int.Parse(News_ID.ToString()), Lang_ID, 2, DateTime.Now, _user.UserID, _user.UserID); if (_IDAlbum > 0) { tt.Copy_To_T_Album_Photo(int.Parse(News_ID.ToString()), int.Parse(_IDAlbum.ToString()), Lang_ID, DateTime.Now, _user.UserID); WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Copy]", Request["Menu_ID"], "[Copy] [Phóng sự ảnh]: [Duyệt phóng sự ảnh] [Thao tác copy bài sang chuyên trang: " + UltilFunc.GetTenNgonNgu(Lang_ID) + "]", _IDAlbum, ConstAction.GocAnh); CheckBox checkcopy = (CheckBox)m_ItemCat.FindControl("optSelect"); ImageButton btnCopy = (ImageButton)m_ItemCat.FindControl("btnCopy"); btnCopy.Visible = false; checkcopy.Visible = false; checkcopy.Enabled = false; } } } else { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("LANQUAGE_ALERT_EXITS") + "');", true); return; } } } else { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('Bạn chưa chọn danh mục cần dịch ngữ!');", true); ModalPopupExtender1.Hide(); } if (_IDAlbum > 0) { //ModalPopupExtender1.Hide(); this.LoadPSchoduyet(); } } }