示例#1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var abo    = new BO.ActionBO();
            var action = new Models.WebAction();

            action.ActionName = txtActionName.Text;
            abo.Add(action);
        }
        void BindActions()
        {
            var abo = new BO.ActionBO();
            var lst = abo.GetQueryable().ToList();
            var bs  = new BindingSource();

            bs.DataSource        = lst;
            dgActions.DataSource = bs;
        }
示例#3
0
 void InitWindow()
 {
     InitializeComponent();
     abo = new BO.ActionBO();
     lbo = new BO.ElementLabelBO();
     dgLabels.AutoGenerateColumns = false;
     dgLabels.SelectionMode       = DataGridViewSelectionMode.FullRowSelect;
     dgLabels.CellClick          += DgLabels_CellClick;
     dgLabels.ReadOnly            = true;
 }
示例#4
0
        public FrmLabelEditor(Models.ElementLabel lbl)
        {
            InitializeComponent();
            elbo = new BO.ElementLabelBO();
            if (lbl.LabelId == 0)
            {
                _lbl = new Models.ElementLabel();
            }
            else
            {
                _lbl          = elbo.GetLabel(lbl.LabelId);
                _lbl.ActionId = lbl.ActionId;
            }
            var abo = new BO.ActionBO();

            _action = abo.GetAction(_lbl.ActionId);
        }
示例#5
0
        void RunCrawler()
        {
            Models.WebAction actGetHtml, actClickSearch, actEnterData, actBrowse, actWebRoomTypes,
                             actClickCmbRoomTypes;
            var abo = new BO.ActionBO();

            actGetHtml           = abo.GetAction(22);
            actClickSearch       = abo.GetAction(21);
            actEnterData         = abo.GetAction(20);
            actBrowse            = abo.GetAction(18);
            actWebRoomTypes      = abo.GetAction(38);
            actClickCmbRoomTypes = abo.GetAction(39);
            objGetHtml           = new Objects.WebActionObject(actGetHtml);
            objClick             = new Objects.WebActionObject(actClickSearch);
            objEnterData         = new Objects.WebActionObject(actEnterData);
            objBrowse            = new Objects.WebActionObject(actBrowse);
            objGetWebRoomTypes   = new Objects.WebActionObject(actWebRoomTypes);
            objClickCmbRoomTypes = new Objects.WebActionObject(actClickCmbRoomTypes);
            objBrowse._wk        = objGetHtml._wk = objEnterData._wk = objEnterData._wk = objClick._wk = _wk;
            foreach (var h in _selectedHotels)
            {
                if (string.IsNullOrEmpty(h.HMSID))
                {
                    MessageBox.Show("null or empty hmsId for hotel " + h.HotelName);
                }
            }
            for (int i = 0; i < _selectedHotels.Count; i++)
            {
                if (_wk.CancellationPending)
                {
                    break;
                }
                CrawlSingleHotel(_selectedHotels[i]);
            }
            var bld = new StringBuilder();

            if (bld.Length > 0)
            {
                _wk.ReportProgress(0, Environment.NewLine + bld.ToString());

                /* Nov 27: Text just not display
                 * Console.WriteLine(bld.ToString());
                 * var viewer = new frmStringViewer(bld.ToString());
                 * viewer.Show();*/
            }
        }