Exemplo n.º 1
0
        protected void linkExit_Click(object sender, EventArgs e)
        {
            HPCBusinessLogic.DAL.T_NewsDAL _DAL = new HPCBusinessLogic.DAL.T_NewsDAL();
            double ChildID = 0;

            double.TryParse(Request["ID"] == null ? "0" : Request["ID"], out ChildID);
            _DAL.IsLock(double.Parse(ChildID.ToString()), 0, 0);
            int tab = 0;

            if (Page.Request["Tab"] != null && Page.Request["Tab"].ToString() != "-1")
            {
                tab = Convert.ToInt32(Page.Request["Tab"].ToString());
                if (tab == 10)
                {
                    Response.Redirect("PublishedList.aspx?Menu_ID=" + Request["Menu_ID"].ToString());
                }
                else
                {
                    Response.Redirect("PublishedList.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&Tab=" + Page.Request["Tab"].ToString());
                }
            }
            else
            {
                Response.Redirect("PublishedList.aspx?Menu_ID=" + Request["Menu_ID"].ToString());
            }
        }
Exemplo n.º 2
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()));
        }
Exemplo n.º 3
0
        public void Search()
        {
            string NewsID = "0";

            try { NewsID = Page.Request.QueryString["ID"].ToString(); }
            catch {; }
            if (NewsID != "0")
            {
                HPCBusinessLogic.DAL.T_NewsDAL obj = new HPCBusinessLogic.DAL.T_NewsDAL();
                DataSet ds = obj.GetHistory(int.Parse(NewsID));
                LoadDetails(int.Parse(NewsID), false, false, 0, false);
                if (ds != null)
                {
                    try
                    {
                        dgr_tintuc1.DataSource = ds.Tables[0];
                        dgr_tintuc1.DataBind();
                    }
                    catch
                    {
                        dgr_tintuc1.DataSource = null;
                        dgr_tintuc1.DataBind();
                    }
                }
            }
            else
            {
                dgr_tintuc1.DataSource = null;
                dgr_tintuc1.DataBind();
            }
        }
Exemplo n.º 4
0
        protected void dgListNewsUnPublish_EditCommand(object source, DataGridCommandEventArgs e)
        {
            switch (e.CommandArgument.ToString().ToLower())
            {
            case "downloadalias":
                LoadFileDoc(Convert.ToInt32(this.dgr_tintuc1.DataKeys[e.Item.ItemIndex].ToString()));
                break;

            case "edit":
            {
                HPCBusinessLogic.DAL.T_NewsDAL Dal = new HPCBusinessLogic.DAL.T_NewsDAL();
                string _ID = this.dgListNewsUnPublish.DataKeys[e.Item.ItemIndex].ToString();
                Dal.IsLock(double.Parse(_ID), 1);
                Response.Redirect("PublishedEdit.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&ID=" + _ID.ToString() + "&Tab=1");
            }
            break;

            case "copycm":
            {
                ddlLang.Items.Clear();
                UltilFunc.BindCombox(this.ddlLang, "Ma_AnPham", "Ten_AnPham", "T_AnPham", " 1=1 ", CommonLib.ReadXML("lblTatca"));
                if (this.ddlLang.Items.Count == 2)
                {
                    this.ddlLang.SelectedIndex = 1;
                }
                else
                {
                    this.ddlLang.SelectedIndex = UltilFunc.GetIndexControl(this.ddlLang, HPCComponents.Global.DefaultCombobox);
                }
                ModalPopupExtender1.Show();
            }
            break;
            }
        }
Exemplo n.º 5
0
        protected void linkExit_Click(object sender, EventArgs e)
        {
            HPCBusinessLogic.DAL.T_NewsDAL _untilDal = new HPCBusinessLogic.DAL.T_NewsDAL();
            double ChildID = 0;

            double.TryParse(Request["ID"] == null ? "0" : Request["ID"], out ChildID);
            if (Request["Tab"] != null && Request["Tab"].ToString() != "" && Request["Tab"].ToString() != String.Empty)
            {
                if (Request["Tab"].ToString() != "3")
                {
                    _untilDal.IsLock(double.Parse(ChildID.ToString()), 0, 0);
                }
                if (Request["Tab"].ToString() != "-1")
                {
                    Response.Redirect("ArticleList.aspx?Menu_ID=" + Request["Menu_ID"] + "&Tab=" + Request["Tab"]);
                }
                else
                {
                    Response.Redirect("ArticleList.aspx?Menu_ID=" + Request["Menu_ID"]);
                }
            }
            else
            {
                Response.Redirect("ArticleList.aspx?Menu_ID=" + Request["Menu_ID"]);
            }
        }
Exemplo n.º 6
0
 //insert keyword
 private void InsertKeyword(double News_ID, int User_ID)
 {
     if (txtTukhoa.Text.Length > 0)
     {
         HPCBusinessLogic.DAL.T_NewsDAL tt_DAL = new HPCBusinessLogic.DAL.T_NewsDAL();
         tt_DAL.InsertT_Keywords(txtTukhoa.Text, News_ID, User_ID);
     }
 }
        private void SendPub(double id, int _status)
        {
            T_News obj_T_News = new T_News();

            HPCBusinessLogic.DAL.T_NewsDAL tt = new HPCBusinessLogic.DAL.T_NewsDAL();
            tt.Update_Status_tintuc(double.Parse(id.ToString()), _status, _user.UserID, DateTime.Now);
            tt.Insert_Version_From_T_News_WithUserModify(double.Parse(id.ToString()), ConstNews.NewsAppro_tk, _status, _user.UserID);
        }
