示例#1
0
 public void grdList_EditCommand(object source, DataGridCommandEventArgs e)
 {
     #region GhiLog
     Lichsu_Thaotac_HethongDAL actionDAL = new Lichsu_Thaotac_HethongDAL();
     T_Lichsu_Thaotac_Hethong  action    = new T_Lichsu_Thaotac_Hethong();
     action.Ma_Nguoidung = _user.UserID;
     action.TenDaydu     = _user.UserFullName;
     action.HostIP       = IpAddress();
     action.NgayThaotac  = DateTime.Now;
     #endregion
     SobaoDAL objDAL = new SobaoDAL();
     int      _id    = Convert.ToInt32(this.grdList.DataKeys[e.Item.ItemIndex].ToString());
     if (e.CommandArgument.ToString().ToLower() == "edit")
     {
         Response.Redirect("~/Danhmuc/EditSobao.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + _id);
     }
     if (e.CommandArgument.ToString().ToLower() == "delete")
     {
         if (!checkdelete(_id))
         {
             objDAL.DeleteOneFromT_Sobao(_id);
             action.Thaotac = "[Xóa T_Sobao]-->[Thao tác Xóa Trong Bảng T_Sobao][ID:" + _id + " ]";
             this.Danhsach_Sobao();
         }
         else
         {
             FuncAlert.AlertJS(this, " Số báo đã được biên tập tin bài, nên không thể xóa!");
             return;
         }
     }
 }
示例#2
0
        protected void GridViewPhongBan_OnRowCommand(object sender, GridViewCommandEventArgs e)
        {
            #region GhiLog
            Lichsu_Thaotac_HethongDAL actionDAL = new Lichsu_Thaotac_HethongDAL();
            T_Lichsu_Thaotac_Hethong  action    = new T_Lichsu_Thaotac_Hethong();
            action.Ma_Nguoidung = _user.UserID;
            action.TenDaydu     = _user.UserFullName;
            action.HostIP       = IpAddress();
            action.NgayThaotac  = DateTime.Now;
            #endregion

            if (e.CommandName.Equals("AddNew"))
            {
                TextBox _tenphongban = (TextBox)GridViewPhongBan.FooterRow.FindControl("txt_Tenphong");

                _PB.Ma_Phongban  = 0;
                _PB.Ten_Phongban = _tenphongban.Text.Trim();
                if (!isExist(_tenphongban.Text.Trim()))
                {
                    _DAL.InsertT_Phongban(_PB);
                }
                else
                {
                    FuncAlert.AlertJS(this, "Tên phòng ban đã tồn tại!");
                }
                action.Thaotac = "[Thêm mới phòng ban]";
                actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
                BindList_Phongban();
            }
        }
示例#3
0
        protected void GridViewNgonNgu_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            int _return;
            int _id = Convert.ToInt32(GridViewNgonNgu.DataKeys[e.RowIndex].Value.ToString());

            TextBox  _tenphongban = (TextBox)GridViewNgonNgu.Rows[e.RowIndex].FindControl("txt_Tenphong");
            TextBox  _Thutu       = (TextBox)GridViewNgonNgu.Rows[e.RowIndex].FindControl("txt_STT");
            CheckBox chk_Hoatdong = (CheckBox)GridViewNgonNgu.Rows[e.RowIndex].FindControl("chk_Hoatdong");

            _NN.ID         = _id;
            _NN.TenNgonNgu = _tenphongban.Text.Trim();
            _NN.ThuTu      = int.Parse(_Thutu.Text.Trim());
            _NN.HoatDong   = chk_Hoatdong.Checked;
            if (!isExist(_tenphongban.Text.Trim(), _id))
            {
                _return = _DAL.InsertT_NgonNgu(_NN);
            }
            else
            {
                FuncAlert.AlertJS(this, "Tên phòng ban đã tồn tại!");
            }
            UltilFunc.Log_Action(_user.UserID, _user.UserFullName, DateTime.Now, int.Parse(Request["Menu_ID"]), "Sửa ngôn ngữ");
            GridViewNgonNgu.EditIndex = -1;
            BindList_Phongban();
        }
