private void ReturnNewsPublisher(DataGrid dgr)
        {
            T_NewsDAL tt  = new T_NewsDAL();
            T_News    obj = new T_News();

            foreach (DataGridItem m_Item in dgr.Items)
            {
                CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect");
                if (chk_Select != null && chk_Select.Checked)
                {
                    LinkButton linkname = (LinkButton)m_Item.FindControl("linkTittle");
                    double     News_ID  = double.Parse(dgr.DataKeys[m_Item.ItemIndex].ToString());
                    obj = tt.GetOneFromT_NewsByID(News_ID);
                    tt.IsLock(News_ID, 0);
                    //if (obj.Lang_ID == 1)
                    //{
                    //    tt.UpdateStatus_T_News_ex_New_HV(News_ID, ConstNews.NewsReturn_tk, _user.UserID, DateTime.Now);
                    //    tt.Insert_Version_From_T_News_WithUserModify(News_ID, ConstNews.NewsUnPublishing, ConstNews.NewsReturn_tk, _user.UserID);
                    //    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, linkname.Text,
                    //           Request["Menu_ID"].ToString(), "[Xuất bản tin bài] [Danh sách tin bài hủy đăng] [Trả lại Trình bày bài viết]", News_ID, ConstAction.BaoDT);
                    //}
                    //else
                    //{
                    tt.UpdateStatus_T_News_ex_New_HV(News_ID, ConstNews.NewsReturn_tb, _user.UserID, DateTime.Now);
                    tt.Insert_Version_From_T_News_WithUserModify(News_ID, ConstNews.NewsUnPublishing, ConstNews.NewsReturn_tb, _user.UserID);
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, linkname.Text,
                                                                   Request["Menu_ID"].ToString(), "[Xuất bản tin bài] [Danh sách tin bài hủy đăng] [Trả lại Biên tập tin bài]", News_ID, ConstAction.BaoDT);
                    //}
                }
            }
            this.LoadData_UnPublisher();
        }
Example #2
0
 protected void linkSave_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         if (txt_Name.Text.Length > 125)
         {
             System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('Bạn nhập quá độ dài cho phép!');", true);
             return;
         }
         HPCBusinessLogic.DAL.T_CustomersDAL _cateDAL = new HPCBusinessLogic.DAL.T_CustomersDAL();
         HPCInfo.T_Customers _catObj = GetObject();
         int _return = _cateDAL.InsertT_Customers(_catObj);
         if (_catObj.ID == 0)
         {
             string strLog = "[Thêm mới]-->[Thao tác thêm mới khách hàng]ID:" + _return + " ]";
             WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Add News]", Request["Menu_ID"].ToString(), strLog, 0, ConstAction.TSAnh);
             //System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("UpdateSuccessfully") + "');", true);
         }
         else
         {
             string strLog = "[Sửa danh sách KH]-->[Thao tác sửa][ID:" + Page.Request["id"].ToString() + " ]";
             WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Update]", Request["Menu_ID"].ToString(), strLog, 0, ConstAction.TSAnh);
             //System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("UpdateSuccessfully") + "');", true);
         }
         Page.Response.Redirect("~/Quangcao/CustomerList.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString());
     }
 }