Exemplo n.º 8
0
        protected void dgr_tintuc1_EditCommand(object source, DataGridCommandEventArgs e)
        {
            HPCBusinessLogic.DAL.T_NewsDAL tt = new HPCBusinessLogic.DAL.T_NewsDAL();
            T_News _obj_T_News = new T_News();

            switch (e.CommandArgument.ToString().ToLower())
            {
            case "downloadalias":
                LoadFileDoc(Convert.ToInt32(this.dgr_tintuc1.DataKeys[e.Item.ItemIndex].ToString()));
                break;

            case "edit":
            {
                string _ID = dgr_tintuc1.DataKeys[e.Item.ItemIndex].ToString();
                _obj_T_News = tt.load_T_news(Convert.ToInt32(_ID));
                if (_obj_T_News.News_Lock)
                {
                    if (_obj_T_News.News_EditorID == _user.UserID)
                    {
                        //Lock
                        tt.IsLock(Convert.ToInt32(_ID), 1, _user.UserID);
                        Response.Redirect("PublishedEdit.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&ID=" + _ID.ToString() + "&Tab=0");
                    }
                    else
                    {
                        System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('Bài đang có người làm việc!.');", true);
                        return;
                    }
                }
                else
                {
                    //Lock
                    tt.IsLock(Convert.ToInt32(_ID), 1, _user.UserID);
                    Response.Redirect("PublishedEdit.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&ID=" + _ID.ToString() + "&Tab=0");
                }
            }
            break;

            case "copycm":
            {
                ddlLang.Items.Clear();
                UltilFunc.BindCombox(this.ddlLang, "Ma_AnPham", "Ten_AnPham", "T_AnPham", " 1=1 ", CommonLib.ReadXML("lblTatca"));
                if (this.ddlLang.Items.Count >= 3)
                {
                    this.ddlLang.SelectedIndex = HPCComponents.Global.DefaultLangID;
                }
                else
                {
                    this.ddlLang.SelectedIndex = UltilFunc.GetIndexControl(this.ddlLang, HPCComponents.Global.DefaultCombobox);
                }
                NewsID = Convert.ToDouble(this.dgr_tintuc1.DataKeys[e.Item.ItemIndex].ToString());
                LoadCM();
                ModalPopupExtender1.Show();
            }
            break;
            }
        }
Exemplo n.º 9
0
        public void LoadFileDoc(int _ID)
        {
            string strHTML = "";

            HPCBusinessLogic.DAL.T_NewsDAL dal = new HPCBusinessLogic.DAL.T_NewsDAL();
            T_News obj = dal.load_T_news(_ID);

            strHTML += "<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b>" + obj.News_Tittle + "<o:p></o:p></b></p>";
            strHTML += "<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><br>" + obj.News_Summary + "<u1:p></u1:p></b></p>";
            strHTML += "<p style='text-align:justify'>" + obj.News_Body + "<o:p></o:p></p>";
            if (strHTML.Length > 0)
            {
                SaveAsText(strHTML);
            }
        }
Exemplo n.º 10
0
        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);
            }
        }
        private void SendPub(double id, int _status)
        {
            T_News obj_T_News = new T_News();

            HPCBusinessLogic.DAL.T_NewsDAL tt = new HPCBusinessLogic.DAL.T_NewsDAL();
            if (_status == ConstNews.NewsApproving_tbt)
            {
                tt.Update_Status_tintuc(double.Parse(id.ToString()), _status, _user.UserID, DateTime.Now);
            }
            else
            {
                //Hungviet add
                tt.UpdateStatus_T_News_ex_New_HV(double.Parse(id.ToString()), _status, 0, DateTime.Now);
            }
            tt.Insert_Version_From_T_News_WithUserModify(double.Parse(id.ToString()), ConstNews.NewsAppro_tb, _status, _user.UserID);
        }
        //end

        #endregion

        #region Event click
        protected void btnLayout_Click(object sender, EventArgs e)
        {
            int ChildID = Convert.ToInt32(Request["ID"]);

            HPCBusinessLogic.DAL.T_NewsDAL tt = new HPCBusinessLogic.DAL.T_NewsDAL();
            T_News _objNewsCurr  = new T_NewsDAL().load_T_news(ChildID);
            int    Get_T_News_ID = int.Parse(_objNewsCurr.News_CopyFrom.ToString());
            T_News _objNews      = new T_News();

            if (tt.Get_NewsVersion(Get_T_News_ID, 7, 92) || tt.Get_NewsVersion(Get_T_News_ID, 7, 82))
            {
                _objNews              = tt.load_T_news(Get_T_News_ID);
                this.txt_tomtat.Text  = txt_tomtat.Text + "<br />" + _objNews.News_Summary;
                this.txt_noidung.Text = txt_noidung.Text + "<br />" + _objNews.News_Body;
            }
        }
Exemplo n.º 13
0
        protected void LinkBack_Click(object sender, EventArgs e)
        {
            //dung them vao de kiem tra dieu dau vao và để busybox khong bi dung trong IE
            if (Txt_tieude.Text.Length <= 0)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
                return;
            }
            //if (cbo_lanquage.SelectedIndex == 0)
            //{
            //    System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
            //    return;
            //}

            if (cbo_chuyenmuc.SelectedIndex == 0)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
                return;
            }
            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;
                }
            }
            //------------------
            int ChildID = 0;

            int.TryParse(Request["ID"] == null ? "0" : Request["ID"], out ChildID);
            UltilFunc.Insert_News_Image(txt_noidung.Text.Trim(), Convert.ToDouble(Page.Request["id"]));
            Insert(false);
            HPCBusinessLogic.DAL.T_NewsDAL Dal = new HPCBusinessLogic.DAL.T_NewsDAL();
            Dal.IsLock(double.Parse(ChildID.ToString()), 0, 0);
            if (Page.Request["Tab"].ToString() != "-1")
            {
                Response.Redirect("PublishingList.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&Tab=" + Page.Request["Tab"].ToString());
            }
            else
            {
                Response.Redirect("PublishingList.aspx?Menu_ID=" + Request["Menu_ID"].ToString());
            }
        }