示例#4
0
        protected void GridViewPhongBan_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            #region GhiLog
            Lichsu_Thaotac_HethongDAL actionDAL = new Lichsu_Thaotac_HethongDAL();
            T_Lichsu_Thaotac_Hethong  action    = new T_Lichsu_Thaotac_Hethong();
            action.Ma_Nguoidung = _user.UserID;
            action.TenDaydu     = _user.UserFullName;
            action.HostIP       = IpAddress();
            action.NgayThaotac  = DateTime.Now;
            #endregion
            int _return;
            int _id = Convert.ToInt32(GridViewPhongBan.DataKeys[e.RowIndex].Value.ToString());

            TextBox _tenphongban = (TextBox)GridViewPhongBan.Rows[e.RowIndex].FindControl("txt_Tenphong");

            _PB.Ma_Phongban  = _id;
            _PB.Ten_Phongban = _tenphongban.Text.Trim();
            if (!isExist(_tenphongban.Text.Trim(), _id))
            {
                _return = _DAL.InsertT_Phongban(_PB);
            }
            else
            {
                FuncAlert.AlertJS(this, "Tên phòng ban đã tồn tại!");
            }
            action.Thaotac = "[Sửa phòng ban]";
            actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
            GridViewPhongBan.EditIndex = -1;
            BindList_Phongban();
        }
示例#5
0
 protected void btnbackpage_Click(object sender, EventArgs e)
 {
     if (!_isRefresh)
     {
         if (DataGrid_FilePDF.Items.Count > 0)
         {
             foreach (DataListItem m_Item in DataGrid_FilePDF.Items)
             {
                 CheckBox chk_Select   = (CheckBox)m_Item.FindControl("optSelect");
                 TextBox  txt_chuthich = (TextBox)m_Item.FindControl("txt_chuthich");
                 if (chk_Select != null && chk_Select.Checked)
                 {
                     int    _ID        = int.Parse(DataGrid_FilePDF.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString());
                     string _sqlupdate = "update T_Publish_Pdf set Comments=N'" + txt_chuthich.Text.Trim() + "' where ID=" + _ID;
                     ulti.ExecSql(_sqlupdate);
                 }
             }
             LoadData_FilePDF();
         }
         else
         {
             FuncAlert.AlertJS(this, "Không có layout!");
             return;
         }
     }
 }
示例#6
0
 protected void TabContainer1_ActiveTabChanged(object sender, EventArgs e)
 {
     if (TabContainer1.ActiveTabIndex == 0)
     {
         if (cbo_Anpham.SelectedIndex == 0)
         {
             FuncAlert.AlertJS(this, (string)HttpContext.GetGlobalResourceObject("cms.language", "lblbanchuachonanpham"));
             return;
         }
         if (cboSoBao.SelectedIndex > 0 || txt_tungay.Text.Trim() != "" || txt_denngay.Text.Trim() != "")
         {
             if (cboPage.SelectedIndex > 0)
             {
                 LoadData_FilePDF();
             }
             this.LoadData_ChoXuly();
         }
         else
         {
             FuncAlert.AlertJS(this, (string)HttpContext.GetGlobalResourceObject("cms.language", "lblbanchuachonsobao"));
             return;
         }
     }
     if (TabContainer1.ActiveTabIndex == 1)
     {
         this.LoadData_Baidaxuly();
     }
 }
示例#7
0
 protected void cboPage_OnSelectedIndexChanged(object sender, EventArgs e)
 {
     if (cbo_Anpham.SelectedIndex == 0)
     {
         FuncAlert.AlertJS(this, (string)HttpContext.GetGlobalResourceObject("cms.language", "lblbanchuachonanpham"));
         return;
     }
     if (cboSoBao.SelectedIndex > 0)
     {
         LoadData_FilePDF();
         if (CheckSendPDF(cboPage.SelectedValue, cboSoBao.SelectedValue))
         {
             lblMessage.Visible = true;
         }
         else
         {
             lblMessage.Visible = false;
         }
         this.TabContainer1_ActiveTabChanged(sender, e);
     }
     else
     {
         FuncAlert.AlertJS(this, (string)HttpContext.GetGlobalResourceObject("cms.language", "lblbanchuachonsobao"));
         return;
     }
 }
示例#8
0
        protected void DataGrid_EditCommand(object source, DataGridCommandEventArgs e)
        {
            double _ID = double.Parse(DataGrid_DanTrang.DataKeys[e.Item.ItemIndex].ToString());

            string _thaotac = string.Empty;

            if (e.CommandArgument.ToString().ToLower() == "back")
            {
                string _trace = Daltinbai.GetTrace(_ID);
                if (_trace.Length > 0)
                {
                    string[] _tmp = _trace.Split(';');
                    if (_tmp.Length > 0)
                    {
                        string _pos = _tmp[_tmp.Length - 2];
                        _trace = _trace.Substring(0, _trace.Length - _pos.Length - 1);
                        string _u = _pos.Substring(_pos.IndexOf("_") + 1);
                        _pos = _pos.Substring(0, _pos.Length - _u.Length - 1);
                        Daltinbai.Update_Status_tintuc(_ID, 3, int.Parse(_u), DateTime.Now, _pos, _trace);
                        Daltinbai.Insert_Phienban_From_T_Tinbai(_ID, _user.UserID, DateTime.Now, Request["MaDoiTuong"].ToString());
                        _thaotac = "[" + Request["MaDoiTuong"] + " Gửi trả lại tin bài cho " + _pos + " Tiêu đề:" + Daltinbai.load_T_news(_ID).Tieude + " ]";
                        UltilFunc.Log_Thaotactinbai(_user.UserID, _user.UserFullName, DateTime.Now, _thaotac, _ID);
                    }
                }
                else
                {
                    FuncAlert.AlertJS(this, "Không thể trả lại, vì không tìm được người gửi tin! ");
                    return;
                }
                this.TabContainer1_ActiveTabChanged(null, null);
            }
            LoadData_ChoXuly();
        }
