public override void DeleteItemData(object value) { XapDataList <EmsOrDrug> itemList = this.GetTableDataSource() as XapDataList <EmsOrDrug>; if (itemList.Count(p => !p.IsDELETED) > 0) { EmsOrDrug item = value as EmsOrDrug; itemList.Delete(item, item.IsNEW); } // 如果模型中数据列表为空,则新建一个空数据 if (GetCountWithOutDelete() == 0) { SetSelectedObject(AddNew()); this.uiEmsDTO.Emsdrugs.Fg_self = null; this.uiEmsDTO.Emsdrugs.Fg_selfpay = null; this.uiEmsDTO.Emsdrugs.Fg_treat = null; this.uiEmsDTO.Emsdrugs.Fg_propc = null; this.uiEmsDTO.Emsdrugs.Fg_mp_in = null; this.uiEmsDTO.Emsdrugs.Id_routedes = null; this.uiEmsDTO.Emsdrugs.Name_routedes = null; this.uiEmsDTO.Emsdrugs.Note_or = null; } // 当前选中对象为最后一个可显示的有效数据 else { SetSelectedObject(itemList.LastOrDefault(p => !p.IsDELETED)); } }
protected bool CheckRepeatFeeSrv(CiOrdFeeSrvDTO feeSrv) { return(tableDatasource.Count(p => !p.IsDELETED && p.Id_or.Equals(feeSrv.Id_or) && p.Id_srv.Equals(feeSrv.Id_srv)) > 1); }
public bool HasSameFeeSrv(EmsOrDrug newDrug) { return(tableDataSource.Count(p => !p.IsDELETED && p.Id_srv.Equals(newDrug.Id_srv)) > 1); // 包含自身情况 }