Exemplo n.º 14
0
        protected void LinkSend_Click(object sender, EventArgs e)
        {
            if (Txt_tieude.Text.Length <= 0)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
                return;
            }
            if (cbo_lanquage.SelectedIndex == 0)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
                return;
            }
            if (cbo_chuyenmuc.SelectedIndex == 0)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
                return;
            }
            //if (!string.IsNullOrEmpty(txtTienNhuanBut.Text))
            //{
            //    try { int.Parse(txtTienNhuanBut.Text.Replace(",", "")); }
            //    catch
            //    {
            //        System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('Tiền nhận bút phải là kiểu số nguyên!');", true);
            //        return;
            //    }
            //}
            if (Page.IsValid)
            {
                double news_id = 0;
                news_id = Insert(true);
                if (Page.Request["id"] == null || string.IsNullOrEmpty(Page.Request["id"]))
                {
                    UltilFunc.Insert_News_Image(txt_noidung.Text.Trim(), news_id);
                }
                else
                {
                    UltilFunc.Insert_News_Image(txt_noidung.Text.Trim(), Convert.ToDouble(Page.Request["id"]));
                }
                HPCBusinessLogic.DAL.T_NewsDAL Dal = new HPCBusinessLogic.DAL.T_NewsDAL();

                linkExit_Click(sender, e);
            }
        }
        protected void btnGuiDuyet_Click(object sender, EventArgs e)
        {
            if (Txt_tieude.Text.Length <= 0)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
                return;
            }
            if (cbo_lanquage.SelectedIndex == 0)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
                return;
            }

            if (cbo_chuyenmuc.SelectedIndex == 0)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
                return;
            }
            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;
                }
            }
            double ChildID = 0;

            double.TryParse(Request["ID"] == null ? "0" : Request["ID"], out ChildID);
            UltilFunc.Insert_News_Image(txt_noidung.Text.Trim(), Convert.ToDouble(Page.Request["id"]));
            Insert(true);
            HPCBusinessLogic.DAL.T_NewsDAL Dal = new HPCBusinessLogic.DAL.T_NewsDAL();
            Dal.IsLock(double.Parse(ChildID.ToString()), 0, 0);
            if (Page.Request["Tab"].ToString() != "-1")
            {
                Response.Redirect("ArticleApproveListTB.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&Tab=" + Page.Request["Tab"].ToString());
            }
            else
            {
                Response.Redirect("ArticleApproveListTB.aspx?Menu_ID=" + Request["Menu_ID"].ToString());
            }
        }
Exemplo n.º 16
0
        protected void dgData_EditCommand(object source, DataGridCommandEventArgs e)
        {
            ActionHistoryDAL actionDAL = new ActionHistoryDAL();
            T_ActionHistory  action    = new T_ActionHistory();

            HPCBusinessLogic.DAL.T_NewsDAL tt = new HPCBusinessLogic.DAL.T_NewsDAL();
            T_News        _obj_T_News         = new T_News();
            T_NewsVersion _obj_T_NewsVecion   = new T_NewsVersion();

            action.UserID     = _user.UserID;
            action.FullName   = _user.UserName;
            action.HostIP     = IpAddress();
            action.DateModify = DateTime.Now;
            if (e.CommandArgument.ToString().ToLower() == "edit")
            {
                int _ID = Convert.ToInt32(this.dgr_tintuc1.DataKeys[e.Item.ItemIndex].ToString());
                LoadDetails(_ID, true, true, e.Item.ItemIndex, true);
                lbl_index.Text = e.Item.ItemIndex.ToString();
            }
        }
Exemplo n.º 17
0
        private void PublisherNews(DataGrid dgr)
        {
            foreach (DataGridItem m_Item in dgr.Items)
            {
                CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect");
                HPCBusinessLogic.DAL.T_NewsDAL tt = new HPCBusinessLogic.DAL.T_NewsDAL();
                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());
                    tt.IsLock(News_ID, 0);
                    tt.UpdateStatus_T_News_ex_New_HV(News_ID, ConstNews.NewsPublishing, _user.UserID, DateTime.Now);
                    tt.Insert_Version_From_T_News_WithUserModify(News_ID, ConstNews.NewsUnPublishing, ConstNews.NewsPublishing, _user.UserID);
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, linkname.Text,
                                                                   Request["Menu_ID"].ToString(), "[Xuất bản] [Danh sách tin bài hủy đăng] [Đăng bài]", News_ID, ConstAction.BaoDT);
                    #region Sync
                    HPCBusinessLogic.DAL.T_NewsDAL _untilDAL = new HPCBusinessLogic.DAL.T_NewsDAL();
                    HPCInfo.T_News _obj = new HPCInfo.T_News();
                    _obj = _untilDAL.GetOneFromT_NewsByID(News_ID);
                    // DONG BO FILE
                    SynFiles _syncfile = new SynFiles();
                    if (_obj.Images_Summary.Length > 0)
                    {
                        _syncfile.SynData_UploadImgOne(_obj.Images_Summary, Global.ImagesService);
                    }

                    //Cap nhat anh trong bai viet - vao may dong bo
                    if (_obj.News_Body.Length > 5)
                    {
                        _syncfile.SearchImgTag(_obj.News_Body);
                        _syncfile.SearchTagSwf(_obj.News_Body);
                        _syncfile.SearchTagFLV(_obj.News_Body);
                    }
                    //END
                    #endregion
                }
            }
            //Tao cache
            //UltilFunc.GenCacheHTML();
            this.LoadData_UnPublisher();
        }
Exemplo n.º 18
0
 protected void dgCategorysCopy_EditCommand(object source, DataGridCommandEventArgs e)
 {
     if (e.CommandArgument.ToString().ToLower() == "editcopy")
     {
         HPCBusinessLogic.DAL.T_NewsDAL _NewsDAL = new HPCBusinessLogic.DAL.T_NewsDAL();
         HPCBusinessLogic.ChuyenmucDAL  _catDAL  = new ChuyenmucDAL();
         DataGridItem m_Item      = e.Item;
         int          CatalogID   = int.Parse(dgCategorysCopy.DataKeys[m_Item.ItemIndex].ToString());
         double       _IDNewsCopy = _NewsDAL.Copy_To_Categorys(NewsID, CatalogID, 6, DateTime.Now, _user.UserID, _user.UserID, _user.UserName);
         if (_IDNewsCopy > 0)
         {
             WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Copy]", Request["Menu_ID"], "[Copy] [Bài đã xuất bản]: [Tin bài đã xuất bản] [Thao tác copy bài vào chuyên mục: " + _catDAL.GetOneFromT_ChuyenmucByID(CatalogID).Ten_ChuyenMuc + "]", _IDNewsCopy, ConstAction.BaoDT);
         }
         CheckBox    checkcopy = (CheckBox)m_Item.FindControl("optSelect");
         ImageButton btnCopy   = (ImageButton)m_Item.FindControl("btnCopy");
         btnCopy.Visible   = false;
         checkcopy.Visible = false;
         checkcopy.Enabled = false;
         this.LoadData_DangXuly();
     }
 }
Exemplo n.º 19
0
 private void NgungDang(DataGrid dgr)
 {
     foreach (DataGridItem m_Item in dgr.Items)
     {
         CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect");
         HPCBusinessLogic.DAL.T_NewsDAL tt = new HPCBusinessLogic.DAL.T_NewsDAL();
         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());
             tt.IsLock(News_ID, 0);
             tt.UpdateStatus_T_News_ex_New_HV(News_ID, ConstNews.NewsUnPublishing, _user.UserID, DateTime.Now);
             tt.Insert_Version_From_T_News_WithUserModify(News_ID, ConstNews.NewsPublishing, ConstNews.NewsUnPublishing, _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 đang đăng] [Hủy đăng]", News_ID, ConstAction.BaoDT);
         }
     }
     //Tao cache
     //UltilFunc.GenCacheHTML();
     this.LoadData_DangXuly();
 }