示例#9
0
 protected void btn_inbienlai_click(object sender, EventArgs e)
 {
     if (cboAnPham.SelectedIndex == 0)
     {
         FuncAlert.AlertJS(this, CommonLib.ReadXML("lblBanchuachonanpham"));
         return;
     }
     if (HiddenFieldTacgiatin.Value != "" || txt_cmtnd.Text.Trim() != "")
     {
         ar = new ArrayList();
         foreach (DataGridItem m_Item in DataGrid_tinbai.Items)
         {
             CheckBox chk_Select  = (CheckBox)m_Item.FindControl("optSelect");
             Label    lblMaTacGia = (Label)m_Item.FindControl("lblMaTacGia");
             if (chk_Select != null && chk_Select.Checked)
             {
                 ar.Add(double.Parse(DataGrid_tinbai.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString()));
             }
             if (ar.Count > 0)
             {
                 ExportReportExcellCheckBox(lblMaTacGia.Text);
             }
             else
             {
                 ExportReportExcell(lblMaTacGia.Text);
             }
         }
         LoadData();
     }
     else
     {
         FuncAlert.AlertJS(this, CommonLib.ReadXML("lblBanphaichontacgiahoacnhapsocmtnd"));
         return;
     }
 }
示例#10
0
 protected void LinkButtonBack_Click(object sender, EventArgs e)
 {
     if (!_isRefresh)
     {
         int    Nguoitao = 0;
         string Thaotac  = "";
         _arr = GetDataKeysFromDataGrid();
         for (int i = 0; i < _arr.Count; i++)
         {
             double ID = double.Parse(_arr[i].ToString());
             Nguoitao = UltilFunc.GetColumnValuesOne("T_PhienBanQuangCao", "Nguoitao", " Ma_Quangcao=" + ID.ToString() + " and Trangthai=21");
             if (Nguoitao != 0)
             {
                 _DalQC.Sp_UpdateRowT_QuangCao(ID, Nguoitao, 23);
                 _DalQC.Sp_InsertT_PhienBanQuangCao(ID);
                 Thaotac = "[Gửi trả lại quảng cáo từ KT-QC-->TP-QC:]-->[ID:]" + ID.ToString();
                 UltilFunc.Log_Action(_user.UserID, _user.UserFullName, DateTime.Now, int.Parse(Request["Menu_ID"]), Thaotac);
             }
             else
             {
                 FuncAlert.AlertJS(this, "không thể trả lại vì QC không phải của NVQC");
                 return;
             }
         }
         this.TabContainer1_ActiveTabChanged(null, null);
     }
 }
 private bool CheckForm()
 {
     if (ddlLang.SelectedIndex == 0)
     {
         FuncAlert.AlertJS(this, "Trước khi lưu bạn phải nhập thông tin cho các phần (*) mầu đỏ !");
         return(false);
     }
     if (Txt_tieude.Text == "")
     {
         FuncAlert.AlertJS(this, "Trước khi lưu bạn phải nhập thông tin cho các phần (*) mầu đỏ !");
         return(false);
     }
     if (cbo_chuyenmuc.SelectedIndex == 0)
     {
         FuncAlert.AlertJS(this, "Trước khi lưu bạn phải nhập thông tin cho các phần (*) mầu đỏ !");
         return(false);
     }
     if (txt_noidung.Text == "")
     {
         FuncAlert.AlertJS(this, "Trước khi lưu bạn phải nhập thông tin cho các phần (*) mầu đỏ !");
         return(false);
     }
     if (txt_noidungbaiviet.Visible == true && txt_noidungbaiviet.Text == "")
     {
         FuncAlert.AlertJS(this, "Trước khi lưu bạn phải nhập thông tin cho các phần (*) mầu đỏ !");
         return(false);
     }
     return(true);
 }