Example #3
0
 public void grdListCategory_EditCommand(object source, DataGridCommandEventArgs e)
 {
     HPCBusinessLogic.DAL.T_CustomersDAL obj_Cate = new HPCBusinessLogic.DAL.T_CustomersDAL();
     if (e.CommandArgument.ToString().ToLower() == "edit")
     {
         int catID = Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString());
         Response.Redirect("~/Quangcao/CustomerEdit.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + catID);
     }
     if (e.CommandArgument.ToString().ToLower() == "delete")
     {
         obj_Cate.DeleteFrom_T_Customers(Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString()));
         //#region SYNC
         //if (UltilFunc.Check_SyncNewsDatabase(Request["Menu_ID"]))
         //    SynData_DeleteT_T_CustumerAny(Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString()), Global.Path_Service);
         //#endregion
         string strLog = "[Xóa khách hàng]-->[Thao tác khách hàng][ID:" + this.grdListCate.DataKeys[e.Item.ItemIndex].ToString() + " ]";
         WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Xóa]", Request["Menu_ID"].ToString(), strLog, 0, ConstAction.TSAnh);
         this.LoadData();
     }
     else if (e.CommandArgument.ToString().ToLower() == "editorder")
     {
         string _catid = this.grdListCate.DataKeys[e.Item.ItemIndex].ToString();
         this.LoadData();
     }
 }
 protected void linkSendPub_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         string strAction = ""; string TabID = "0";
         if (Request["TabID"] != null)
         {
             TabID = Request["TabID"].ToString();
         }
         T_MultimediaDAL      _untilDAL = new T_MultimediaDAL();
         HPCInfo.T_Multimedia obj       = null;
         if (TabID == "0")
         {
             strAction = "THÊM MỚI VÀ GỬI DUYỆT";
         }
         else if (TabID == "1")
         {
             strAction = "SỬA ĐỔI BÀI TRẢ LẠI VÀ GỬI DUYỆT";
         }
         obj = SetItem(2);
         int _return = _untilDAL.InsertT_Multimedia(obj);
         WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, obj.Tittle, Request["Menu_ID"].ToString(), strAction, _return, ConstAction.AmThanhHinhAnh);
         Page.Response.Redirect("~/Multimedia/List_Multimedia.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&TabID=" + TabID);
     }
 }
 protected void link_tralai_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");
             int      _id      = int.Parse(lblcatid.Text);
             CheckBox check    = (CheckBox)item.FindControl("optSelect");
             if (check.Checked)
             {
                 T_Album.Update_Status(_id, 3, _user.UserID);
             }
             WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "Trả lại", Request["Menu_ID"].ToString(), "[Phóng sự ảnh chờ duyệt] [Trả lại Phóng sự ảnh: " + T_Album.load_T_Album_Categories(Convert.ToInt32(lblcatid.Text)).Cat_Album_Name + "]", _id, ConstAction.GocAnh);
         }
         LoadPSchoduyet();
     }
     else if (TabContainer1.ActiveTabIndex == 1)
     {
         foreach (DataGridItem item in DataGrid_HuyXB.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, 3, _user.UserID);
             }
             WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "Trả lại", Request["Menu_ID"].ToString(), "[Phóng sự ảnh hủy xuất bản] [Trả lại Phóng sự ảnh: " + T_Album.load_T_Album_Categories(Convert.ToInt32(lblcatid.Text)).Cat_Album_Name + "]", _id, ConstAction.GocAnh);
         }
         LoadPShuyXB();
     }
 }
        protected void btnLinkTra_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);
                    _untilDAL.UpdateStatus_Photo_Events(PhotoID, 7, _user.UserID, DateTime.Now);
                    string _ActionsCode = "[Thời sự qua ảnh] " + menuName + " [Trả Ảnh] [Ảnh: " + _obj.Photo_Name + "]";
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Trả Ảnh]", Convert.ToInt32(Request["Menu_ID"]), _ActionsCode, PhotoID, ConstAction.TSAnh);
                }
            }
            LoadData(status);
        }
        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(2);
                if (obj.URL_Images.Length > 2)
                {
                    this.ImgTemp.Src = HPCComponents.Global.UploadPathBDT + obj.URL_Images;
                }
                else
                {
                    this.ImgTemp.Attributes.CssStyle.Add("display", "none");
                }
                if (obj.ID > 0)
                {
                    int _return = _untilDAL.InsertT_Multimedia(obj);
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, obj.Tittle, Request["Menu_ID"].ToString(), "CHỜ XUẤT BẢN - SỬA ĐỔI THÔNG TIN", _return, ConstAction.AmThanhHinhAnh);
                    System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "message", "alert('Bạn đã cập nhật thành công');", true);
                }
            }
        }
Example #8
0
        protected void btnLinkDelete_Click(object sender, EventArgs e)
        {
            string strActionHistory = "";
            int    Ads_ID           = 0;

            foreach (DataGridItem m_Item in grdListCate.Items)
            {
                CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect");
                if (chk_Select != null && chk_Select.Checked)
                {
                    Label lblMota = (Label)m_Item.FindControl("lblMota");
                    Ads_ID = int.Parse(grdListCate.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString());
                    if (strActionHistory == "")
                    {
                        strActionHistory = lblMota.Text;
                    }
                    else
                    {
                        strActionHistory = strActionHistory + "<br>" + lblMota.Text;
                    }
                    DeleteAdsByID(Ads_ID);
                }
            }
            //Ghi log nhat ky xoa vao he thong
            WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserName, strActionHistory, Request["Menu_ID"].ToString(), "XÓA THÔNG TIN QUẢNG CÁO", 0, 0);
            LoadData();
        }