Exemplo n.º 20
0
        private void DelRecordsCheckedBox()
        {
            HPCBusinessLogic.DAL.T_NewsDAL tt = new HPCBusinessLogic.DAL.T_NewsDAL();
            T_News _obj_T_News = new T_News();

            if (TabContainer1.ActiveTabIndex == 1)
            {
                foreach (DataGridItem m_Item in dgListNewsUnPublish.Items)
                {
                    CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect");
                    if (chk_Select != null && chk_Select.Checked)
                    {
                        _obj_T_News = tt.load_T_news(Convert.ToInt32(dgListNewsUnPublish.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString()));
                        if (_obj_T_News.News_Lock)
                        {
                            if (_obj_T_News.News_EditorID == _user.UserID)
                            {
                                double News_ID = double.Parse(dgListNewsUnPublish.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString());
                                tt.Update_Status_tintuc(News_ID, 55, _user.UserID, DateTime.Now);
                                WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, _obj_T_News.News_Tittle,
                                                                               Request["Menu_ID"].ToString(), "[Bài đang xuất bản] [Danh sách tin bài ngừng đăng] [Xóa bài]", _obj_T_News.News_ID, ConstAction.BaoDT);
                            }
                            else
                            {
                                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('Bài đang có người làm việc!');", true);
                                return;
                            }
                        }
                        else
                        {
                            double News_ID = double.Parse(dgListNewsUnPublish.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString());
                            tt.Update_Status_tintuc(News_ID, 55, _user.UserID, DateTime.Now);
                            WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, _obj_T_News.News_Tittle,
                                                                           Request["Menu_ID"].ToString(), "[Bài đang xuất bản] [Danh sách tin bài ngừng đăng] [Xóa bài]", _obj_T_News.News_ID, ConstAction.BaoDT);
                        }
                    }
                }
            }
            this.LoadData_UnPublisher();
        }
Exemplo n.º 21
0
        protected void LoadData_UnPublisher()
        {
            string sOrder = " Order by News_DateSend DESC ";

            PagerUnPublish.PageSize = Global.MembersPerPage;
            HPCBusinessLogic.DAL.T_NewsDAL _T_newsDAL = new HPCBusinessLogic.DAL.T_NewsDAL();
            string tieude = txt_tieude.Text.Trim();

            Session["searchvalueroot"] = null;
            if (tieude != "")
            {
                Session["searchvalueroot"] = UltilFunc.SplitString(tieude);
            }
            DataSet _ds;

            _ds = _T_newsDAL.BindGridT_NewsDynamic(PagerUnPublish.PageIndex, PagerUnPublish.PageSize, BuildSQL(ConstNews.NewsUnPublishing, sOrder), UltilFunc.ReplaceAll(UltilFunc.SplitString(tieude), "'", "’"));

            int TotalRecords = Convert.ToInt32(_ds.Tables[1].Rows[0].ItemArray[0].ToString());
            int TotalRecord  = Convert.ToInt32(_ds.Tables[0].Rows.Count);

            if (TotalRecord == 0)
            {
                for (int i = 1; i <= TotalRecords; i++)
                {
                    _ds = _T_newsDAL.BindGridT_NewsDynamic(PagerUnPublish.PageIndex - i, PagerUnPublish.PageSize, BuildSQL(ConstNews.NewsUnPublishing, sOrder), UltilFunc.ReplaceAll(UltilFunc.SplitString(tieude), "'", "’"));
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        break;
                    }
                }
            }
            this.dgListNewsUnPublish.DataSource = _ds;
            this.dgListNewsUnPublish.DataBind();
            this.PagerUnPublish.TotalRecords     = this.CurrentPageUnPublish.TotalRecords = TotalRecords;
            this.CurrentPageUnPublish.TotalPages = this.PagerUnPublish.CalculateTotalPages();
            this.CurrentPageUnPublish.PageIndex  = this.PagerUnPublish.PageIndex;

            GetTotal();
            _ds.Clear();
        }
Exemplo n.º 22
0
        private void LoadData_DangXuly()
        {
            string sOrder = GetOrderString() == "" ? "" : " ORDER BY " + GetOrderString();

            pages.PageSize = Global.MembersPerPage;
            HPCBusinessLogic.DAL.T_NewsDAL _T_newsDAL = new HPCBusinessLogic.DAL.T_NewsDAL();
            string tieude = txt_tieude.Text.Trim();

            Session["searchvalueroot"] = null;
            if (tieude != "")
            {
                Session["searchvalueroot"] = UltilFunc.SplitString(tieude);
            }
            DataSet _ds;

            _ds = _T_newsDAL.BindGridT_NewsDynamic(pages.PageIndex, pages.PageSize, BuildSQL(6, sOrder), UltilFunc.ReplaceAll(UltilFunc.SplitString(tieude), "'", "’"));
            int TotalRecords = Convert.ToInt32(_ds.Tables[1].Rows[0].ItemArray[0].ToString());
            int TotalRecord  = Convert.ToInt32(_ds.Tables[0].Rows.Count);

            if (TotalRecord == 0)
            {
                for (int i = 1; i <= TotalRecords; i++)
                {
                    _ds = _T_newsDAL.BindGridT_NewsDynamic(pages.PageIndex - i, pages.PageSize, BuildSQL(6, sOrder), UltilFunc.ReplaceAll(UltilFunc.SplitString(tieude), "'", "’"));
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        break;
                    }
                }
            }
            dgr_tintuc1.DataSource = _ds;
            dgr_tintuc1.DataBind();
            pages.TotalRecords      = CurrentPage2.TotalRecords = TotalRecords;
            CurrentPage2.TotalPages = pages.CalculateTotalPages();
            CurrentPage2.PageIndex  = pages.PageIndex;

            GetTotal();
            _ds.Clear();
        }
