Ejemplo n.º 1
0
 /// <summary>
 /// 绑定文本
 /// </summary>
 private void BindText(ApplyPlace model)
 {
     txt_ApplyPlaceCode.EditValue = model.ApplyPlaceCode;
     txt_ApplyPlaceName.EditValue = model.ApplyPlaceName;
     txt_MnemonicCode.EditValue   = model.MnemonicCode;
     txt_Note.EditValue           = model.Note;
 }
Ejemplo n.º 2
0
 void Add()
 {
     this.formState = FormState.New;
     _ApplyPlace    = new ApplyPlace();
     _list.Add(_ApplyPlace);
     this.gc_ApplyPlace.RefreshDataSource();
     this.gv_ApplyPlace.FocusedRowHandle = _list.Count - 1;
     BindText(_ApplyPlace);
 }
Ejemplo n.º 3
0
 /// <summary>
 ///     值改变
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void cLookUp_EditValueChanged(object sender, EventArgs e)
 {
     if (ListIsValid == null)
     {
         return;
     }
     Currentapplyplace = EditValue == null
            ? null
            : ListIsValid.Find(model => model.ApplyPlaceID == Convert.ToInt32(EditValue));
 }
Ejemplo n.º 4
0
 private void BindData()
 {
     _list = new ApplyPlaceDAO().GetList();
     this.gc_ApplyPlace.DataSource = _list;
     this.gc_ApplyPlace.RefreshDataSource();
     _listCopy = new List <ApplyPlace>();
     _listCopy.AddRange(_list.Select(item => (ApplyPlace)item.Copy()));
     if (_list.Count > 0)
     {
         BindText(_list[0]);
         _ApplyPlace = _list[0];
     }
     isinit = true;
 }
Ejemplo n.º 5
0
 void gv_ApplyPlace_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     if (formState == FormState.New)
     {
         this.gv_ApplyPlace.DeleteRow(_list.Count - 1);
         this._list.Remove(_ApplyPlace);
     }
     formState   = FormState.Modify;
     _ApplyPlace = this.gv_ApplyPlace.GetFocusedRow() as ApplyPlace;
     if (_ApplyPlace == null)
     {
         return;
     }
     switch (e.Clicks)
     {
     case 1:
         BindText(_ApplyPlace);
         break;
     }
 }