public MediaInfoService(ISqlSugarClient sqlSugarClient) : base(sqlSugarClient) { this._sqlSugarClient = sqlSugarClient; }
public string SqlToClass(ISqlSugarClient db, string sql, string className) { ClassGenerating cg = new ClassGenerating(); return(cg.SqlToClass(GetDb(db), sql, className)); }
public ArticleCategoryRepository(ISqlSugarClient sqlSugarClient) : base(sqlSugarClient) { }
public void CreateClassFilesInterface(ISqlSugarClient db, bool?tableOrView, Action <DataTable, string, string> callBack) { ClassGenerating cg = new ClassGenerating(); cg.CreateClassFilesInterface(GetDb(db), tableOrView, callBack); }
public List <string> GetTableNames(ISqlSugarClient db) { ClassGenerating cg = new ClassGenerating(); return(cg.GetTableNames(GetDb(db))); }
public UnitOfWork(ISqlSugarClient sqlSugarClient) { _sqlSugarClient = sqlSugarClient; }
public void CreateClassFiles(ISqlSugarClient db, string fileDirectory, string nameSpace = null, bool?tableOrView = default(bool?), Action <string> callBack = null, Action <string> preAction = null) { ClassGenerating cg = new ClassGenerating(); cg.CreateClassFiles(GetDb(db), fileDirectory, nameSpace, tableOrView); }
public UnitOfWork(ISqlSugarClient sqlSugarClient, ILogger <UnitOfWork> logger) { _sqlSugarClient = sqlSugarClient; _logger = logger; }
public BaseRepository(ISqlSugarClient sqlSugarClient) { _db = sqlSugarClient; // EnabelSqlLog(); }
public ADServiceDb(ISqlSugarClient context, HttpContext httpContext) { Tbl_DomainInfo = new SimpleClient <DomainInfo>(context); HttpContext = httpContext; }
public MediaInfoRepository(ISqlSugarClient sqlSugarClient) : base(sqlSugarClient) { }
/// <summary> /// 获取数据库处理对象 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="db"></param> /// <returns></returns> public SimpleClient <T> GetEntityDB <T>(ISqlSugarClient db) where T : class, new() { return(new SimpleClient <T>(db)); }
/// <summary> /// ctor /// </summary> public DbContext(ISqlSugarClient db) { this._db = db; }
public BasArticleRepository(ISqlSugarClient context) : base(context) { }
public BaseRepository(IUnitOfWork unitOfWork) { Db = unitOfWork.GetSugarClient(); UnitOfWork = unitOfWork; }
public UserRepository(ISqlSugarClient sqlSugarClient) : base(sqlSugarClient) { }
public UserRepository(ISqlSugarClient db) : base(db) { }
public SystemLogService(ISqlSugarClient sqlSugarClient) : base(sqlSugarClient) { this._sqlSugarClient = sqlSugarClient; }
private SqlSugarClient GetDb(ISqlSugarClient db) { var reval = (SqlSugarClient)db.GetDb(); return(reval); }
public ProgramScheduleService(ISqlSugarClient sqlSugarClient) : base(sqlSugarClient) { this._sqlSugarClient = sqlSugarClient; }
public void CreateClassFilesByTableNames(ISqlSugarClient db, string fileDirectory, string nameSpace, params string[] tableNames) { ClassGenerating cg = new ClassGenerating(); cg.CreateClassFilesByTableNames(GetDb(db), fileDirectory, nameSpace, tableNames); }
/// <summary> /// 构造函数 /// </summary> public DbFirstController(ISqlSugarClient sqlSugarClient, IWebHostEnvironment env, ITableData tableData) { _sqlSugarClient = sqlSugarClient as SqlSugarClient; Env = env; _tableData = tableData; }
public void ForeachTables(ISqlSugarClient db, Action <string> action) { ClassGenerating cg = new ClassGenerating(); cg.ForeachTables(GetDb(db), action); }
public TaskOrderHistoryService(ISqlSugarClient sqlSugarClient) : base(sqlSugarClient) { }
public string GetTableNameWithSchema(ISqlSugarClient db, string tableName) { ClassGenerating cg = new ClassGenerating(); return(cg.GetTableNameWithSchema(GetDb(db), tableName)); }
public PersonRepository(ISqlSugarClient sugarClient) : base(sugarClient) { }
public string TableNameToClass(ISqlSugarClient db, string tableName) { ClassGenerating cg = new ClassGenerating(); return(cg.TableNameToClass(GetDb(db), tableName)); }
public SugarMapper(ISqlSugarClient context) { _context = context; }
public ScheduleDayService(ISqlSugarClient sqlSugarClient) : base(sqlSugarClient) { this._sqlSugarClient = sqlSugarClient; }
/// <summary> /// 得到execl流 /// </summary> /// <returns></returns> private returnR ExcelStreamObject(JObject jObject) { returnR r = new returnR(); r.code = (int)sysEnum.还没有执行; try { string fileName = "导出文件"; HSSFWorkbook hssfworkbook = new HSSFWorkbook(); ISheet sheet1 = hssfworkbook.CreateSheet(fileName); IRow rowHeader = sheet1.CreateRow(0);//生成标题 JArray jColumnArray = JArray.Parse(jObject["columnArray"].ToString()); for (var i = 0; i < jColumnArray.Count; i++) { //写标题 string fileTitle = jColumnArray[i]["title"].ToString(); rowHeader.CreateCell(i).SetCellValue(fileTitle); } //开始写内容 string keyName = jObject["keyName"].ToString(); string ip = public_method.GetIPAddress(); string sql = "";//从内存中过去对应的信息 for (var i = 0; i < MvcApplication.l_sysSearchSql.Count; i++) { if (MvcApplication.l_sysSearchSql[i].loginInIp == ip && MvcApplication.l_sysSearchSql[i].gridkey == keyName) { sql = MvcApplication.l_sysSearchSql[i].sql; break; } } if (string.IsNullOrEmpty(sql)) { r.code = (int)sysEnum.参数必填; r.msg = "sql没有获取到"; return(r); } sqlHelper sh = new sqlHelper(); ISqlSugarClient db = sh.dbClient(); DataTable dt = db.SqlQueryable <object>(sql).ToDataTable(); if (dt == null) { r.code = (int)sysEnum.执行数据库失败; r.msg = "dt数据库失败"; return(r); } #region 写入内容 for (int i = 0; i < dt.Rows.Count; i++) { IRow row = sheet1.CreateRow(i + 1); for (int j = 0; j < jColumnArray.Count; j++) { string columnName = jColumnArray[j]["field"].ToString().Trim();//获取列名 if (checkColumnIndt(columnName, dt)) { string str = dt.Rows[i][columnName].ToString();//获取到值 if (string.IsNullOrEmpty(str)) { str = " "; } row.CreateCell(j).SetCellValue(str);//把值写进去 } } } #endregion #region 写入内存中 MemoryStream file = new MemoryStream(); hssfworkbook.Write(file); file.Seek(0, SeekOrigin.Begin); r.code = (int)sysEnum.操作成功; r.data = file; //return file; #endregion } catch (Exception ex) { r.code = (int)sysEnum.发生异常; r.msg = ex.Message; } return(r); }