Exemplo n.º 23
0
        public static string GetNews_IDFrom_NewsID_Version(int News_ID, int intFieldIndex)
        {
            string    str     = "";
            T_NewsDAL dalnews = new T_NewsDAL();

            try
            {
                DataSet   ds = HPCDataProvider.Instance().GetStoreDataSet("[CMS_getSenderIDFrom_NewsID]", new string[] { "@News_ID" }, new object[] { News_ID });
                DataTable dt = ds.Tables[0];
                if (dt.Rows.Count > 0)
                {
                    if (intFieldIndex == 0)
                    {
                        str = UltilFunc.GetUserName(int.Parse(dt.Rows[0]["News_EditorID"].ToString()));
                    }
                    else
                    {
                        str = Convert.ToDateTime(dt.Rows[0]["News_DateEdit"]).ToString("dd/MM/yyyy HH:mm");
                    }
                }
                else
                {
                    if (intFieldIndex == 0)
                    {
                        int EditorID = dalnews.load_T_news(News_ID).News_EditorID;
                        str = UltilFunc.GetUserName(EditorID);
                    }
                    else
                    {
                        str = Convert.ToDateTime(dalnews.load_T_news(News_ID).News_DateEdit).ToString("dd/MM/yyyy HH:mm");
                    }
                }
                return(str);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 24
0
 protected void LinkButton_updateTT_Click(object sender, EventArgs e)
 {
     foreach (DataGridItem m_Item in dgr_tintuc1.Items)
     {
         TextBox txt_thutu = (TextBox)m_Item.FindControl("txt_thutu");
         Label   lbl_thutu = (Label)m_Item.FindControl("lbl_thutu");
         double  _ID       = Convert.ToInt32(dgr_tintuc1.DataKeys[m_Item.ItemIndex].ToString());
         if (txt_thutu.Text != lbl_thutu.Text)
         {
             int vitri = 0;
             try
             {
                 vitri = int.Parse(txt_thutu.Text);
             }
             catch { vitri = 0; }
             Label lbl_News_ID = (Label)m_Item.FindControl("lbl_News_ID");
             HPCBusinessLogic.DAL.T_NewsDAL tt = new HPCBusinessLogic.DAL.T_NewsDAL();
             tt.Update_Thutu_Noibat(double.Parse(lbl_News_ID.Text), vitri);
         }
     }
     System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('Cập nhật thành công !');", true);
     LoadData_DangXuly();
 }
Exemplo n.º 25
0
 protected void but_XB_Click(object sender, EventArgs e)
 {
     HPCBusinessLogic.DAL.T_NewsDAL _NewsDAL = new HPCBusinessLogic.DAL.T_NewsDAL();
     HPCBusinessLogic.ChuyenmucDAL  _catDAL  = new ChuyenmucDAL();
     foreach (DataGridItem m_Item in dgCategorysCopy.Items)
     {
         CheckBox checkcopy = (CheckBox)m_Item.FindControl("optSelect");
         if (checkcopy != null && checkcopy.Checked && checkcopy.Enabled)
         {
             int    CatalogID   = int.Parse(dgCategorysCopy.DataKeys[m_Item.ItemIndex].ToString());
             double _IDNewsCopy = _NewsDAL.Copy_To_Categorys(NewsID, CatalogID, 6, DateTime.Now, _user.UserID, _user.UserID, _user.UserName);
             if (_IDNewsCopy > 0)
             {
                 WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Copy]", Request["Menu_ID"], "[Copy] [Bài đã xuất bản]: [Tin bài đã xuất bản] [Thao tác copy bài vào chuyên mục: " + _catDAL.GetOneFromT_ChuyenmucByID(CatalogID).Ten_ChuyenMuc + "]", _IDNewsCopy, ConstAction.TSAnh);
             }
         }
     }
     ModalPopupExtender1.Hide();
     this.LoadData_DangXuly();
     //Tao cache
     //UltilFunc.GenCacheHTML();
     System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('Xuất bản ra chuyên mục khác thành công !');", true);
 }
Exemplo n.º 26
0
        private void Gui_Duyet()
        {
            ArrayList ar = new ArrayList();

            HPCBusinessLogic.DAL.T_IdieaDAL _T_IdieaDAL = new HPCBusinessLogic.DAL.T_IdieaDAL();
            string sOrder = GetOrderString() == "" ? "" : " ORDER BY " + GetOrderString();

            if (TabContainer1.ActiveTabIndex == 0)
            {
                foreach (DataGridItem m_Item in dgr_tintuc1.Items)
                {
                    CheckBox chk_select = (CheckBox)m_Item.FindControl("optSelect");
                    if (chk_select != null && chk_select.Checked)
                    {
                        ar.Add(double.Parse(dgr_tintuc1.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString()));
                    }
                }
            }
            if (TabContainer1.ActiveTabIndex == 1)
            {
                foreach (DataGridItem m_Item in dgr_tintuc2.Items)
                {
                    CheckBox chk_select = (CheckBox)m_Item.FindControl("optSelect");
                    if (chk_select != null && chk_select.Checked)
                    {
                        ar.Add(double.Parse(dgr_tintuc2.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString()));
                    }
                }
            }
            if (TabContainer1.ActiveTabIndex == 2)
            {
                foreach (DataGridItem m_Item in dgDXL.Items)
                {
                    CheckBox chk_select = (CheckBox)m_Item.FindControl("optSelect");
                    if (chk_select != null && chk_select.Checked)
                    {
                        ar.Add(double.Parse(dgDXL.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString()));
                    }
                }
            }

            for (int i = 0; i < ar.Count; i++)
            {
                double  Diea_ID   = double.Parse(ar[i].ToString());
                T_Idiea obj_Idiea = new T_Idiea();
                obj_Idiea = _T_IdieaDAL.GetOneFromT_IdieaByID(int.Parse(Diea_ID.ToString()));
                if (obj_Idiea.Diea_Lock == true && obj_Idiea.User_Edit != _user.UserID)
                {
                    FuncAlert.AlertJS(this, "Bài đang có người làm việc.!");
                    return;
                }

                _T_IdieaDAL.IsLock(Diea_ID, 0, _user.UserID, DateTime.Now);
                if (obj_Idiea.Diea_Stype == 2)
                {
                    if (obj_Idiea.Number != 1)
                    {
                        _T_IdieaDAL.Update_Status_tintuc(Diea_ID, 22, _user.UserID, DateTime.Now, 0);
                        _T_IdieaDAL.Insert_Version_From_T_idiea_WithUserModify(Diea_ID, 6, 22, _user.UserID, DateTime.Now);

                        ActionsCode = "[Danh sách Đề tài đang chờ xử lý TBT:]-->[Gửi TPPV][Diea_ID:" + Diea_ID + "]";
                        UltilFunc.Log_Action(_user.UserID, _user.UserName, DateTime.Now, int.Parse(Request["Menu_ID"].ToString()), ActionsCode);
                    }
                    else
                    {
                        T_Idiea _objIdiea = new T_Idiea();
                        HPCBusinessLogic.DAL.T_IdieaDAL _IdieaDAL  = new HPCBusinessLogic.DAL.T_IdieaDAL();
                        HPCBusinessLogic.DAL.T_NewsDAL  _T_NewsDAL = new HPCBusinessLogic.DAL.T_NewsDAL();
                        T_News _objT_News = SetItem(Diea_ID);
                        _T_NewsDAL.InsertT_news(_objT_News);

                        ActionsCode = "[TBT chuyển bài viết đề tài]-->[TKTS][Diea_ID =" + Diea_ID + "]";
                        UltilFunc.Log_Action(_user.UserID, _user.UserName, DateTime.Now, int.Parse(Request["Menu_ID"].ToString()), ActionsCode);
                        _T_IdieaDAL.Update_Status_tintuc(Diea_ID, 64, _user.UserID, DateTime.Now, 1);
                    }
                }
                else
                {
                    if (obj_Idiea.Number != 1)
                    {
                        _T_IdieaDAL.Update_Status_tintuc(Diea_ID, 52, _user.UserID, DateTime.Now, 0);
                        _T_IdieaDAL.Insert_Version_From_T_idiea_WithUserModify(Diea_ID, 2, 52, _user.UserID, DateTime.Now);

                        ActionsCode = "[TBT duyệt đề tài:]-->[Gửi TPBT][Diea_ID:" + Diea_ID + "]";
                        UltilFunc.Log_Action(_user.UserID, _user.UserName, DateTime.Now, int.Parse(Request["Menu_ID"].ToString()), ActionsCode);
                    }
                    else
                    {
                        T_Idiea _objIdiea = new T_Idiea();
                        HPCBusinessLogic.DAL.T_IdieaDAL _IdieaDAL  = new HPCBusinessLogic.DAL.T_IdieaDAL();
                        HPCBusinessLogic.DAL.T_NewsDAL  _T_NewsDAL = new HPCBusinessLogic.DAL.T_NewsDAL();
                        T_News _objT_News = SetItem(Diea_ID);
                        _T_NewsDAL.InsertT_news(_objT_News);

                        ActionsCode = "[TBT chuyển bài viết đề tài]-->[TKTS][Diea_ID =" + Diea_ID + "]";
                        UltilFunc.Log_Action(_user.UserID, _user.UserName, DateTime.Now, int.Parse(Request["Menu_ID"].ToString()), ActionsCode);
                        _T_IdieaDAL.Update_Status_tintuc(Diea_ID, 64, _user.UserID, DateTime.Now, 1);
                    }
                }
            }
            if (TabContainer1.ActiveTabIndex == 0)
            {
                LoadData_DangXuly();
            }
            else if (TabContainer1.ActiveTabIndex == 1)
            {
                LoadData_DetaiChoDuyet();
            }
            else if (TabContainer1.ActiveTabIndex == 2)
            {
                LoadData_Bitralai();
            }
            DataSet _dsReturn;
            DataSet _dsReturn1;
            DataSet _dsReturn2;

            _dsReturn  = _T_IdieaDAL.BindGridT_IdieaEditor(pages.PageIndex, pages.PageSize, BuildSQL(62, sOrder));
            _dsReturn1 = _T_IdieaDAL.BindGridT_IdieaEditor(pages2.PageIndex - 1, pages2.PageSize, BuildSQL(63, sOrder));
            _dsReturn2 = _T_IdieaDAL.BindGridT_IdieaEditor(Pager3.PageIndex - 1, Pager3.PageSize, BuildSQL(64, sOrder));
            System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "javascript", "javascript: SetTotal(" + _dsReturn.Tables[1].Rows[0].ItemArray[0].ToString() + "," + _dsReturn1.Tables[1].Rows[0].ItemArray[0].ToString() + "," + _dsReturn2.Tables[1].Rows[0].ItemArray[0].ToString() + ");", true);
            _dsReturn.Clear();
            _dsReturn1.Clear();
            _dsReturn2.Clear();
        }
