/// <summary>
 /// 绑定文本
 /// </summary>
 private void BindText(TakePlace model)
 {
     txt_TakePlaceCode.EditValue = model.TakePlaceCode;
     txt_TakePlaceName.EditValue = model.TakePlaceName;
     txt_MnemonicCode.EditValue  = model.MnemonicCode;
     txt_Note.EditValue          = model.Note;
 }
 void Add()
 {
     this.formState = FormState.New;
     _TakePlace     = new TakePlace();
     _list.Add(_TakePlace);
     this.gc_TakePlace.RefreshDataSource();
     this.gv_TakePlace.FocusedRowHandle = _list.Count - 1;
     BindText(_TakePlace);
 }
 /// <summary>
 ///     值改变
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void cLookUp_EditValueChanged(object sender, EventArgs e)
 {
     if (ListIsValid == null)
     {
         return;
     }
     Currenttakeplace = EditValue == null
            ? null
            : ListIsValid.Find(model => model.TakePlaceID == Convert.ToInt32(EditValue));
 }
 private void BindData()
 {
     _list = new TakePlaceDAO().GetList();
     this.gc_TakePlace.DataSource = _list;
     this.gc_TakePlace.RefreshDataSource();
     _listCopy = new List <TakePlace>();
     _listCopy.AddRange(_list.Select(item => (TakePlace)item.Copy()));
     if (_list.Count > 0)
     {
         BindText(_list[0]);
         _TakePlace = _list[0];
     }
     isinit = true;
 }
        public void TestNumberOfPeople()
        {
            IWebDriver Browser = new ChromeDriver();

            Browser.Navigate().GoToUrl("https://www.tutu.ru/");
            HomePage homePage = new HomePage(Browser).InpuntInformation("Санкт-Петербург", "Москва", "30.11.2019");
            Trains   trains   = new Trains(Browser).Takefirst();

            ChangeWindow(Browser);
            TakePlace takePlace = new TakePlace(Browser).ChoosePlace();

            Assert.AreEqual("Вы не выбрали ни одного пассажира", homePage.GetError());
            Browser.Quit();
        }
 void gv_TakePlace_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     if (formState == FormState.New)
     {
         this.gv_TakePlace.DeleteRow(_list.Count - 1);
         this._list.Remove(_TakePlace);
     }
     formState  = FormState.Modify;
     _TakePlace = this.gv_TakePlace.GetFocusedRow() as TakePlace;
     if (_TakePlace == null)
     {
         return;
     }
     switch (e.Clicks)
     {
     case 1:
         BindText(_TakePlace);
         break;
     }
 }