Example #9
0
        protected void LinkNgungDang_Click(object sender, EventArgs e)
        {
            HPCBusinessLogic.T_Photo_EventDAL _untilDAL = new HPCBusinessLogic.T_Photo_EventDAL();
            T_Photo_Event    _obj = new T_Photo_Event();
            T_Photo_EventDAL DAL  = new T_Photo_EventDAL();

            foreach (DataGridItem m_Item in grdListCate.Items)
            {
                CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect");
                TextBox  txtGhichu  = (TextBox)m_Item.FindControl("txtGhichu");
                TextBox  txt_tienNB = m_Item.FindControl("txt_tienNB") as TextBox;
                if (chk_Select != null && chk_Select.Checked)
                {
                    double id = double.Parse(grdListCate.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString());
                    _obj = DAL.GetOneFromT_Photo_EventsByID(id);
                    //ghi chu
                    T_Photo_Event _objNew = new T_Photo_Event();
                    _objNew = setItem(_obj.Photo_ID, _obj.Photo_Medium, _obj.Photo_Name, _obj.Lang_ID, _obj.Author_Name, txt_tienNB.Text, txtGhichu.Text, _obj.Photo_Status);
                    int _return = _untilDAL.InsertT_Photo_Events(_objNew);
                    //string _ActionsCode1 = "[Thời sự qua ảnh] [Duyệt ảnh thời sự] [Cập nhật ảnh] [Ảnh: " + _obj.Photo_Name + "]";
                    //WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Cập nhật]", Convert.ToInt32(Request["Menu_ID"]), _ActionsCode1, _return, ConstAction.TSAnh);
                    // Update on Server Destinations
                    _untilDAL.UpdateStatus_Photo_Events(id, 2, _user.UserID, DateTime.Now);
                    string _ActionsCode = "[Thời sự qua ảnh] [Ngừng đăng ][Ảnh: " + _obj.Photo_Name + "";
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Ngừng đăng]", Convert.ToInt32(Request["Menu_ID"]), _ActionsCode, id, ConstAction.TSAnh);
                }
            }
            LoadData(this.txtPageIndex.Text.Trim());
        }
Example #10
0
        public void grdListCategory_EditCommand(object source, DataGridCommandEventArgs e)
        {
            T_Photo_EventDAL _DAL       = new T_Photo_EventDAL();
            T_Photo_Event    _obj       = new T_Photo_Event();
            TextBox          txt_tienNB = e.Item.FindControl("txt_tienNB") as TextBox;
            int _ID = Convert.ToInt32(grdListCate.DataKeys[e.Item.ItemIndex].ToString());

            _obj = _DAL.GetOneFromT_Photo_EventsByID(_ID);
            if (e.CommandArgument.ToString().ToLower() == "savephoto")
            {
                int tien = 0;
                if (!string.IsNullOrEmpty(txt_tienNB.Text))
                {
                    try { tien = int.Parse(txt_tienNB.Text.Replace(",", "")); }
                    catch {; }
                }
                if (txt_tienNB.Text.Trim().Length > 0)
                {
                    string sql = "Update T_Photo_Event set TienNB = " + tien + " where Photo_ID = " + _ID;
                    HPCDataProvider.Instance().ExecSql(sql);
                    string _ActionsCode = "[Thời sự qua ảnh] [Xuất bản ảnh thời sự] [Chấm nhuận bút ảnh trong ngày] [Ảnh: " + _obj.Photo_Name + "]";
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Cập nhật]", Convert.ToInt32(Request["Menu_ID"]), _ActionsCode, _ID, ConstAction.TSAnh);
                    ScriptManager.RegisterStartupScript(this, GetType(), "myFunction", "alert('Bạn đã chấm nhuận bút thành công !');", true);
                }
                else
                {
                    txt_tienNB.Focus();
                    ScriptManager.RegisterStartupScript(this, GetType(), "myFunction", "alert('Bạn chưa nhập tiêu đề ảnh !');", true);
                }
            }
        }
