/// <summary> /// 绑定gridColumn校区 /// </summary> /// <param name="col">gridColumn列</param> public static void BindGridSchoolZone(this GridColumn col) { if (col == null || col.View.GridControl == null) { throw new ArgumentNullException("col"); } var lk = new CSmartRepositoryItemLookupEdit(); lk.TextEditStyle = TextEditStyles.Standard; var info = new LookUpColumnInfo("SchoolZoneCode", "编号"); lk.Columns.Add(info); info = new LookUpColumnInfo("SchoolZoneName", "校区"); lk.Columns.Add(info); var listIsValid = (List <SchoolZone>)ClientCache.GetAuto("SchoolZone", () => new SchoolZoneDao().GetList()); lk.DataSource = listIsValid; lk.DisplayMember = "SchoolZoneName"; lk.ValueMember = "SchoolZoneID"; lk.NullText = ""; lk.ShowHeader = true; lk.PopupWidth = 150; col.View.GridControl.RepositoryItems.Add(lk); col.ColumnEdit = lk; }
/// <summary> /// 绑定下拉控件数据集 /// </summary> public void BindList(int TrainPlaceID = 0, bool getFromCache = true) { _TrainPlaceID = TrainPlaceID; if (_TrainPlaceID != 0) { if (getFromCache) { ListIsValid = (List <School>)ClientCache.GetAuto("School" + TrainPlaceID, () => new SchoolDao().GetListByTrainPlace(TrainPlaceID)); } else { ListIsValid = (List <School>)ClientCache.GetUpdate("School" + TrainPlaceID, () => new SchoolDao().GetListByTrainPlace(TrainPlaceID)); } } else { if (getFromCache) { ListIsValid = (List <School>)ClientCache.GetAuto("School", () => new SchoolDao().GetAllList()); } else { ListIsValid = (List <School>)ClientCache.GetUpdate("School", () => new SchoolDao().GetAllList()); } } Properties.DataSource = ListIsValid; Properties.DisplayMember = "SchoolName"; Properties.ValueMember = "SchoolID"; Properties.BestFitMode = BestFitMode.BestFitResizePopup; Properties.SearchMode = SearchMode.AutoFilter; Properties.CaseSensitiveSearch = true; Properties.AutoSearchColumnIndex = 2; }
/// <summary> /// 绑定下拉控件数据集 /// </summary> public void BindList(int SchoolID = 0, bool getFromCache = true) { if (getFromCache) { if (SchoolID == 0) { ListIsValid = (List <Car>)ClientCache.GetAuto("Car" + SchoolID, () => new CarDAO().GetList()); } else { ListIsValid = (List <Car>)ClientCache.GetAuto("Car" + SchoolID, () => new CarDAO().GetListBySchool(SchoolID)); } } else { if (SchoolID == 0) { ListIsValid = (List <Car>)ClientCache.GetUpdate("Car" + SchoolID, () => new CarDAO().GetList()); } else { ListIsValid = (List <Car>)ClientCache.GetUpdate("Car" + SchoolID, () => new CarDAO().GetListBySchool(SchoolID)); } } Properties.DataSource = ListIsValid; Properties.DisplayMember = "CarNo"; Properties.ValueMember = "CarID"; Properties.BestFitMode = BestFitMode.BestFitResizePopup; Properties.SearchMode = SearchMode.AutoFilter; Properties.CaseSensitiveSearch = true; Properties.AutoSearchColumnIndex = 2; }
/// <summary> /// 绑定gridColumn职位 /// </summary> /// <param name="col">gridColumn列</param> /// <param name="bindType">类型</param> public static void BindGridDuty(this GridColumn col) { if (col == null) { throw new ArgumentNullException("GridColumn is null"); } if (col.View.GridControl == null) { throw new ArgumentNullException("GridColumn.View.GridControl is null!"); } CSmartRepositoryItemLookupEdit lk = new CSmartRepositoryItemLookupEdit(); lk.TextEditStyle = TextEditStyles.Standard; LookUpColumnInfo info = new LookUpColumnInfo("DutyCode", "编号"); lk.Columns.Add(info); info = new LookUpColumnInfo("DutyName", "名称"); lk.Columns.Add(info); info = new LookUpColumnInfo("MnemonicCode", "助记码"); lk.Columns.Add(info); List <Duty> ListIsValid = (List <Duty>)ClientCache.GetAuto("Duty", () => new DutyDao().GetList()); lk.DataSource = ListIsValid; lk.DisplayMember = "DutyName"; lk.ValueMember = "DutyID"; lk.NullText = ""; lk.ShowHeader = true; lk.PopupWidth = 200; col.View.GridControl.RepositoryItems.Add(lk); col.ColumnEdit = lk; }
/// <summary> /// 绑定下拉控件数据集 /// </summary> public void BindList(bool getFromCache = true) { if (getFromCache) { ListIsValid = (List <ChargeType>)ClientCache.GetAuto("ChargeType", () => new ChargeTypeDAO().GetList()); } else { ListIsValid = (List <ChargeType>)ClientCache.GetUpdate("ChargeType", () => new ChargeTypeDAO().GetList()); } Properties.TreeList.DataSource = ListIsValid; Properties.TreeList.KeyFieldName = "ChargeTypeID"; Properties.TreeList.ParentFieldName = "ParentChargeTypeID"; Properties.DisplayMember = "ChargeTypeName"; Properties.ValueMember = "ChargeTypeID"; Properties.TreeList.RefreshDataSource(); Properties.DataSource = ListIsValid; Properties.TreeList.ExpandToLevel(1); if (ListIsValid.Count > 0) { Properties.BestFitMode = BestFitMode.BestFitResizePopup; } }
/// <summary> /// 绑定下拉控件数据集 /// </summary> public void BindList(bool getFromCache = true) { ListIsValid = (List <ExamPlace>)ClientCache.GetAuto("ExamPlace", () => new ExamPlaceDao().GetList()); Properties.DataSource = ListIsValid; Properties.DisplayMember = "ExamPlaceName"; Properties.ValueMember = "ExamPlaceID"; Properties.BestFitMode = BestFitMode.BestFitResizePopup; Properties.SearchMode = SearchMode.AutoFilter; Properties.CaseSensitiveSearch = true; Properties.AutoSearchColumnIndex = 2; }
public void BindList(bool getFromCache = true) { if (getFromCache) { ListIsValid = (List <TrainPlace>)ClientCache.GetAuto("TrainPlace", () => new TrainPlaceDAO().GetList()); } else { ListIsValid = (List <TrainPlace>)ClientCache.GetUpdate("TrainPlace", () => new TrainPlaceDAO().GetList()); } foreach (TrainPlace item in ListIsValid) { Properties.Items.Add(item.TrainPlaceName); } }
/// <summary> /// 绑定下拉控件数据集 /// </summary> public void BindListZY(int schoolId = 0, int trainPlaceId = 0, bool getFromCache = true) { _schoolID = schoolId; _trainPlaceID = trainPlaceId; var cacheName = "Group"; if (schoolId > 0) { cacheName += "#Sch_" + schoolId; } if (trainPlaceId > 0) { cacheName += "#Tp_" + trainPlaceId; } ClientCache.GetDataMethod method; if (schoolId > 0 && trainPlaceId > 0) { method = () => new GroupDao().GetListByPlaceSchool(trainPlaceId, schoolId); } else if (schoolId > 0) { method = () => new GroupDao().GetListByTrainPlace(trainPlaceId); } else if (trainPlaceId > 0) { method = () => new GroupDao().GetListBySchool(schoolId); } else { method = () => new GroupDao().GetList(); } ListIsValid = (List <Group>)(getFromCache ? ClientCache.GetAuto(cacheName, method) : ClientCache.GetUpdate(cacheName, method)); ListIsValid.RemoveAll(m => m.GroupType == "挂靠"); Properties.DataSource = ListIsValid; Properties.DisplayMember = "GroupName"; Properties.ValueMember = "GroupID"; Properties.BestFitMode = BestFitMode.BestFitResizePopup; Properties.SearchMode = SearchMode.AutoFilter; Properties.CaseSensitiveSearch = true; Properties.AutoSearchColumnIndex = 2; }
/// <summary> /// 绑定下拉控件数据集 /// </summary> public void BindList(bool getFromCache = true) { if (getFromCache) { ListIsValid = (List <From>)ClientCache.GetAuto("From", () => new FromDAO().GetList()); } else { ListIsValid = (List <From>)ClientCache.GetUpdate("From", () => new FromDAO().GetList()); } Properties.DataSource = ListIsValid; Properties.DisplayMember = "FromName"; Properties.ValueMember = "FromID"; Properties.BestFitMode = BestFitMode.BestFitResizePopup; Properties.SearchMode = SearchMode.AutoFilter; Properties.CaseSensitiveSearch = true; Properties.AutoSearchColumnIndex = 2; }
/// <summary> /// 绑定下拉控件数据集 /// </summary> public void BindList(bool getFromCache = true) { if (getFromCache) { ListIsValid = (List <ApplyPlace>)ClientCache.GetAuto("ApplyPlace", () => new ApplyPlaceDAO().GetList()); } else { ListIsValid = (List <ApplyPlace>)ClientCache.GetUpdate("ApplyPlace", () => new ApplyPlaceDAO().GetList()); } ListIsValid = ListIsValid.FindAll(m => m.State); Properties.DataSource = ListIsValid; Properties.DisplayMember = "ApplyPlaceName"; Properties.ValueMember = "ApplyPlaceID"; Properties.BestFitMode = BestFitMode.BestFitResizePopup; Properties.SearchMode = SearchMode.AutoFilter; Properties.CaseSensitiveSearch = true; Properties.AutoSearchColumnIndex = 2; }
public void BindList(int SchoolID = 0, int TrainPlaceID = 0, bool getFromCache = true) { if (getFromCache) { if (SchoolID > 0 && TrainPlaceID > 0) { ListIsValid = (List <Group>)ClientCache.GetAuto("Group" + SchoolID + TrainPlaceID, () => new GroupDao().GetListByPlaceSchool(TrainPlaceID, SchoolID)); } else { if (TrainPlaceID > 0) { ListIsValid = (List <Group>) ClientCache.GetAuto("Group" + SchoolID + TrainPlaceID, () => new GroupDao().GetListByTrainPlace(TrainPlaceID)); } else { if (SchoolID > 0) { ListIsValid = (List <Group>)ClientCache.GetAuto("Group" + SchoolID + TrainPlaceID, () => new GroupDao().GetListBySchool(SchoolID)); } else { ListIsValid = (List <Group>)ClientCache.GetAuto("Group" + SchoolID + TrainPlaceID, () => new GroupDao().GetList()); } } } } else { if (SchoolID > 0 && TrainPlaceID > 0) { ListIsValid = (List <Group>)ClientCache.GetUpdate("Group" + SchoolID + TrainPlaceID, () => new GroupDao().GetListByPlaceSchool(TrainPlaceID, SchoolID)); } else { if (TrainPlaceID > 0) { ListIsValid = (List <Group>) ClientCache.GetUpdate("Group" + SchoolID + TrainPlaceID, () => new GroupDao().GetListByTrainPlace(TrainPlaceID)); } else { if (SchoolID > 0) { ListIsValid = (List <Group>)ClientCache.GetUpdate("Group" + SchoolID + TrainPlaceID, () => new GroupDao().GetListBySchool(SchoolID)); } else { ListIsValid = (List <Group>)ClientCache.GetUpdate("Group" + SchoolID + TrainPlaceID, () => new GroupDao().GetList()); } } } } Properties.DataSource = ListIsValid; Properties.DisplayMember = "GroupName"; Properties.ValueMember = "GroupID"; Properties.BestFitMode = BestFitMode.BestFitResizePopup; Properties.SearchMode = SearchMode.AutoFilter; Properties.CaseSensitiveSearch = true; Properties.AutoSearchColumnIndex = 2; }