protected void btnLinkDuyetAnh_Click(object sender, EventArgs e) { T_Photo_EventDAL _cateDAL = new T_Photo_EventDAL(); T_Photo_Event _catObj = new T_Photo_Event(); foreach (DataGridItem m_Item in grdListCate.Items) { CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect"); TextBox txtTitle = (TextBox)m_Item.FindControl("txtTitle"); TextBox txttacgia = (TextBox)m_Item.FindControl("txt_tacgia"); Label lblUrlPath = (Label)m_Item.FindControl("lblUrlPath"); DropDownList cboNgonNgu = (DropDownList)m_Item.FindControl("cboNgonNgu"); double PhotoID = double.Parse(grdListCate.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString()); _catObj = setItem(int.Parse(PhotoID.ToString()), lblUrlPath.Text, txtTitle.Text, Convert.ToInt32(cboNgonNgu.SelectedValue), txttacgia.Text); _cateDAL.InsertT_Photo_Events(_catObj); if (chk_Select != null && chk_Select.Checked) { T_Photo_EventDAL _untilDAL = new T_Photo_EventDAL(); T_Photo_Event _obj = new T_Photo_Event(); _obj = _untilDAL.GetOneFromT_Photo_EventsByID(PhotoID); if (pageback == 1) { if (_obj.Photo_Name.Trim().Length > 0) { _untilDAL.UpdateStatus_Photo_Events(PhotoID, 8, _user.UserID, DateTime.Now); } else { ScriptManager.RegisterStartupScript(this, GetType(), "myFunction", "alert('Bạn chưa nhập tiêu đề ảnh !');", true); } } else if (pageback == 2) { _untilDAL.UpdateStatus_Photo_Events(PhotoID, 3, _user.UserID, DateTime.Now); #region Sync // DONG BO ANH SynFiles _syncfile = new SynFiles(); if (_obj.Photo_Medium.Length > 0) { _syncfile.SynData_UploadImgOne(_obj.Photo_Medium, HPCComponents.Global.ImagesService); } //END #endregion } string _ActionsCode = "[Thời sự qua ảnh] " + menuName + " [Gửi duyệt Ảnh] [Ảnh: " + _untilDAL.GetOneFromT_Photo_EventsByID(PhotoID).Photo_Name + "]"; WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Gửi duyệt]", Convert.ToInt32(Request["Menu_ID"]), _ActionsCode, PhotoID, ConstAction.TSAnh); } } LoadData(status); }
protected void lbt_Xuatban_Click(object sender, EventArgs e) { T_MultimediaDAL _untilDAL = new T_MultimediaDAL(); foreach (DataGridItem item in dgData_ChoXuatban.Items) { CheckBox check = (CheckBox)item.FindControl("optSelect"); if (check.Checked) { try { Label lblLogTitle = (Label)item.FindControl("lblLogTitle"); int _ID = Convert.ToInt32(this.dgData_ChoXuatban.DataKeys[item.ItemIndex].ToString()); _untilDAL.UpdateStatusMultimedia(_ID, 3, _user.UserID); WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, lblLogTitle.Text, Request["Menu_ID"].ToString(), "XUẤT BẢN MULTIMEDIA", _ID, ConstAction.AmThanhHinhAnh); #region Sync // DONG BO FILE try { T_Multimedia _objSet = new T_Multimedia(); _objSet = _untilDAL.GetOneFromT_MultimediaByID(_ID); SynFiles _syncfile = new SynFiles(); if (_objSet.URL_Images.Length > 0) { _syncfile.SynData_UploadImgOne(_objSet.URL_Images, HPCComponents.Global.ImagesService); } if (_objSet.URLPath.Length > 0) { _syncfile.SynData_UploadImgOne(_objSet.URLPath, HPCComponents.Global.ImagesService); } } catch (Exception) { throw; } //END #endregion } catch (Exception ex) { //HPCServerDataAccess.Lib.ShowAlertMessage(ex.Message.ToString()); } } } Load_Choxuatban(); System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "javascript", "javascript: SetInnerProcess('" + _untilDAL.getTotalRecord(4, _user.UserID) + "','" + _untilDAL.getTotalRecord(5, _user.UserID) + "');", true); }
protected void linkSave_Click(object sender, EventArgs e) { if (Page.IsValid) { T_WebLinksDAL _cateDAL = new T_WebLinksDAL(); T_WebLinks _catObj = GetObject(); int _return = _cateDAL.InsertT_WebLinks(_catObj); // DONG BO FILE _catObj = _cateDAL.load_T_WebLinks(_return); try { SynFiles _syncfile = new SynFiles(); if (_catObj.Logo.Length > 0) { _syncfile.SynData_UploadImgOne(_catObj.Logo, HPCComponents.Global.ImagesService); } } catch (Exception) { throw; } //END //#region SYNC //if (UltilFunc.Check_SyncNewsDatabase(Request["Menu_ID"])) // SynData_InsertT_WebLinksOne(_return, Global.Path_Service); //if (UltilFunc.Check_SyncImageDatabase(Request["Menu_ID"])) //{ // if (!txtThumbnail.Text.StartsWith("http")) // { // if (_catObj.Logo != null && _catObj.Logo.Length > 0) // HPCSYNCUploadFiles.SyncUpload.SynData_UploadImgOne(_catObj.Logo, Global.ImagesService); // } //} //#endregion if (_catObj.ID == 0) { WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Thêm mới]", Request["Menu_ID"].ToString(), "[Thêm mới]-->[Thao tác thêm mới T_WebLinks]", 0, 0); System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("UpdateSuccessfully") + "');", true); } else { WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Cập nhật]", Request["Menu_ID"].ToString(), "[Sửa danh sách T_WebLinks]-->[Thao tác sửa]", 0, 0); System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("UpdateSuccessfully") + "');", true); } Page.Response.Redirect("~/Quangcao/WeblinksList.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString()); } }
protected void Save_Click(object sender, EventArgs e) { string Thaotac = string.Empty; this.Page.Validate(vs_Themmoi.ValidationGroup); if (!Page.IsValid) { return; } ChuyenmucDAL _ChuyenMucDAL = new ChuyenmucDAL(); T_ChuyenMuc _ChuyenMuc = SetItem(); if (cbo_Anpham.SelectedIndex == 0) { FuncAlert.AlertJS(this, "Bạn chưa chọn ấn phẩm!"); return; } else { int menuID = 0; if (Request["ID"] != null && Request["ID"].ToString() != "" && Request["ID"].ToString() != String.Empty) { menuID = int.Parse(Request["ID"].ToString()); } int _return = _ChuyenMucDAL.Insert_T_Chuyenmuc(_ChuyenMuc); // DONG BO FILE _ChuyenMuc = _ChuyenMucDAL.GetOneFromT_ChuyenmucByID(_return); SynFiles _syncfile = new SynFiles(); if (_ChuyenMuc.Anh_ChuyenMuc.Length > 0) { _syncfile.SynData_UploadImgOne(_ChuyenMuc.Anh_ChuyenMuc, HPCComponents.Global.ImagesService); } //END if (Page.Request.Params["id"] == null) { Thaotac = "[Thêm mới Chuyên mục]-->[mã chuyên mục:" + _return.ToString() + " ]"; Clear(); BindCombo(); } if (Page.Request.Params["id"] != null) { Thaotac = "[Sửa chuyên mục]-->[Mã chuyên mục:" + Page.Request["id"].ToString() + " ]"; Clear(); BindCombo(); } } }
protected void linkPub_Click(object sender, EventArgs e) { if (Page.IsValid) { if (!string.IsNullOrEmpty(txt_tien.Text)) { int tien = 0; try { tien = int.Parse(txt_tien.Text.Replace(",", "")); } catch { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanTien") + "');", true); return; } } T_MultimediaDAL _untilDAL = new T_MultimediaDAL(); HPCInfo.T_Multimedia obj = SetItem(3); int _return = _untilDAL.InsertT_Multimedia(obj); #region Sync // DONG BO FILE try { T_Multimedia _objSet = new T_Multimedia(); _objSet = _untilDAL.GetOneFromT_MultimediaByID(_return); SynFiles _syncfile = new SynFiles(); if (_objSet.URL_Images.Length > 0) { _syncfile.SynData_UploadImgOne(_objSet.URL_Images, HPCComponents.Global.ImagesService); } if (_objSet.URLPath.Length > 0) { _syncfile.SynData_UploadImgOne(_objSet.URLPath, HPCComponents.Global.ImagesService); } } catch (Exception) { throw; } //END #endregion WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, obj.Tittle, Request["Menu_ID"].ToString(), "XUẤT BẢN", _return, ConstAction.AmThanhHinhAnh); Page.Response.Redirect("~/Multimedia/Multimedia_Approve.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&TabID=" + Convert.ToInt32(Request["TabID"])); } }
protected void linkSave_Click(object sender, EventArgs e) { if (Page.IsValid) { if (!string.IsNullOrEmpty(txt_tien.Text)) { int tien = 0; try { tien = int.Parse(txt_tien.Text.Replace(",", "")); } catch { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanTien") + "');", true); return; } } T_MultimediaDAL _untilDAL = new T_MultimediaDAL(); HPCInfo.T_Multimedia obj = SetItem(3); int _return = _untilDAL.InsertT_Multimedia(obj); #region Sync // DONG BO FILE T_Multimedia _objSet = new T_Multimedia(); _objSet = _untilDAL.GetOneFromT_MultimediaByID(_return); SynFiles _syncfile = new SynFiles(); if (_objSet.URL_Images.Length > 0) { _syncfile.SynData_UploadImgOne(_objSet.URL_Images, HPCComponents.Global.ImagesService); } if (_objSet.URLPath.Length > 0) { _syncfile.SynData_UploadImgOne(_objSet.URLPath, HPCComponents.Global.ImagesService); } //END #endregion WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, obj.Tittle, Request["Menu_ID"], "MEDIA ĐÃ DUYỆT - SỬA ĐỔI THÔNG TIN", _return, ConstAction.AmThanhHinhAnh); if (obj.URL_Images.Length > 2) { this.ImgTemp.Src = HPCComponents.Global.UploadPathBDT + obj.URL_Images; } else { this.ImgTemp.Attributes.CssStyle.Add("display", "none"); } System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "message", "alert('" + CommonLib.ReadXML("lblCapnhatthanhcong") + "');", true); } }
protected void linkSave_Click(object sender, EventArgs e) { try { #region "Duyet danh sach cac doi tuong tren luoi" HPCBusinessLogic.DAL.T_Album_PhotoDAL _cateDAL = new HPCBusinessLogic.DAL.T_Album_PhotoDAL(); HPCInfo.T_Album_Photo _catObj; bool checktien = true; foreach (DataGridItem m_Item in grdListCate.Items) { TextBox txt_tienNB = (TextBox)m_Item.FindControl("txt_tienNB"); if (!string.IsNullOrEmpty(txt_tienNB.Text)) { try { int.Parse(txt_tienNB.Text.Replace(",", "")); } catch { checktien = false; } } } if (checktien) { HPCBusinessLogic.DAL.T_ButdanhDAL obj = new HPCBusinessLogic.DAL.T_ButdanhDAL(); foreach (DataGridItem m_Item in grdListCate.Items) { T_Butdanh obj_BD = new T_Butdanh(); TextBox txtTitle = (TextBox)m_Item.FindControl("txtTitle"); TextBox txt_tienNB = (TextBox)m_Item.FindControl("txt_tienNB"); TextBox txtDesc = (TextBox)m_Item.FindControl("txtDesc"); TextBox txttacgia = (TextBox)m_Item.FindControl("txt_tacgia"); TextBox txt_tacgiaID = (TextBox)m_Item.FindControl("txt_tacgiaID"); TextBox txt_OrderByPhoto = (TextBox)m_Item.FindControl("txt_OrderByPhoto"); Label lblUrlPath = (Label)m_Item.FindControl("lblUrlPath"); //CheckBox _chkIsHomeAlbum = (CheckBox)m_Item.FindControl("chkIsHomeAlbum"); int tien = 0; if (!string.IsNullOrEmpty(txt_tienNB.Text)) { try { tien = int.Parse(txt_tienNB.Text.Replace(",", "")); } catch {; } } int intPhotoID = Convert.ToInt32(grdListCate.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString()); int butdanhID = 0; if (!string.IsNullOrEmpty(txttacgia.Text.Trim())) { obj_BD.BD_ID = 0; obj_BD.BD_Name = txttacgia.Text.Trim(); obj_BD.UserID = _user.UserID; butdanhID = obj.Insert_Butdang(obj_BD); } _catObj = setItem(intPhotoID, txtTitle.Text, txtDesc.Text, Convert.ToInt32(txt_OrderByPhoto.Text), tien, txttacgia.Text, butdanhID); _cateDAL.InsertT_Album_Photo(_catObj); } LoadData(cat_id); } else { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanTien") + "');", true); } #region Sync // DONG BO ANH int pageback = 0; try { pageback = int.Parse(Session["PageFromID"].ToString()); } catch {; } if (pageback == 3) { SynFiles _syncfile = new SynFiles(); T_Album_PhotoDAL _DAL = new T_Album_PhotoDAL(); DataSet _ds = _DAL.Bind_T_Album_Photo(cat_id); foreach (DataRow theRow in _ds.Tables[0].Rows) { string _img = theRow["Abl_Photo_Origin"].ToString(); if (_img.Trim().Length > 0) { _syncfile.SynData_UploadImgOne(_img, Global.ImagesService); } } } //END #endregion this.litMessages.Text = "Lưu giữ thành công"; #endregion } catch (Exception ex) { HPCServerDataAccess.Lib.ShowAlertMessage(ex.Message.ToString()); } }
protected void link_duyet_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 DataGrid_Choduyet.Items) { Label lblcatid = (Label)item.FindControl("lblcatid"); CheckBox check = (CheckBox)item.FindControl("optSelect"); if (check.Checked) { int _id = Convert.ToInt32(lblcatid.Text); T_Album.Update_Status(_id, 4, _user.UserID); WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "Xuất bản", Request["Menu_ID"].ToString(), "[Phóng sự ảnh chờ duyệt] [Duyệt Phóng sự ảnh: " + T_Album.load_T_Album_Categories(Convert.ToInt32(lblcatid.Text)).Cat_Album_Name + "]", _id, ConstAction.GocAnh); #region Sync // DONG BO ANH try { SynFiles _syncfile = new SynFiles(); T_Album_PhotoDAL _cateDAL = new T_Album_PhotoDAL(); DataSet _ds = _cateDAL.Bind_T_Album_Photo(int.Parse(lblcatid.Text)); foreach (DataRow theRow in _ds.Tables[0].Rows) { string _img = theRow["Abl_Photo_Origin"].ToString(); if (_img.Trim().Length > 0) { _syncfile.SynData_UploadImgOne(_img, Global.ImagesService); } } } catch (Exception) { throw; } //END #endregion } } LoadPSchoduyet(); } else if (TabContainer1.ActiveTabIndex == 1) { foreach (DataGridItem item in DataGrid_HuyXB.Items) { Label lblcatid = (Label)item.FindControl("lblcatid"); CheckBox check = (CheckBox)item.FindControl("optSelect"); if (check.Checked) { int _id = int.Parse(lblcatid.Text); T_Album.Update_Status(_id, 4, _user.UserID); WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "Xuất bản", Request["Menu_ID"].ToString(), "[Phóng sự ảnh hủy xuất bản] [Duyệt Phóng sự ảnh: " + T_Album.load_T_Album_Categories(Convert.ToInt32(lblcatid.Text)).Cat_Album_Name + "]", _id, ConstAction.GocAnh); #region Sync // DONG BO ANH try { SynFiles _syncfile = new SynFiles(); T_Album_PhotoDAL _cateDAL = new T_Album_PhotoDAL(); DataSet _ds = _cateDAL.Bind_T_Album_Photo(int.Parse(lblcatid.Text)); foreach (DataRow theRow in _ds.Tables[0].Rows) { string _img = theRow["Abl_Photo_Origin"].ToString(); if (_img.Trim().Length > 0) { _syncfile.SynData_UploadImgOne(_img, Global.ImagesService); } } } catch (Exception) { throw; } //END #endregion } } LoadPShuyXB(); } }
protected void LinkDanganh_Click(object sender, EventArgs e) { //if (!Page.IsValid) return; #region SYNC T_Photo_EventDAL _untilDAL = new T_Photo_EventDAL(); if (!string.IsNullOrEmpty(txtTienNhuanBut.Text)) { try { int.Parse(txtTienNhuanBut.Text.Replace(",", "")); } catch { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanTien") + "');", true); return; } } T_Photo_Event _Obj = GetObject(); int _return = 0; if (Request["id"] == null) { _return = _untilDAL.InsertT_Photo_Events(_Obj); _untilDAL.UpdateStatus_Photo_Events(Convert.ToDouble(_return.ToString()), 3, _user.UserID, DateTime.Now); } else { _return = _untilDAL.InsertT_Photo_Events(_Obj); _untilDAL.UpdateStatus_Photo_Events(_Obj.Photo_ID, 3, _user.UserID, DateTime.Now); } #endregion // DONG BO ANH try { SynFiles _syncfile = new SynFiles(); _Obj = _untilDAL.GetOneFromT_Photo_EventsByID(_return); if (_Obj.Photo_Medium.Length > 0) { _syncfile.SynData_UploadImgOne(_Obj.Photo_Medium, HPCComponents.Global.ImagesService); } } catch (Exception) { throw; } //END string _ActionsCode = "[Thời sự qua ảnh] [Duyệt ảnh] [Ảnh: " + _Obj.Photo_Name + "]"; WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Duyệt]", Convert.ToInt32(Request["Menu_ID"]), _ActionsCode, _return, ConstAction.TSAnh); if (Page.Request["Tab"].ToString() != "-1") { if (Page.Request["Menu_ID"] != null) { Page.Response.Redirect("~/Anh24h/List_PhotosChoDuyet.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString() + "&Tab=" + Page.Request["Tab"].ToString()); } else { return; } } else { if (Page.Request["Menu_ID"] != null) { Page.Response.Redirect("~/Anh24h/List_PhotosChoDuyet.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString()); } else { return; } } }
protected void linkSave_Click(object sender, EventArgs e) { if (Page.IsValid) { int pageback = 0; try { pageback = int.Parse(Session["PageFromID"].ToString()); } catch {; } if (pageback == 2 || pageback == 3) { if (!string.IsNullOrEmpty(txt_tiennhanbut.Text)) { try { int.Parse(txt_tiennhanbut.Text.Replace(",", "")); } catch { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanTien") + "');", true); return; } } } HPCBusinessLogic.DAL.T_Album_CategoriesDAL _cateDAL = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL(); string strActionNotes = ""; HPCInfo.T_Album_Categories _catObj = GetObject(); int _return = _cateDAL.InsertT_Album_Categories(_catObj); if (_catObj.Cat_Album_ID == 0) { strActionNotes = "[Thêm mới] [Thêm mới Phóng sự ảnh: " + _cateDAL.load_T_Album_Categories(_return).Cat_Album_Name + "]"; } else { strActionNotes = "[Cập nhật] [Cập nhật Phóng sự ảnh: " + _cateDAL.load_T_Album_Categories(_return).Cat_Album_Name + "]"; } WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, _catObj.Cat_Album_Name, Request["Menu_ID"].ToString(), strActionNotes, 0, ConstAction.GocAnh); if (pageback == 3) { #region Sync // DONG BO ANH try { SynFiles _syncfile = new SynFiles(); T_Album_PhotoDAL _DAL = new T_Album_PhotoDAL(); DataSet _ds = _DAL.Bind_T_Album_Photo(_return); foreach (DataRow theRow in _ds.Tables[0].Rows) { string _img = theRow["Abl_Photo_Origin"].ToString(); if (_img.Trim().Length > 0) { _syncfile.SynData_UploadImgOne(_img, Global.ImagesService); } } } catch (Exception) { throw; } //END #endregion } if (_catObj.Cat_Album_ID == 0) { ResetForm(); Response.Redirect("~/PhongSuAnh/Album_List.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString() + "&Back=1"); } else { if (pageback == 1) { Response.Redirect("~/PhongSuAnh/Album_List.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString() + "&Back=1"); } else if (pageback == 2) { Response.Redirect("~/PhongSuAnh/Approves_List.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString() + "&Back=1"); } else if (pageback == 3) { Response.Redirect("~/PhongSuAnh/Approved_List.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString() + "&Back=1"); } else { Response.Redirect("~/PhongSuAnh/Album_List.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString()); } } } }