Exemplo n.º 27
0
        //end

        #endregion

        #region Event click
        protected void linkSave_Click(object sender, EventArgs e)
        {
            if (Txt_tieude.Text.Length <= 0)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
                return;
            }

            if (cbo_lanquage.SelectedIndex == 0)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
                return;
            }
            if (cbo_chuyenmuc.SelectedIndex == 0)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
                return;
            }
            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;
                }
            }
            string message = string.Empty;
            T_News _t_news = SetItem();
            int    id      = 0;

            HPCBusinessLogic.DAL.T_NewsDAL _T_newsDAL = new HPCBusinessLogic.DAL.T_NewsDAL();
            if (Page.IsValid)
            {
                id = _T_newsDAL.InsertT_news(_t_news);
                //Insert keywords
                InsertKeyword(id, _user.UserID);
                if (Request["ID"] == null)
                {
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, Txt_tieude.Text,
                                                                   Request["Menu_ID"].ToString(), "[Nhập tin bài] [Thao tác Thêm mới tin bài]", id, ConstAction.BaoDT);
                    System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + HPCComponents.Global.RM.GetString("VALIDATE_ADDNEWS") + "');", true);
                }
                else
                {
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, Txt_tieude.Text,
                                                                   Request["Menu_ID"].ToString(), "[Nhập tin bài] [Thao tác cập nhật tin bài]", id, ConstAction.BaoDT);
                    System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + HPCComponents.Global.RM.GetString("UpdateSuccessfully") + "');", true);
                }
                UltilFunc.Insert_News_Image(txt_noidung.Text.Trim(), Convert.ToDouble(id.ToString()));
            }
            if (_t_news.Images_Summary.Length > 0)
            {
                this.ImgTemp.Src = HPCComponents.Global.TinPathBDT + "/" + _t_news.Images_Summary;
            }
            if (Request["Tab"] != null && Request["Tab"].ToString() != "" && Request["Tab"].ToString() != String.Empty)
            {
                Response.Redirect("ArticleEdit.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&Tab=" + Page.Request["Tab"].ToString() + "&ID=" + id.ToString());
            }
            else
            {
                Response.Redirect("ArticleEdit.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&ID=" + id.ToString());
            }
        }