示例#12
0
 public void grdList_EditCommand(object source, DataGridCommandEventArgs e)
 {
     #region GhiLog
     Lichsu_Thaotac_HethongDAL actionDAL = new Lichsu_Thaotac_HethongDAL();
     T_Lichsu_Thaotac_Hethong  action    = new T_Lichsu_Thaotac_Hethong();
     action.Ma_Nguoidung = _user.UserID;
     action.TenDaydu     = _user.UserFullName;
     action.HostIP       = IpAddress();
     action.NgayThaotac  = DateTime.Now;
     #endregion
     ChuyenmucDAL obj_Cate = new ChuyenmucDAL();
     int          catID    = Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString());
     if (e.CommandArgument.ToString().ToLower() == "edit")
     {
         Response.Redirect("~/Danhmuc/EditChuyenMuc.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + catID);
     }
     if (e.CommandArgument.ToString().ToLower() == "editdisplay")
     {
         bool check = obj_Cate.GetOneFromT_ChuyenmucByID(catID).HoatDong;
         if (check)
         {
             obj_Cate.UpdateFromT_ChuyenMucDynamic(" Hoatdong = 0, Ngaysua = Getdate(), Nguoisua=" + _user.UserID.ToString() + " Where Ma_ChuyenMuc = " + catID);
             action.Thaotac = "[Update T_ChuyenMuc]-->[Hoatdong = 0]";
         }
         else
         {
             obj_Cate.UpdateFromT_ChuyenMucDynamic(" Hoatdong = 1, Ngaysua = Getdate(), Nguoisua=" + _user.UserID.ToString() + " Where Ma_ChuyenMuc = " + catID);
             action.Thaotac = "[Update T_ChuyenMuc]-->[Hoatdong = 1]";
         }
     }
     if (e.CommandArgument.ToString().ToLower() == "active_bdt")
     {
         bool check = obj_Cate.GetOneFromT_ChuyenmucByID(catID).HienThi_BDT;
         if (check)
         {
             obj_Cate.UpdateFromT_ChuyenMucDynamic(" HienThi_BDT = 0, Ngaysua = Getdate(), Nguoisua=" + _user.UserID.ToString() + " Where Ma_ChuyenMuc = " + catID);
             action.Thaotac = "[Update T_ChuyenMuc]-->[HienThi_BDT = 0]";
         }
         else
         {
             obj_Cate.UpdateFromT_ChuyenMucDynamic(" HienThi_BDT = 1, Ngaysua = Getdate(), Nguoisua=" + _user.UserID.ToString() + " Where Ma_ChuyenMuc = " + catID);
             action.Thaotac = "[Update T_ChuyenMuc]-->[HienThi_BDT = 1]";
         }
     }
     if (e.CommandArgument.ToString().ToLower() == "delete")
     {
         if (obj_Cate.CheckExists_ChuyenMuc(catID) == 0)
         {
             obj_Cate.DeleteFromT_ChuyenmucByID(catID);
             action.Thaotac = "[Xóa T_ChuyenMuc]-->[Thao tác Xóa Trong Bảng T_ChuyenMuc][ID:" + this.grdListCate.DataKeys[e.Item.ItemIndex].ToString() + " ]";
         }
         else
         {
             FuncAlert.AlertJS(this, "chuyên mục đã được sử dung biên tập tin bài!");
             return;
         }
     }
     Danhsach_ChuyenMuc();
 }
示例#13
0
 protected void btnTimkiem_Click(object sender, EventArgs e)
 {
     if (cbo_Anpham.SelectedIndex == 0)
     {
         FuncAlert.AlertJS(this, "Bạn chưa chọn ấn phẩm!"); return;
     }
     pages.PageIndex = 0;
     LoadData();
 }
示例#14
0
 protected void btnTimkiem_Click(object sender, EventArgs e)
 {
     if (cboAnPham.SelectedIndex == 0)
     {
         FuncAlert.AlertJS(this, CommonLib.ReadXML("lblBanchuachonanpham"));
         return;
     }
     LoadData_ChoXuly();
 }