Example #11
0
        protected void btnLinkDelete_Click(object sender, EventArgs e)
        {
            ArrayList ar = new ArrayList();

            foreach (DataGridItem m_Item in grdListCate.Items)
            {
                CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect");
                if (chk_Select != null && chk_Select.Checked)
                {
                    ar.Add(int.Parse(grdListCate.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString()));
                }
            }
            LoadData();
            for (int i = 0; i < ar.Count; i++)
            {
                int    News_ID = int.Parse(ar[i].ToString());
                string _Url    = "";
                HPCBusinessLogic.DAL.T_WebLinksDAL tt = new HPCBusinessLogic.DAL.T_WebLinksDAL();
                _Url = tt.load_T_WebLinks(News_ID).URL;
                tt.DeleteFrom_T_WebLinks(News_ID);
                string strLog = "[Danh sách liên kết website:]-->[Xóa liên kết] [URL:" + _Url + "";
                WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Xóa]", Request["Menu_ID"].ToString(), strLog, 0, 0);
            }
            LoadData();
        }
Example #12
0
        private double Insert(Boolean _send)
        {
            T_News obj;

            HPCBusinessLogic.DAL.T_NewsDAL tt_DAL = new HPCBusinessLogic.DAL.T_NewsDAL();
            obj         = SetItem();
            obj.News_ID = tt_DAL.InsertT_news(obj);
            UltilFunc.Insert_News_Image(this.txt_noidung.Text.Trim(), obj.News_ID);
            int tab = 0;

            if (_send)
            {
                SendPub(double.Parse(obj.News_ID.ToString()));
                if (Page.Request["Tab"] != null)
                {
                    tab = Convert.ToInt32(Page.Request["Tab"].ToString());
                }
                if (tab == 1)
                {
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, obj.News_Tittle,
                                                                   Request["Menu_ID"].ToString(), "[Nhập tin bài] [Bài bị trả lại] [Thao tác gửi Trình bày bài viết]", obj.News_ID, ConstAction.BaoDT);
                }
                else
                {
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, obj.News_Tittle,
                                                                   Request["Menu_ID"].ToString(), "[Nhập tin bài] [Cập nhật tin bài] [Thao tác gửi Trình bày bài viết]", obj.News_ID, ConstAction.BaoDT);
                }
            }
            return(double.Parse(obj.News_ID.ToString()));
        }
Example #13
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();
     }
 }