Exemplo n.º 28
0
        protected T_News SetItem()
        {
            HPCBusinessLogic.DAL.T_NewsDAL Dal = new HPCBusinessLogic.DAL.T_NewsDAL();
            T_News obj_news = new T_News();

            if (Page.Request.Params["id"] != null)
            {
                obj_news.News_ID       = Convert.ToInt32(Page.Request["id"].ToString());
                obj_news.News_EditorID = _user.UserID;
                obj_news = Dal.load_T_news(int.Parse(Request["id"]));
                if (obj_news.News_Status != 55)
                {
                    obj_news.News_DateEdit = DateTime.Now;
                }
                else
                {
                    obj_news.News_DateEdit = obj_news.News_DateEdit;
                }
            }
            else
            {
                obj_news.News_ID          = 0;
                obj_news.News_DateCreated = DateTime.Now;
                obj_news.News_AuthorID    = _user.UserID;
            }
            if (Txt_tieude.Text.Length > 0)
            {
                obj_news.News_Tittle = UltilFunc.CleanFormatTags(Txt_tieude.Text);
            }
            if (txt_TieuDePhu.Text.Length > 0)
            {
                obj_news.News_Sub_Title = UltilFunc.CleanFormatTags(txt_TieuDePhu.Text);
            }
            if (txt_tomtat.Text.Length > 0)
            {
                obj_news.News_Summary = txt_tomtat.Text;
            }
            if (int.Parse(cbo_chuyenmuc.SelectedIndex.ToString()) > 0)
            {
                obj_news.CAT_ID = int.Parse(cbo_chuyenmuc.SelectedValue.ToString());
            }
            if (int.Parse(cbo_lanquage.SelectedIndex.ToString()) > 0)
            {
                obj_news.Lang_ID = int.Parse(cbo_lanquage.SelectedValue.ToString());
            }
            //obj_news.News_Priority = int.Parse(ddlNews_Priority.SelectedValue.ToString());
            obj_news.News_IsImages  = this.chkImages.Checked;
            obj_news.News_IsVideo   = this.chkVideo.Checked;
            obj_news.News_IsHistory = this.chkHistorys.Checked;
            int tien = 0;

            if (this.txtTienNhuanBut.Text.Trim().Length > 0)
            {
                tien = int.Parse(txtTienNhuanBut.Text.Replace(",", ""));
                if (tien > 0)
                {
                    obj_news.News_TienNB        = tien;
                    obj_news.News_Ngaycham      = DateTime.Now;
                    obj_news.News_NguoichamNBID = _user.UserID;
                }
                else
                {
                    obj_news.News_TienNB        = 0;
                    obj_news.News_NguoichamNBID = 0;
                }
            }
            if (txt_noidung.Text.Length > 0)
            {
                obj_news.News_Body = txt_noidung.Text;
            }
            obj_news.Images_Summary  = this.txtThumbnail.Text.Trim();
            obj_news.News_AuthorName = UltilFunc.CleanFormatTags(txt_Author_name.Text);
            int butdanhID = 0;

            //T_Butdanh obj_BD = new T_Butdanh();
            //HPCBusinessLogic.DAL.T_ButdanhDAL obj = new HPCBusinessLogic.DAL.T_ButdanhDAL();
            //if (!string.IsNullOrEmpty(txt_Author_name.Text.Trim()))
            //{
            //    obj_BD.BD_ID = 0;
            //    obj_BD.UserID = _user.UserID;
            //    obj_BD.BD_Name = txt_Author_name.Text.Trim();
            //    butdanhID = obj.Insert_Butdang(obj_BD);
            //}
            obj_news.News_TacgiaID = butdanhID;
            obj_news.News_Comment  = UltilFunc.CleanFormatTags(Txt_Comments.Text);
            //obj_news.Keywords = this.txtTukhoa.Text;
            obj_news.News_IsCategorys       = this.chk_IsCategorys.Checked;
            obj_news.News_IsHomePages       = this.chk_IsHomePages.Checked;
            obj_news.News_IsCategoryParrent = this.chk_IsCategoryParrent.Checked;
            obj_news.News_IsHot             = this.chkNewsIsHot.Checked;
            obj_news.News_IsFocus           = this.chkNewsIsFocus.Checked;
            int tab = 0;

            if (Page.Request["Tab"] != null)
            {
                tab = Convert.ToInt32(Page.Request["Tab"].ToString());
            }
            if (tab == 0)
            {
                obj_news.News_Status = ConstNews.AddNew;
            }
            else if (tab == -1)
            {
                obj_news.News_Status = ConstNews.AddNew;
            }
            else if (tab == 1)
            {
                obj_news.News_Status = ConstNews.NewsReturn;
            }
            else if (tab == 3)
            {
                obj_news.News_Status = ConstNews.NewsDelete;
            }
            obj_news.News_Realate = ReturnFilterListRelation();
            //Add By nvthai
            obj_news.News_Priority = 1;

            obj_news.News_PhotoAtt      = txtVideoPath.Text;
            obj_news.News_DescImages    = txtChuthichanh.Text;
            obj_news.Image_Hot          = cbHienthiAnh.Checked;
            obj_news.News_Nguon         = txtNguon.Text;
            obj_news.News_DisplayMobile = cbDisplayMobile.Checked;
            obj_news.News_Delete        = cbMoreViews.Checked;
            return(obj_news);
        }