示例#15
0
        private void SendBackTinbai()
        {
            string Thaotac = "";

            ArrayList ar = new ArrayList();

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

            if (TabContainer1.ActiveTabIndex == 0)
            {
                LoadData_ChoXuly();
            }
            HPCBusinessLogic.DAL.TinBaiDAL News = new HPCBusinessLogic.DAL.TinBaiDAL();
            if (!_isRefresh)
            {
                for (int i = 0; i < ar.Count; i++)
                {
                    double News_ID = double.Parse(ar[i].ToString());
                    string _trace  = News.GetTrace(News_ID);
                    if (_trace.Length > 0)
                    {
                        string[] _tmp = _trace.Split(';');
                        if (_tmp.Length > 0)
                        {
                            string _pos = _tmp[_tmp.Length - 2];
                            _trace = _trace.Substring(0, _trace.Length - _pos.Length - 1);
                            string _u = _pos.Substring(_pos.IndexOf("_") + 1);
                            _pos = _pos.Substring(0, _pos.Length - _u.Length - 1);
                            News.Update_Status_tintuc(News_ID, 3, int.Parse(_u), DateTime.Now, _pos, _trace);
                            News.Insert_Phienban_From_T_Tinbai(News_ID, _user.UserID, DateTime.Now, Request["MaDoiTuong"].ToString());
                            Thaotac = CommonLib.GetTenDoiTuong(Request["MaDoiTuong"]) + " Gửi trả lại tin bài cho " + CommonLib.GetTenDoiTuong(_pos) + " Tiêu đề:" + News.load_T_news(News_ID).Tieude + " ]";
                            UltilFunc.Log_Thaotactinbai(_user.UserID, _user.UserFullName, DateTime.Now, Thaotac, News_ID);
                        }
                    }
                    else
                    {
                        FuncAlert.AlertJS(this, "Không thể trả lại tin bài, vì không tìm được người gửi tin! ");
                        return;
                    }
                }
                UltilFunc.Log_Action(_user.UserID, _user.UserFullName, DateTime.Now, int.Parse(Request["Menu_ID"]), Thaotac);
            }
            if (TabContainer1.ActiveTabIndex == 0)
            {
                LoadData_ChoXuly();
            }
        }
示例#16
0
        string BuildSQL(string sOrder)
        {
            string sWhere = " and T_Tinbai.Doituong_DangXuly=N'" + Global.MaXuatBan + "'";


            if (txt_tieude.Text.Length > 0 && txt_tieude.Text.Trim() != "")
            {
                sWhere += " AND T_Tinbai.Tieude LIKE " + string.Format("N'%{0}%'", UltilFunc.SqlFormatText(txt_tieude.Text.Trim()));
            }

            if (cboAnPham.SelectedIndex > 0)
            {
                sWhere += " AND Ma_AnPham=" + cboAnPham.SelectedValue;
            }

            if (cboSoBao.SelectedIndex > 0)
            {
                sWhere += " AND Ma_Sobao=" + cboSoBao.SelectedValue;
            }

            if (txt_tungay.Text.Trim() != "" && txt_denngay.Text.Trim() != "")
            {
                if (UltilFunc.ToDate(txt_tungay.Text.Trim(), "dd/MM/yyyy") > UltilFunc.ToDate(txt_denngay.Text.Trim(), "dd/MM/yyyy"))
                {
                    FuncAlert.AlertJS(this, "Từ ngày phải nhỏ hơn đến ngày");
                    return(" and 1=0");
                }
                else
                {
                    if (sWhere.Trim() != "")
                    {
                        sWhere += " AND ";
                    }
                    sWhere += " Ma_Sobao in (select Ma_Sobao from T_Sobao where Ngay_Xuatban>='" + txt_tungay.Text.Trim() + " 00:00:00' and Ngay_Xuatban<='" + txt_denngay.Text.Trim() + " 23:59:59')";
                }
            }
            if (cbo_chuyenmuc.SelectedIndex > 0)
            {
                sWhere += " AND T_Tinbai.Ma_Chuyenmuc=" + cbo_chuyenmuc.SelectedValue.ToString();
            }

            if (txt_PVCTV.Text.Trim() == "")
            {
                HiddenFieldTacgiatin.Value = "";
            }
            if (txt_PVCTV.Text.Trim() != "" && HiddenFieldTacgiatin.Value != "")
            {
                sWhere += " AND T_Anh.Ma_Nguoichup=" + HiddenFieldTacgiatin.Value;
            }
            if (txt_PVCTV.Text.Trim() != "")
            {
                sWhere += " AND T_Anh.NguoiChup LIKE " + string.Format("N'%{0}%'", UltilFunc.SqlFormatText(txt_PVCTV.Text.Trim().Trim().Replace(" -- ", "|").Split('|')[0]));
            }

            return(sWhere + sOrder);
        }
示例#17
0
        private bool checkform()
        {
            if (cbo_vungmien.SelectedIndex == 0)
            {
                FuncAlert.AlertJS(this, "Bạn phải chọn vùng miền!");
                return(false);
            }

            return(true);
        }