Example #14
0
        protected void cmd_chamall_Click(object sender, EventArgs e)
        {
            HPCBusinessLogic.DAL.T_ButdanhDAL obj_BD_DAL = new HPCBusinessLogic.DAL.T_ButdanhDAL();
            HPCBusinessLogic.ImageFilesDAL    obj        = new HPCBusinessLogic.ImageFilesDAL();
            int type = 1; try { type = int.Parse(Request["TypeID"].ToString()); }

            catch {; }
            if (checkCham.Checked)
            {
                int tien = 0;
                if (!string.IsNullOrEmpty(txt_tienNB.Text.Trim()))
                {
                    try { tien = int.Parse(txt_tienNB.Text.Trim().Replace(",", "")); }
                    catch { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alrt('Tiền phải nhập kiểu số nguyên');", true); return; }
                    foreach (DataGridItem item in dgr_anh.Items)
                    {
                        int   newid        = int.Parse(lbl_News_ID.Text);
                        Label lbl_Image_ID = (Label)item.FindControl("lbl_Image_ID");
                        int   ImageID      = int.Parse(lbl_Image_ID.Text);

                        HPCBusinessLogic.DAL.T_NewsDAL _Obj = new HPCBusinessLogic.DAL.T_NewsDAL();
                        _Obj.Update_TiennhanbutAnh(type, newid, int.Parse(lbl_Image_ID.Text), tien, _user.UserID);

                        WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, " ",
                                                                       Request["Menu_ID"].ToString(), "Duyệt ảnh ", int.Parse(lbl_Image_ID.Text), ConstAction.BaoDT);
                    }
                }
            }
            else
            {
                foreach (DataGridItem item in dgr_anh.Items)
                {
                    TextBox txt_tiennhanbut = (TextBox)item.FindControl("txt_tiennhanbut");
                    if (!string.IsNullOrEmpty(txt_tiennhanbut.Text))
                    {
                        try { int.Parse(txt_tiennhanbut.Text.Replace(",", "")); }
                        catch { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alrt('Tiền phải nhập kiểu số nguyên');", true); return; }
                    }
                }
                foreach (DataGridItem item in dgr_anh.Items)
                {
                    TextBox txt_tiennhanbut = (TextBox)item.FindControl("txt_tiennhanbut");
                    int     newid           = int.Parse(lbl_News_ID.Text);
                    Label   lbl_Image_ID    = (Label)item.FindControl("lbl_Image_ID");
                    int     ImageID         = int.Parse(lbl_Image_ID.Text);
                    int     tien            = 0;
                    if (!string.IsNullOrEmpty(txt_tiennhanbut.Text))
                    {
                        tien = int.Parse(txt_tiennhanbut.Text.Replace(",", ""));
                    }

                    HPCBusinessLogic.DAL.T_NewsDAL _Obj = new HPCBusinessLogic.DAL.T_NewsDAL();
                    _Obj.Update_TiennhanbutAnh(type, newid, ImageID, tien, _user.UserID);
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, " ",
                                                                   Request["Menu_ID"].ToString(), "Duyệt ảnh ", int.Parse(lbl_Image_ID.Text), ConstAction.BaoDT);
                }
            }
            LoadImage();
        }
        protected void linkSave_Click(object sender, EventArgs e)
        {
            //if (!Page.IsValid) return;
            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 (_Obj.Photo_ID == 0)
            {
                _return = _untilDAL.InsertT_Photo_Events(_Obj);
                string _ActionsCode = "[Thời sự qua ảnh] [Thao tác Thêm] [Ảnh: " + _Obj.Photo_Name + "]";
                WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Thêm mới]", Convert.ToInt32(Request["Menu_ID"]), _ActionsCode, _return, ConstAction.TSAnh);
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("VALIDATE_ADDNEWS") + "');", true);
            }
            else
            {
                _return = _untilDAL.InsertT_Photo_Events(_Obj);
                string _ActionsCode = "[Thời sự qua ảnh] [Cập nhật ảnh trong ngày] [Ảnh: " + _Obj.Photo_Name + "]";
                WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Cập nhật]", Convert.ToInt32(Request["Menu_ID"]), _ActionsCode, _return, ConstAction.TSAnh);
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("VALIDATE_ADDNEWS") + "');", true);
            }
            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 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);
        }
Example #17
0
        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);
            }
        }
        protected void cmd_Chamnhanbut_Click(object sender, EventArgs e)
        {
            bool checkall = true;

            foreach (DataGridItem item in dgr_tintuc.Items)
            {
                bool    check      = true;
                TextBox txt_tien   = (TextBox)item.FindControl("txt_tien");
                Label   lbl_NewsID = (Label)item.FindControl("lbl_ID");
                Label   lbl_loaiID = (Label)item.FindControl("lbl_loaiID");
                Label   lbl_title  = (Label)item.FindControl("lbl_title");
                //LinkButton linkTittle = (LinkButton)item.FindControl("linkTittle");
                int tien = 0;
                try
                {
                    if (!string.IsNullOrEmpty(txt_tien.Text))
                    {
                        check = true;
                        tien  = int.Parse(txt_tien.Text.Replace(",", "")); txt_tien.ForeColor = System.Drawing.Color.Black;
                    }
                }
                catch
                {
                    check = false; txt_tien.ForeColor = System.Drawing.Color.Red; checkall = false;
                }
                if (check)
                {
                    HPCBusinessLogic.DAL.T_NewsDAL _Obj = new HPCBusinessLogic.DAL.T_NewsDAL();
                    if (tien > 0)
                    {
                        _Obj.Update_TiennhanbutTin(int.Parse(lbl_loaiID.Text), int.Parse(lbl_NewsID.Text), 0, tien, _user.UserID);
                    }
                    else
                    {
                        _Obj.Update_TiennhanbutTin(int.Parse(lbl_loaiID.Text), int.Parse(lbl_NewsID.Text), 0, 0, 0);
                    }
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, lbl_title.Text,
                                                                   Request["Menu_ID"].ToString(), "Chấm nhận bút tin ", int.Parse(lbl_NewsID.Text), type);
                }
            }
            if (checkall)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", " alert('Chấm nhận bút thành công') ;", true);
            }
            else
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", " alert('Hệ số nhận bút và tiền phải là kiểu số') ;", true);
            }
        }