Exemplo n.º 29
0
        protected void PopulateItem(int _ID)
        {
            //Lấy ID trong T_AutoSave
            AutoSavesDAL _dal        = new AutoSavesDAL();
            int          id_autoSave = _dal.Get_ID_AutoSave(_ID, _user.UserID);

            txtID.Text = id_autoSave.ToString();
            //end
            T_News obj_T_news = new T_News();

            HPCBusinessLogic.DAL.T_NewsDAL ObjDAl = new HPCBusinessLogic.DAL.T_NewsDAL();
            obj_T_news                = ObjDAl.load_T_news(_ID);
            this.Txt_tieude.Text      = obj_T_news.News_Tittle.ToString();
            this.txtTukhoa.Text       = ObjDAl.GetKeywordsByNewsID(_ID);
            this.txt_TieuDePhu.Text   = obj_T_news.News_Sub_Title.ToString();
            this.txt_tomtat.Text      = obj_T_news.News_Summary.ToString();
            this.txt_noidung.Text     = obj_T_news.News_Body.ToString();
            this.Txt_Comments.Text    = obj_T_news.News_Comment.ToString();
            this.txt_Author_name.Text = obj_T_news.News_AuthorName.ToString();
            this.txtThumbnail.Text    = obj_T_news.Images_Summary;
            if (obj_T_news.Images_Summary.ToString().Length > 0)
            {
                this.ImgTemp.Src = HPCComponents.Global.UploadPathBDT + obj_T_news.Images_Summary;
            }
            else
            {
                this.ImgTemp.Attributes.CssStyle.Add("display", "none");
            }

            this.cbo_lanquage.SelectedValue = obj_T_news.Lang_ID.ToString();

            this.chk_IsCategorys.Checked       = obj_T_news.News_IsCategorys;
            this.chk_IsHomePages.Checked       = obj_T_news.News_IsHomePages;
            this.chk_IsCategoryParrent.Checked = obj_T_news.News_IsCategoryParrent;
            this.chkNewsIsFocus.Checked        = obj_T_news.News_IsFocus;
            this.chkNewsIsHot.Checked          = obj_T_news.News_IsHot;
            this.chkHistorys.Checked           = obj_T_news.News_IsHistory;
            this.chkImages.Checked             = obj_T_news.News_IsImages;
            this.chkVideo.Checked = obj_T_news.News_IsVideo;
            if (obj_T_news.News_TienNB > 0.0)
            {
                this.txtTienNhuanBut.Text = string.Format("{0:#,#}", obj_T_news.News_TienNB).Replace(".", ",");
            }
            this.cbo_chuyenmuc.Items.Clear();
            if (cbo_lanquage.SelectedIndex > 0)
            {
                UltilFunc.BindCombox(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham= " + this.cbo_lanquage.SelectedValue + " AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
                cbo_chuyenmuc.UpdateAfterCallBack = true;
                cbo_chuyenmuc.SelectedIndex       = CommonLib.GetIndexControl(cbo_chuyenmuc, obj_T_news.CAT_ID.ToString());
            }
            else
            {
                this.cbo_chuyenmuc.DataSource = null;
                this.cbo_chuyenmuc.DataBind();
                this.cbo_chuyenmuc.UpdateAfterCallBack = true;
            }
            //bind bai viet lien quan
            if (obj_T_news.News_Realate.ToString().Trim() != "")
            {
                txtListID.Text = obj_T_news.News_Realate.ToString().Trim().Replace(",0", "");
            }
            LoadNewRealation();
            //Add By nvthai
            //obj_T_news.News_Priority == 1;
            txtVideoPath.Text            = obj_T_news.News_PhotoAtt;
            txtChuthichanh.Text          = obj_T_news.News_DescImages;
            this.cbHienthiAnh.Checked    = obj_T_news.Image_Hot;
            this.txtNguon.Text           = obj_T_news.News_Nguon;
            this.cbDisplayMobile.Checked = obj_T_news.News_DisplayMobile;
            this.cbMoreViews.Checked     = obj_T_news.News_Delete;
        }
Exemplo n.º 30
0
        //end

        #endregion

        #region Event click
        protected void linkSave_Click(object sender, EventArgs e)
        {
            //dung them vao de kiem tra dieu dau vao và để busybox khong bi dung trong IE
            if (Txt_tieude.Text.Length == 0)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
                return;
            }
            //if (cbo_lanquage.SelectedIndex == 0)
            //{
            //    System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
            //    return;
            //}

            if (cbo_chuyenmuc.SelectedIndex == 0)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanLuu") + "');", true);
                return;
            }
            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;
                }
            }
            if (Page.IsValid)
            {
                HPCBusinessLogic.DAL.T_NewsDAL _untilDAL = new HPCBusinessLogic.DAL.T_NewsDAL();
                T_News _objSet = null;
                int    tab     = 0;
                if (Request["Tab"] != null)
                {
                    tab = Convert.ToInt32(Request["Tab"].ToString());
                }
                if (tab == 0)
                {
                    _objSet = SetItem(ConstNews.NewsPublishing);
                }
                else
                {
                    _objSet = SetItem(ConstNews.NewsUnPublishing);
                }
                UltilFunc.Insert_News_Image(txt_noidung.Text.Trim(), Convert.ToDouble(Page.Request["id"]));
                int _return = _untilDAL.InsertT_newsXb(_objSet);
                //key words
                InsertKeyword(_return, _user.UserID);
                if (_objSet.Images_Summary.ToString().Length > 0)
                {
                    this.ImgTemp.Src = HPCComponents.Global.TinPathBDT + "/" + _objSet.Images_Summary;
                }
                _untilDAL.IsLock(_return, 1, _user.UserID);//dung them vao de giu trang thai lock khi dang lam viec voi tin bai
                if (_objSet.News_Status != ConstNews.NewsPublishing)
                {
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, _objSet.News_Tittle,
                                                                   Request["Menu_ID"].ToString(), "[Bài ngừng đăng] [Sửa bài ngừng xuất bản]", _objSet.News_ID, ConstAction.BaoDT);
                }
                else
                {
                    //Tao cache
                    //UltilFunc.GenCacheHTML();
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, _objSet.News_Tittle,
                                                                   Request["Menu_ID"].ToString(), "[Bài đang xuất bản] [Sửa bài đang xuất bản]", _objSet.News_ID, ConstAction.BaoDT);
                }
                if (Request["Tab"].ToString() == "0")
                {
                    #region Sync
                    // DONG BO FILE
                    SynFiles _syncfile = new SynFiles();
                    if (_objSet.Images_Summary.Length > 0)
                    {
                        _syncfile.SynData_UploadImgOne(_objSet.Images_Summary, HPCComponents.Global.ImagesService);
                    }

                    //Cap nhat anh trong bai viet - vao may dong bo
                    if (_objSet.News_Body.Length > 5)
                    {
                        _syncfile.SearchImgTag(_objSet.News_Body);
                        _syncfile.SearchTagSwf(_objSet.News_Body);
                        _syncfile.SearchTagFLV(_objSet.News_Body);
                    }
                    //END
                    #endregion
                }
                if (Request["Tab"] != null && Request["Tab"].ToString() != "" && Request["Tab"].ToString() != String.Empty)
                {
                    Response.Redirect("PublishedEdit.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&Tab=" + Page.Request["Tab"].ToString() + "&ID=" + _return.ToString());
                }
                else
                {
                    Response.Redirect("PublishedEdit.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&ID=" + _return.ToString());
                }
            }
        }