示例#18
0
        public bool SaveImagesAttachAll()
        {
            T_Anh  objimage = new T_Anh();
            AnhDAL _dalanh  = new AnhDAL();
            int    _ID      = 0;

            if (dgrListImages.Items.Count > 0)
            {
                foreach (DataListItem m_Item in dgrListImages.Items)
                {
                    _ID = Convert.ToInt32(dgrListImages.DataKeys[m_Item.ItemIndex].ToString());
                    TextBox txtTacgia         = m_Item.FindControl("txtTacgia") as TextBox;
                    TextBox hdnValueTacGiaAnh = m_Item.FindControl("hdnValueTacGiaAnh") as TextBox;
                    TextBox txtChuthich       = m_Item.FindControl("txtChuthich") as TextBox;
                    if (_ID != 0)
                    {
                        objimage = _dalanh.GetOneFromT_AnhByID(_ID);
                        string _chuthich = "";
                        string _tacgia   = "";
                        int    _tacgiaID = 0;
                        if (txtChuthich.Text != Global.RM.GetString("Nhapchuthichanh"))
                        {
                            _chuthich = UltilFunc.RemoveEnterCode(txtChuthich.Text.Trim().Replace("'", "''"));
                        }
                        if (objimage != null && objimage.Ma_Nguoichup != 0)
                        {
                            _tacgia   = txtTacgia.Text.Replace(" -- ", "|").Split('|')[0];
                            _tacgiaID = objimage.Ma_Nguoichup;
                        }
                        if (!String.IsNullOrEmpty(hdnValueTacGiaAnh.Text))
                        {
                            _tacgia   = txtTacgia.Text.Replace(" -- ", "|").Split('|')[0];
                            _tacgiaID = int.Parse(hdnValueTacGiaAnh.Text.ToString());
                        }
                        if (txtChuthich.Text == Global.RM.GetString("Nhapchuthichanh"))
                        {
                            FuncAlert.AlertJS(this, "bạn chưa nhập chú thích ảnh");
                            return(false);
                        }

                        if (_tacgiaID == 0)
                        {
                            FuncAlert.AlertJS(this, "bạn chưa nhập tác giả ảnh");
                            return(false);
                        }

                        string SqlUpdate = "";
                        SqlUpdate = "update T_Anh set Chuthich=N'" + _chuthich + "',NguoiChup=N'" + _tacgia + "',Ma_Nguoichup=" + _tacgiaID + " where Ma_Anh=" + _ID;
                        Ulti.ExecSql(SqlUpdate);
                    }
                }
            }
            return(true);
        }
示例#19
0
 protected void btnTimkiem_Click(object sender, EventArgs e)
 {
     if (cbo_Sobao.SelectedIndex > 0)
     {
         LoadData_FilePDF();
     }
     else
     {
         FuncAlert.AlertJS(this, "Bạn chưa chọn số báo");
     }
 }
示例#20
0
        protected void btnAddMenu_Click(object sender, EventArgs e)
        {
            string _thaotac = string.Empty;

            if (txt_butdanh.Text.Trim().Length == 0)
            {
                FuncAlert.AlertJS(this, "Bạn chưa nhập bút danh");
                return;
            }

            T_Nguoidung _obj    = SetItem();
            int         _return = 0;

            if (userID != 0)
            {
                _return = userID;
            }
            if (_return != 0)
            {
                if (!isExist(txt_butdanh.Text.Trim(), userID))
                {
                    _return  = _NguoidungDAL.InsertT_Nguoidung(_obj);
                    _thaotac = "[Sửa bút danh]-->[ID:" + _return.ToString() + " ]";
                }
                else
                {
                    FuncAlert.AlertJS(this, "Bút danh đã tồn tại!");
                    return;
                }
            }
            else
            {
                if (!Page.IsValid)
                {
                    return;
                }
                if (!isExist(txt_butdanh.Text.Trim()))
                {
                    _return  = _NguoidungDAL.InsertT_Nguoidung(_obj);
                    _thaotac = "[Thêm mới bút danh]-->[ID:" + _return.ToString() + " ]";
                }
                else
                {
                    FuncAlert.AlertJS(this, "Bút danh đã tồn tại!");
                    return;
                }
            }
            txt_butdanh.Text = "";
            userID           = 0;
            btnAddMenu.Text  = "Thêm mới";
            UltilFunc.Log_Action(_user.UserID, _user.UserFullName, DateTime.Now, int.Parse(Request["Menu_ID"]), _thaotac);
            LoadData();
        }
示例#21
0
 protected void btnTimkiem_Click(object sender, EventArgs e)
 {
     if (cboAnPham.SelectedIndex > 0)
     {
         LoadData();
     }
     else
     {
         FuncAlert.AlertJS(this, "Bạn chưa chọn loại báo!");
         return;
     }
 }