Example #19
0
        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 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);
        }
Example #21
0
 protected void LinkCancel_Click(object sender, EventArgs e)
 {
     foreach (DataGridItem m_Item in grdListCate.Items)
     {
         CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect");
         if (chk_Select != null && chk_Select.Checked)
         {
             int ID = int.Parse(grdListCate.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString());
             HPCBusinessLogic.DAL.T_Album_PhotoDAL tt = new HPCBusinessLogic.DAL.T_Album_PhotoDAL();
             tt.DeleteFrom_T_Album_Photo(ID);
             WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "Xóa", Request["Menu_ID"].ToString(), "[Xóa] [Thao tác Xóa ảnh của Phóng sự ảnh]", 0, ConstAction.GocAnh);
         }
     }
     LoadData(cat_id);
 }
        private double Insert(Boolean _send)
        {
            T_News obj;

            HPCBusinessLogic.DAL.T_NewsDAL tt_DAL = new HPCBusinessLogic.DAL.T_NewsDAL();
            if (_send)
            {
                obj = SetItem(ConstNews.NewsApproving_tbt);
            }
            else
            {
                obj = SetItem(ConstNews.NewsReturn_tk);
            }
            if (obj.News_ID > 0)
            {
                obj.News_ID = tt_DAL.InsertT_news(obj);
                UltilFunc.Insert_News_Image(this.txt_noidung.Text.Trim(), obj.News_ID);
                if (_send)
                {
                    obj.News_Status = ConstNews.NewsApproving_tbt;
                    SendPub(double.Parse(obj.News_ID.ToString()), ConstNews.NewsApproving_tbt);
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, obj.News_Tittle,
                                                                   Request["Menu_ID"].ToString(), "[Duyệt tin bài] [Tin bài chờ xuất bản] [Thao tác xuất bản]", obj.News_ID, ConstAction.BaoDT);
                }
                else
                {
                    if (obj.Lang_ID == 1)
                    {
                        obj.News_Status = ConstNews.NewsReturn_tk;
                        SendPub(double.Parse(obj.News_ID.ToString()), ConstNews.NewsReturn_tk);
                        WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, obj.News_Tittle,
                                                                       Request["Menu_ID"].ToString(), "[Duyệt tin bài] [Tin bài đang chờ xuất bản] [Trả lại Trình bày tin bài]", obj.News_ID, ConstAction.BaoDT);
                    }
                    else
                    {
                        obj.News_Status = ConstNews.NewsReturn_tb;
                        SendPub(double.Parse(obj.News_ID.ToString()), ConstNews.NewsReturn_tb);
                        WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, obj.News_Tittle,
                                                                       Request["Menu_ID"].ToString(), "[Duyệt tin bài] [Tin bài đang chờ xuất bản] [Trả lại Biên tập tin bài]", obj.News_ID, ConstAction.BaoDT);
                    }
                }
                return(double.Parse(obj.News_ID.ToString()));
            }
            else
            {
                return(0);
            }
        }
 protected void LinkCancel_Click(object sender, EventArgs e)
 {
     foreach (DataGridItem m_Item in grdListCate.Items)
     {
         CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect");
         if (chk_Select != null && chk_Select.Checked)
         {
             int ID = int.Parse(grdListCate.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString());
             T_Photo_EventDAL _DAL = new T_Photo_EventDAL();
             T_Photo_Event    _obj = new T_Photo_Event();
             _obj = _DAL.GetOneFromT_Photo_EventsByID(ID);
             _DAL.DeleteFromT_Photo_Event(ID);
             string _ActionsCode = "[Thời sự qua ảnh] " + menuName + " [Xóa Ảnh] [Ảnh: " + _obj.Photo_Name + "]";
             WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Xóa ảnh]", Convert.ToInt32(Request["Menu_ID"]), _ActionsCode, ID, ConstAction.TSAnh);
         }
     }
     LoadData(status);
 }
        protected void linkSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                string TabID = "0";
                if (Request["TabID"] != null)
                {
                    TabID = Request["TabID"].ToString();
                }
                string               strAction = "";
                T_MultimediaDAL      _untilDAL = new T_MultimediaDAL();
                HPCInfo.T_Multimedia obj       = null;
                if (TabID == "0")
                {
                    obj = SetItem(1);
                }
                else if (TabID == "1")
                {
                    obj = SetItem(21);
                }

                if (obj.ID == 0)
                {
                    strAction = "THÊM MỚI";
                }
                else
                {
                    strAction = "SỬA ĐỔI THÔNG TIN";
                }
                int _return = _untilDAL.InsertT_Multimedia(obj);

                if (obj.URL_Images.Length > 2)
                {
                    this.ImgTemp.Src = obj.URL_Images;
                }
                else
                {
                    this.ImgTemp.Attributes.CssStyle.Add("display", "none");
                }

                WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, obj.Tittle, Request["Menu_ID"].ToString(), strAction, _return, ConstAction.AmThanhHinhAnh);
                Page.Response.Redirect("~/Multimedia/List_Multimedia.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&TabID=" + TabID);
            }
        }
 protected void linkTralai_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(2);
         int _return = _untilDAL.InsertT_Multimedia(obj);
         WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, obj.Tittle, Request["Menu_ID"], "MEDIA ĐÃ DUYỆT HỦY ĐĂNG", _return, ConstAction.AmThanhHinhAnh);
         Page.Response.Redirect("~/Multimedia/Multimedia_Published.aspx?Menu_ID=" + Request["Menu_ID"].ToString());
     }
 }
 protected void linkTralai_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('Tiền nhận bút phải là số nguyên !');", true); return; }
         }
         T_MultimediaDAL      _untilDAL = new T_MultimediaDAL();
         HPCInfo.T_Multimedia obj       = SetItem(21);
         int _return = _untilDAL.InsertT_Multimedia(obj);
         WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, obj.Tittle, Request["Menu_ID"].ToString(), "CHỜ DUYỆT TRẢ LẠI", _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);
     }
 }
