Example #1
0
        public void CaiDatTrang(TrangWeb trang)
        {
            _trang = trang;
            _db    = new DatabaseManager(trang);
            for (int i = 0; i < _db.DanhSachNoiDung.Count; i++)
            {
                this.ThemNoiDung(_db.DanhSachTieuDe[i], _db.DanhSachNoiDung[i]);
            }
            if (_db.DanhSachNoiDung.Count == 0)
            {
                this.ThemNoiDung();
            }

            Program.XayRaLoi += Program_XayRaLoi;

            thongTinTaiKhoan_GuiBindingSource.DataSource     = _db.DanhSachNguoiGui;
            thongTinTaiKhoan_TimKiemBindingSource.DataSource = _db.DanhSachNguoiNhan;
            grbTimKiem.Text = _db.PhienTimKiem;

            lblSoLuongKetQua.Text = string.Format("Số lượng kết quả: {0}", thongTinTaiKhoan_TimKiemBindingSource.Count);

            switch (trang)
            {
            case TrangWeb.WebTreTho:
                _guiTinNhan = new GuiTinNhanWebTreTho();
                break;
            }
        }
Example #2
0
 public int this[TrangWeb site]
 {
     get
     {
         return(LayGioiHan(site));
     }
 }
Example #3
0
        public static string GetDefaultFileDatabase(TrangWeb site)
        {
            switch (site)
            {
            case TrangWeb.HenHo2:
                return("Data\\henho2.tvwp");

            case TrangWeb.DuyenSo:
                return("Data\\duyenso.tvwp");

            case TrangWeb.VietNamCupid:
                return("Data\\VietNamCupid.tvwp");

            case TrangWeb.LikeYou:
                return("Data\\LikeYou.tvwp");

            case TrangWeb.HenHoKetBan:
                return("Data\\HenHoKetBan.tvwp");

            case TrangWeb.TimBanGai:
                return("Data\\TimBanGai.tvwp");

            case TrangWeb.ThongTinNguoiDung:
                return("Data\\DanhSachNguoiDung.tvwp");

            case TrangWeb.eHenHo:
                return("Data\\eHenHo.tvwp");

            default:
                throw new Exception("Chưa cài đặt CSDL cho trang này");
            }
        }
        public async Task Init(string email, string ho_ten, TrangWeb trang_web, List <Tuple <string, string> > gioi_tinh, int selected_gioi_tinh)
        {
            switch (trang_web)
            {
            case TrangWeb.HenHo2:
                this.TuDongDangKy = new TuDongDangKyHenHo2();
                break;

            case TrangWeb.DuyenSo:
                this.TuDongDangKy = new TuDongDangKyDuyenSo();
                break;

            case TrangWeb.eHenHo:
                this.TuDongDangKy        = new TuDongDangKyEHenho();
                txtKetQuaCaptcha.Text    = "k cần";
                txtKetQuaCaptcha.Enabled = false;
                break;
            }
            _gioiTinh        = gioi_tinh;
            picCaptcha.Image = await TuDongDangKy?.CaptchaAsync();

            this.Email       = email;
            this.HoTen       = ho_ten;
            lblTaiKhoan.Text = $"{email} - {ho_ten}";
            XuLyDaLuong.ChangeText(lblTrangThai, "Chờ nhập captcha", Color.Blue);
            if (_gioiTinh != null)
            {
                foreach (var gt in _gioiTinh)
                {
                    cbbGioiTinh.Items.Add(gt.Item1);
                }
            }
            cbbGioiTinh.SelectedIndex = selected_gioi_tinh;
        }
Example #5
0
 public static int LayGioiHan(TrangWeb site)
 {
     switch (site)
     {
     case TrangWeb.HenHo2:
         return(1000);
     }
     return(-1);
 }