示例#22
0
 protected void btnTimkiem_Click(object sender, EventArgs e)
 {
     if (cboSoBao.SelectedIndex == 0)
     {
         FuncAlert.AlertJS(this, "Bạn chưa chọn số báo!");
         return;
     }
     else
     {
         TabContainer1_ActiveTabChanged(sender, e);
         GetTotalRecordImg();
     }
 }
示例#23
0
 protected void btnTimkiem_Click(object sender, EventArgs e)
 {
     if (cbo_Anpham.SelectedIndex == 0)
     {
         FuncAlert.AlertJS(this, (string)HttpContext.GetGlobalResourceObject("cms.language", "lblBanchuachonanpham"));
         return;
     }
     if (cboSoBao.SelectedIndex == 0 && txt_tungay.Text.Trim() == "" && txt_denngay.Text.Trim() == "")
     {
         FuncAlert.AlertJS(this, (string)HttpContext.GetGlobalResourceObject("cms.language", "lblBanchuachonsobao"));
         return;
     }
     LoadData_FilePDF();
 }
示例#24
0
        protected void ValidateNgayXB(object source, ServerValidateEventArgs args)
        {
            string str = args.Value;

            args.IsValid = false;

            if (UltilFunc.ToDate(this.txt_NgayXB.Text, "dd/MM/yyyy") < DateTime.Now)
            {
                FuncAlert.AlertJS(this, "Ngày xuất bản số báo không được nhỏ hơn ngày hiện tại!");
                return;
            }

            args.IsValid = true;
        }
示例#25
0
        protected void ValidateNgayHT(object source, ServerValidateEventArgs args)
        {
            string str = args.Value;

            args.IsValid = false;

            if (UltilFunc.ToDate(this.txt_NgayHT.Text, "dd/MM/yyyy") < DateTime.Now)
            {
                FuncAlert.AlertJS(this, "Ngày hoàn thành phải lớn hơn ngày hiện tại!");
                return;
            }

            args.IsValid = true;
        }
示例#26
0
 protected void LinkAddNgayDang_Click(object sender, EventArgs e)
 {
     if (!_isRefresh)
     {
         if (txtNgaybatdau.Text.Trim() == "")
         {
             FuncAlert.AlertJS(this, "Bạn chưa chọn ngày đăng QC");
             return;
         }
         if (UltilFunc.ToDate(this.txtNgaybatdau.Text, "dd/MM/yyyy") < DateTime.Now)
         {
             FuncAlert.AlertJS(this, "Ngày đăng quảng cáo phải lớn hơn ngày hiện tại!");
             return;
         }
         if (cboAnPham.SelectedIndex == 0)
         {
             FuncAlert.AlertJS(this, "Bạn chưa chọn loại báo");
             return;
         }
         string    _sql = " set dateformat dmy select Ma_Sobao from T_Sobao where Ngay_Xuatban='" + txtNgaybatdau.Text.Trim() + "' and Ma_AnPham=" + cboAnPham.SelectedValue;
         DataTable _dt  = _ulti.ExecSqlDataSet(_sql).Tables[0];
         if (_dt.Rows.Count > 0 && _dt != null)
         {
             T_Publish_QuangCao _obj = new T_Publish_QuangCao();
             _obj.ID = 0;
             if (Request["ID"] != null)
             {
                 _obj.Quangcao_ID = int.Parse(Request["ID"].ToString());
             }
             else
             {
                 _obj.Quangcao_ID = 0;
             }
             _obj.Ma_Loaibao = int.Parse(cboAnPham.SelectedValue);
             _obj.Ma_Sobao   = int.Parse(_dt.Rows[0]["Ma_Sobao"].ToString());
             _obj.Trang      = int.Parse(cboTrang.SelectedValue);
             _obj.Ngaydang   = UltilFunc.ToDate(txtNgaybatdau.Text.Trim(), "dd/MM/yyyy");
             _obj.Nguoitao   = _user.UserID;
             dal.Sp_InsertT_Publish_QuangCao(_obj);
             ListNgaydangQC();
         }
         else
         {
             FuncAlert.AlertJS(this, "Không có số báo nào thuộc ngày đăng này!");
             return;
         }
     }
 }