Example #28
0
 protected void linkSave_Click(object sender, EventArgs e)
 {
     //if (!Page.IsValid) return;
     HPCBusinessLogic.T_Photo_EventDAL _untilDAL = new HPCBusinessLogic.T_Photo_EventDAL();
     HPCInfo.T_Photo_Event             _Obj      = GetObject();
     if (_Obj.Photo_ID == 0)
     {
         int    _return      = _untilDAL.InsertT_Photo_Events(_Obj);
         string _ActionsCode = "[Thời sự qua ảnh] [Thêm mới ảnh] [Ảnh: " + _untilDAL.GetOneFromT_Photo_EventsByID(Convert.ToDouble(_return.ToString())).Photo_Name + "]";
         WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Thêm mới]", Convert.ToInt32(Request["Menu_ID"]), _ActionsCode, _return, ConstAction.TSAnh);
         System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("VALIDATE_ADDNEWS") + "');", true);
     }
     else
     {
         int    _return      = _untilDAL.InsertT_Photo_Events(_Obj);
         string _ActionsCode = "[Thời sự qua ảnh] [Cập nhật ảnh] [Ảnh: " + _Obj.Photo_Name + "]";
         WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Cập nhật]", Convert.ToInt32(Request["Menu_ID"]), _ActionsCode, _return, ConstAction.TSAnh);
         System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("VALIDATE_ADDNEWS") + "');", true);
     }
     if (Page.Request["Tab"].ToString() != "-1")
     {
         if (Page.Request["Menu_ID"] != null)
         {
             Page.Response.Redirect("~/Anh24h/List_PhotosDexuat.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_PhotosDexuat.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString());
         }
         else
         {
             return;
         }
     }
 }
        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 lbt_tabtralai_gui_Click(object sender, EventArgs e)
        {
            T_MultimediaDAL _untilDAL = new T_MultimediaDAL();

            foreach (DataGridItem item in DataGrid_Tralai.Items)
            {
                CheckBox check = (CheckBox)item.FindControl("optSelect");
                if (check.Checked)
                {
                    try
                    {
                        int _ID = Convert.ToInt32(this.DataGrid_Tralai.DataKeys[item.ItemIndex].ToString());
                        _untilDAL.UpdateStatusMultimedia(_ID, 2, _user.UserID);
                        WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "Xóa", Request["Menu_ID"].ToString(), "GỬI DUYỆT MULTIMEDIA BỊ TRẢ LẠI", _ID, ConstAction.AmThanhHinhAnh);
                    }
                    catch (Exception ex) { }
                }
            }
            Load_Tralai();
        }