/// <summary> /// 海量数据插入方法 /// </summary> /// <typeparam name="db"></typeparam> /// <typeparam name="entityType">实体类型名称</typeparam> /// <param name="list"></param> public virtual void AddByBulkCopy(DbContext db, Type entityType, IList list) { DataSet ds = IListDataSet.ToDataSet(list); if (ds.Tables.Count > 0) { AddByBulkCopy((SqlConnection)db.Database.Connection, ds.Tables[0], entityType.Name); } }
public void BindData(object list) { usersInfoBindingSource.DataSource = BLLFty.Create <BaseBLL>().GetListByNoTracking <UsersInfo>(o => o.IsDel == false && !string.IsNullOrEmpty(o.Password)); dsPermission = IListDataSet.ToDataSet <Permission>(BLLFty.Create <BaseBLL>().GetListBy <Permission>(o => o.UserID == MainForm.usersInfo.ID)); if (dsPermission.Tables[0].Rows.Count > 0) { cuTreeListPermission.DataSource = dsPermission.Tables[0]; cuTreeListPermission.CheckedStateFieldName = "CheckBoxState"; cuTreeListPermission.Columns["Caption"].Caption = "功能名称"; cuTreeListPermission.Columns["Caption"].OptionsColumn.AllowEdit = false; cuTreeListPermission.Columns["SerialNo"].Visible = false; cuTreeListPermission.Columns["UserID"].Visible = false; cuTreeListPermission.Columns["CheckBoxState"].Visible = false; } }
private DataTable ListToDataTable() { string[] PropertyName = new string[43]; int PropertyNum = 0; tlsTtResultSecond Rs = new tlsTtResultSecond(); Type t = Rs.GetType(); foreach (PropertyInfo pi in t.GetProperties()) { PropertyName[PropertyNum] = pi.Name; PropertyNum++; } DataSet dto = IListDataSet.ToDataSet <tlsTtResultSecond>(_selectedRecords, PropertyName); return(dto.Tables[0]); }
void GetPermission(object sender) { UsersInfo user = ((DevExpress.XtraGrid.Views.Layout.LayoutView)sender).GetFocusedRow() as UsersInfo; if (user != null) { dsPermission = IListDataSet.ToDataSet <Permission>(BLLFty.Create <BaseBLL>().GetListBy <Permission>(o => o.UserID == user.ID)); cuTreeListPermission.DataSource = dsPermission.Tables[0]; cuTreeListPermission.ExpandAll(); foreach (TreeListNode node in cuTreeListPermission.GetNodeList()) { DataRowView drv = cuTreeListPermission.GetDataRecordByNode(node) as DataRowView; if (drv != null) { node.Checked = (bool)drv["CheckBoxState"]; } } buttonPermissionBindingSource.DataSource = btnPermissionList = BLLFty.Create <BaseBLL>().GetListBy <ButtonPermission>(o => o.UserID == user.ID); } }