示例#27
0
 protected void LinkAddNgayDang_Click(object sender, EventArgs e)
 {
     if (!_isRefresh)
     {
         if (txtNgaybatdau.Text.Trim() == "")
         {
             FuncAlert.AlertJS(this, CommonLib.ReadXML("lblBanchuachonngaydangquangcao"));
             return;
         }
         if (UltilFunc.ToDate(this.txtNgaybatdau.Text, "dd/MM/yyyy") < DateTime.Now)
         {
             FuncAlert.AlertJS(this, CommonLib.ReadXML("lblCanhbaongaydangQCphailonhonngayhientai"));
             return;
         }
         if (cboAnPham.SelectedIndex == 0)
         {
             FuncAlert.AlertJS(this, CommonLib.ReadXML("lblBanchuachonanpham"));
             return;
         }
         string    _sql = " set dateformat dmy select Ma_Sobao from T_Sobao where Ngay_Xuatban='" + txtNgaybatdau.Text.Trim() + "' and Ma_AnPham=" + cboAnPham.SelectedValue;
         DataTable _dt  = _ulti.ExecSqlDataSet(_sql).Tables[0];
         if (_dt.Rows.Count > 0 && _dt != null)
         {
             T_Publish_QuangCao _obj = new T_Publish_QuangCao();
             _obj.ID = 0;
             if (Request["ID"] != null)
             {
                 _obj.Quangcao_ID = int.Parse(Request["ID"].ToString());
             }
             else
             {
                 _obj.Quangcao_ID = 0;
             }
             _obj.Ma_Loaibao = int.Parse(cboAnPham.SelectedValue);
             _obj.Ma_Sobao   = int.Parse(_dt.Rows[0]["Ma_Sobao"].ToString());
             _obj.Trang      = int.Parse(cboTrang.SelectedValue);
             _obj.Ngaydang   = UltilFunc.ToDate(txtNgaybatdau.Text.Trim(), "dd/MM/yyyy");
             _obj.Nguoitao   = _user.UserID;
             dal.Sp_InsertT_Publish_QuangCao(_obj);
             ListNgaydangQC();
         }
         else
         {
             FuncAlert.AlertJS(this, CommonLib.ReadXML("lblCanhbaongaydangQC"));
             return;
         }
     }
 }
示例#28
0
        protected void Save_Click(object sender, EventArgs e)
        {
            string Thaotac = string.Empty;

            this.Page.Validate(vs_Themmoi.ValidationGroup);
            if (!Page.IsValid)
            {
                return;
            }
            ChuyenmucDAL _ChuyenMucDAL = new ChuyenmucDAL();
            T_ChuyenMuc  _ChuyenMuc    = SetItem();

            if (cbo_Anpham.SelectedIndex == 0)
            {
                FuncAlert.AlertJS(this, "Bạn chưa chọn ấn phẩm!");
                return;
            }
            else
            {
                int menuID = 0;
                if (Request["ID"] != null && Request["ID"].ToString() != "" && Request["ID"].ToString() != String.Empty)
                {
                    menuID = int.Parse(Request["ID"].ToString());
                }
                int _return = _ChuyenMucDAL.Insert_T_Chuyenmuc(_ChuyenMuc);
                // DONG BO FILE
                _ChuyenMuc = _ChuyenMucDAL.GetOneFromT_ChuyenmucByID(_return);
                SynFiles _syncfile = new SynFiles();
                if (_ChuyenMuc.Anh_ChuyenMuc.Length > 0)
                {
                    _syncfile.SynData_UploadImgOne(_ChuyenMuc.Anh_ChuyenMuc, HPCComponents.Global.ImagesService);
                }
                //END
                if (Page.Request.Params["id"] == null)
                {
                    Thaotac = "[Thêm mới Chuyên mục]-->[mã chuyên mục:" + _return.ToString() + " ]";
                    Clear();
                    BindCombo();
                }
                if (Page.Request.Params["id"] != null)
                {
                    Thaotac = "[Sửa chuyên mục]-->[Mã chuyên mục:" + Page.Request["id"].ToString() + " ]";
                    Clear();
                    BindCombo();
                }
            }
        }
示例#29
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (txtName.Text == "")
     {
         FuncAlert.AlertJS(this, "Bạn chưa nhập tên mẫu");
         return;
     }
     if (Page.IsValid)
     {
         PreviewTemplateDAL _PrevDAL = new PreviewTemplateDAL();
         Prev_Template      _PrevObj = SetItem();
         int _return = _PrevDAL.InsertT_PrevTemplate(_PrevObj);
         FuncAlert.AlertJS(this, "Cập nhật thành công");
         LoadData();
         Reset();
     }
 }
示例#30
0
 protected void cboPage_OnSelectedIndexChanged(object sender, EventArgs e)
 {
     if (cbo_Anpham.SelectedIndex == 0)
     {
         FuncAlert.AlertJS(this, (string)HttpContext.GetGlobalResourceObject("cms.language", "lblBanchuachonanpham"));
         return;
     }
     if (cboSoBao.SelectedIndex > 0)
     {
         LoadData_FilePDF();
     }
     else
     {
         FuncAlert.AlertJS(this, (string)HttpContext.GetGlobalResourceObject("cms.language", "lblBanchuachonsobao"));
         return;
     }
 }