Example #6
0
        public void CaiDatTrang(TrangWeb trang)
        {
            _trang = trang;
            _db    = new DatabaseManager(trang);
            for (int i = 0; i < _db.DanhSachNoiDung.Count; i++)
            {
                this.ThemNoiDung(_db.DanhSachTieuDe[i], _db.DanhSachNoiDung[i]);
            }
            if (_db.DanhSachNoiDung.Count == 0)
            {
                this.ThemNoiDung();
            }

            Program.XayRaLoi += Program_XayRaLoi;

            thongTinTaiKhoan_GuiBindingSource.DataSource     = _db.DanhSachNguoiGui;
            thongTinTaiKhoan_TimKiemBindingSource.DataSource = _db.DanhSachNguoiNhan;
            grbTimKiem.Text = _db.PhienTimKiem;

            lblSoLuongKetQua.Text = string.Format("Số lượng kết quả: {0}", thongTinTaiKhoan_TimKiemBindingSource.Count);

            switch (trang)
            {
            case TrangWeb.HenHo2:
                _guiTinNhan = new HenHo2();
                break;

            case TrangWeb.DuyenSo:
                _guiTinNhan       = new DuyenSo();
                radCheDo2.Checked = true;
                this.AnTieuDe();
                break;

            case TrangWeb.VietNamCupid:
                _guiTinNhan = new VietNamCupid();
                break;

            case TrangWeb.LikeYou:
                _guiTinNhan = new LikeYou();
                this.AnTieuDe();
                break;

            case TrangWeb.HenHoKetBan:
                _guiTinNhan = new HenHoKetBan();
                break;

            case TrangWeb.TimBanGai:
                _guiTinNhan = new TimBanGai();
                break;

            case TrangWeb.eHenHo:
                _guiTinNhan = new ehenho();
                (_guiTinNhan as ehenho).TimThayKetQua += (danh_sach) => { _danhSach = new BindingList <ThongTinTaiKhoan>(danh_sach.ToList()); XuLyDaLuong.ChangeText(lblSoLuongKetQua, $"Số lượng kết quả: {_danhSach.Count}", Color.Black); };
                break;
            }
        }
        public static string GetDefaultFileDatabase(TrangWeb site)
        {
            switch (site)
            {
            case TrangWeb.WebTreTho:
                return("Data\\WebTreTho.tttf");

            default:
                throw new Exception("Chưa cài đặt CSDL cho trang này");
            }
        }
        public frmTuDongDangKyTaiKhoan(TrangWeb trang)
        {
            InitializeComponent();
            _trang = trang;
            this.DanhSachTaiKhoanDaDangKy = new List <ThongTinTaiKhoan>();
            switch (trang)
            {
            case TrangWeb.HenHo2:
                _gioiTinh = new List <Tuple <string, string> >()
                {
                    new Tuple <string, string>("Nam", "0"),
                    new Tuple <string, string>("Nữ", "1"),
                    new Tuple <string, string>("Gay", "2"),
                    new Tuple <string, string>("Les", "3")
                };
                break;

            case TrangWeb.DuyenSo:
                _gioiTinh = new List <Tuple <string, string> >()
                {
                    new Tuple <string, string>("Nam", "1"),
                    new Tuple <string, string>("Nữ", "2"),
                    new Tuple <string, string>("Gay", "3"),
                    new Tuple <string, string>("Les", "4")
                };
                break;

            case TrangWeb.eHenHo:
                _gioiTinh = new List <Tuple <string, string> >()
                {
                    new Tuple <string, string>("Nam", "male"),
                    new Tuple <string, string>("Nữ", "female")
                };
                break;
            }
            foreach (var gt in _gioiTinh)
            {
                cbbGioiTinh.Items.Add(gt.Item1);
            }
            cbbGioiTinh.SelectedIndex = 0;
            #region Tùy chỉnh các thông số
            //Di chuyển form khi mà di chuyển các điểu khiển sau
            ControlPlus.MovieFormWhenMouseDownControl(topPanel, this.Handle);
            ControlPlus.MovieFormWhenMouseDownControl(formNameLabel, this.Handle);
            ControlPlus.MovieFormWhenMouseDownControl(bottomPanel, this.Handle);
            ControlPlus.MovieFormWhenMouseDownControl(statusLabel, this.Handle);
            ControlPlus.MovieFormWhenMouseDownControl(infoLabel, this.Handle);
            //flatStyle1 = new Controls.FlatStyle(this);
            //flatStyle1.Style = Style.Dark;
            //Cho phép thay đổi kích thước form khi di chuột vào góc form
            this.AllowResize = true;
            this.Text        = formNameLabel.Text;
            #endregion
        }
        public frmTimKiemBrowser(TrangWeb trang)
        {
            InitializeComponent();

            _trang = trang;


            ControlPlus.MovieFormWhenMouseDownControl(controlBoxFlat1.lblFormText, this.Handle);

            this.DanhSachTaiKhoanDuocChon = new List <ThongTinTaiKhoan>();

            switch (trang)
            {
            case TrangWeb.HenHo2:
                webBrowser1.Navigate("http://henho2.com/Home/Index?gtinh=0&countryid=237&province=-1&maritial=1&objective=2&ageFrom=&ageTo=&name=");
                break;
            }
        }
 public DatabaseManager(TrangWeb site)
 {
     _fileDataPath = GetDefaultFileDatabase(site);
     this.CreateIfNotExist();
     this.Load();
 }