Ejemplo n.º 1
0
        private void GuiTinBai(string MaDoiTuong)
        {
            string Thaotac = "";
            string _trace  = string.Empty;

            _obj       = SetItem(MaDoiTuong, 1);
            txtID.Text = Convert.ToString(_Daltinbai.SP_UpdateT_TinBai_WordOnline(_obj));
            _matinbai  = double.Parse(txtID.Text.Trim());
            if (MaDetai != 0)
            {
                _Daltinbai.InsertT_Vitri_Tinbai_FromT_Tinbai(0, 0, _matinbai, MaDetai);
            }
            SaveImagesAttachAll();
            _trace = _Daltinbai.GetTrace(_matinbai) + Request["MaDoiTuong"] + "_" + _user.UserID + ";";
            _Daltinbai.Update_Status_tintuc(_matinbai, 1, _user.UserID, DateTime.Now, MaDoiTuong, _trace);
            _Daltinbai.Insert_Phienban_From_T_Tinbai(_matinbai, _user.UserID, DateTime.Now, Request["MaDoiTuong"].ToString());
            _Daltinbai.Insert_Tulieu_From_T_Tinbai(_matinbai);
            Thaotac = "Thao tác gửi tin bài từ " + CommonLib.GetTenDoiTuong(Request["MaDoiTuong"].ToString()) + " đến " + CommonLib.GetTenDoiTuong(MaDoiTuong.ToString()) + " - Tiêu đề:" + Txt_tieude.Text.Trim();
            UltilFunc.Log_Thaotactinbai(_user.UserID, _user.UserFullName, DateTime.Now, Thaotac, _matinbai);
            UltilFunc.Log_Action(_user.UserID, _user.UserFullName, DateTime.Now, int.Parse(Request["Menu_ID"]), Thaotac);

            if (checkbaoonline.Checked)
            {
                HPCBusinessLogic.DAL.T_NewsDAL _T_NewsDAL = new HPCBusinessLogic.DAL.T_NewsDAL();
                T_News _objT_News      = SetItemBaoDienTu(_matinbai);
                int    _returnvnonline = 0;
                // Insert sang bao dien tu
                if (_statusvnonline == int.Parse(CommonLib.ReadXML("Status_BDT")) || _statusvnonline == 0)
                {
                    _returnvnonline = _T_NewsDAL.InsertT_news(_objT_News);
                    _T_NewsDAL.Update_Status_tintuc(_returnvnonline, int.Parse(CommonLib.ReadXML("Status_BDT")), _user.UserID, DateTime.Now);
                    UltilFunc.Insert_News_Image(_objT_News.News_Body.Trim(), Convert.ToDouble(_returnvnonline.ToString()));
                }
                //end
            }

            Response.Redirect("~/Quytrinh/List_PV.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&MaDoiTuong=" + Request["MaDoiTuong"].ToString() + "&Tab=" + Request["Tab"]);
        }
Ejemplo n.º 2
0
        private void GuiTinBai(string MaDoiTuong)
        {
            string Thaotac = "";
            ArrayList ar = new ArrayList();
            if (TabContainer1.ActiveTabIndex == 0)
            {
                foreach (DataGridItem m_Item in DataGrid_Dangxuly.Items)
                {
                    CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect");
                    if (chk_Select != null && chk_Select.Checked)
                    {
                        ar.Add(double.Parse(DataGrid_Dangxuly.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString()));
                    }
                }
            }
            else if (TabContainer1.ActiveTabIndex == 1)
            {
                foreach (DataGridItem m_Item in DataGrid_TinTraLai.Items)
                {
                    CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect");
                    if (chk_Select != null && chk_Select.Checked)
                    {
                        ar.Add(double.Parse(DataGrid_TinTraLai.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString()));
                    }
                }
            }


            if (!_isRefresh)
            {
                for (int i = 0; i < ar.Count; i++)
                {
                    double News_ID = double.Parse(ar[i].ToString());

                    string _trace = _daltinbai.GetTrace(News_ID) + Request["MaDoiTuong"].ToString() + "_" + _user.UserID + ";";
                    _daltinbai.Update_Status_tintuc(News_ID, 1, _user.UserID, DateTime.Now, MaDoiTuong, _trace);
                    _daltinbai.Insert_Phienban_From_T_Tinbai(News_ID, _user.UserID, DateTime.Now, Request["MaDoiTuong"].ToString());
                    _daltinbai.Insert_Tulieu_From_T_Tinbai(News_ID);

                    Thaotac = "Thao tác gửi tin bài từ :" + CommonLib.GetTenDoiTuong(Request["MaDoiTuong"].ToString()) + "-->Gửi đến " + CommonLib.GetTenDoiTuong(MaDoiTuong) + "TinTuc:" + _daltinbai.load_T_news(int.Parse(News_ID.ToString())).Tieude;

                    _daltinbai.IsLock(News_ID, 0);
                    UltilFunc.Log_Thaotactinbai(_user.UserID, _user.UserFullName, DateTime.Now, Thaotac, News_ID);
                    UltilFunc.Log_Action(_user.UserID, _user.UserFullName, DateTime.Now, int.Parse(Request["Menu_ID"]), Thaotac);
                    int _statusvnonline = UltilFunc.GetColumnValuesOne("T_News", "News_Status", "RefID=" + News_ID);
                    bool _vnnewsonline = _daltinbai.load_T_news(int.Parse(News_ID.ToString())).VietNamNews;
                    if (_vnnewsonline && MaDoiTuong.ToUpper() == Global.MaXuatBan)
                    {
                        // Insert sang bao dien tu
                        if (_statusvnonline == int.Parse(CommonLib.ReadXML("Status_BDT")) || _statusvnonline == 0)
                        {
                            HPCBusinessLogic.DAL.T_NewsDAL _T_NewsDAL = new HPCBusinessLogic.DAL.T_NewsDAL();
                            T_News _objT_News = SetItemBaoDienTu(News_ID);
                            int _id_dt = _T_NewsDAL.InsertT_news(_objT_News);
                            _T_NewsDAL.Update_Status_tintuc(_id_dt, int.Parse(CommonLib.ReadXML("Status_BDT")), _user.UserID, DateTime.Now);
                            UltilFunc.Insert_News_Image(_objT_News.News_Body.Trim(), Convert.ToDouble(_id_dt.ToString()));
                        }
                        //end
                    }

                    this.TabContainer1_ActiveTabChanged(null, null);
                }

            }

        }