public ProductService() { DomSqlMapBuilder getdombuilder = new DomSqlMapBuilder(); if(getdombuilder!=null) ProductService._getsqlmapper = getdombuilder.Configure() as SqlMapper; _getsqlManager = Mapper.Instance(); }
static CentaPostCacheRW() { try { var builder = new DomSqlMapBuilder(); Mapper = builder.Configure("SqlMap.config") as SqlMapper; } catch (IBatisNet.DataMapper.Exceptions.DataMapperException ex) { throw ex; } }
public CustomerService() { #region Define the Base Map _getDaoManager = ServiceConfig.GetInstance().DaoManager; if (_getDaoManager != null) _getbaseService = _getDaoManager.GetDao(typeof(CustomerMapDao)) as ICustomerDao; #endregion #region Use SqlMaper Style to Soleuv this Connection Problem f**k =--- DomSqlMapBuilder getbuilder = new DomSqlMapBuilder(); if (getbuilder != null) _getsqlmaper = getbuilder.Configure() as SqlMapper; #endregion }
public HddMetricsRepository(IMySqlSettings mySqlSettings) { // Добавляем парсилку типа DateTimeOffset в качестве подсказки для SQLite SqlMapper.AddTypeHandler(new DateTimeOffsetHandler()); mySql = mySqlSettings; }
public async Task <IEnumerable <AllDesShwing> > GetAllShowing() { return(await SqlMapper.QueryAsync <AllDesShwing>(cnn : conn, sql : "sp_GetAllShowing", commandType : CommandType.StoredProcedure)); }
/// <inheritdoc cref="BaseRepo{T}.AddTypeHandler"/> protected override void AddTypeHandler() { SqlMapper.ResetTypeHandlers(); SqlMapper.AddTypeHandler(new ObjectTypeHandler <IList <ExchangeItem> >()); }
static DapperExtension() { DefaultTypeMap.MatchNamesWithUnderscores = true; SqlMapper.AddTypeHandler(new DateTimeToTicksHandler()); }
/// <summary> /// 根据条件筛选出数据集合 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="sql"></param> /// <param name="param"></param> /// <param name="buffered"></param> /// <returns></returns> public IEnumerable <T> Get <T>(string sql, dynamic param = null, bool buffered = true) where T : class { return(SqlMapper.Query <T>(_session.Connection, sql, param as object, _session.Transaction, buffered)); }
public async Task <IEnumerable <GetAllReligion> > Gets() { return(await SqlMapper.QueryAsync <GetAllReligion>(connection, "Sp_Get_ReligionAll", CommandType.StoredProcedure)); }
public HomeService(IValidationDictionary validationDictionary) { _dal = new SqlMapper(GlobalConfig.Get().SqlMapperConfig); _validatonDictionary = validationDictionary; }
static Store() { SqlMapper.ResetTypeHandlers(); // Add Type Handlers here }
public IList <GroupRes> GetListGroupRP() { IList <GroupRes> getListGroupRP = SqlMapper.Query <GroupRes>(con, "GetListGroup", commandType: CommandType.StoredProcedure).ToList(); return(getListGroupRP); }
protected override async Task LoadData(RequestContext requestContext) { TransformData = await SqlMapper.QueryAsync <IDictionary <string, object> >(requestContext); }
public void InsertProduct(Product getproduct) { ISqlMapper _getsqlManager = null; DomSqlMapBuilder getdombuilder = new DomSqlMapBuilder(); if (getdombuilder != null) ProductService._getsqlmapper = getdombuilder.Configure() as SqlMapper; _getsqlManager = Mapper.Instance(); if (_getsqlManager!=null) _getsqlManager.Insert("InsertProduct", getproduct); }
public T ExecuteScalar <T>(string sql, dynamic param = null, int?commandTimeout = null, CommandType?commandType = null) { return(SqlMapper.ExecuteScalar <T>(_connection, sql, param, CurrentTransaction, commandTimeout, commandType)); }
public SqlMapper.GridReader QueryMultiple(string sql, dynamic param = null, int?commandTimeout = null, CommandType?commandType = null) { return(SqlMapper.QueryMultiple(_connection, sql, param, CurrentTransaction, commandTimeout, commandType)); }
static TokenRepoMySql() { SqlMapper.SetTypeMap(typeof(RefreshToken), RefreshTokenMapper.GetMapper()); }
public StoryRepository(SqlMapper dal) { _dal = dal; }
public IList <RentReq> ListRent() { IList <RentReq> listRent = SqlMapper.Query <RentReq>(con, "proc_GetRent", commandType: CommandType.StoredProcedure).ToList(); return(listRent); }
/// <summary> /// 根据表达式筛选 /// </summary> /// <typeparam name="TFirst"></typeparam> /// <typeparam name="TSecond"></typeparam> /// <typeparam name="TReturn"></typeparam> /// <param name="sql"></param> /// <param name="map"></param> /// <param name="param"></param> /// <param name="transaction"></param> /// <param name="buffered"></param> /// <param name="splitOn"></param> /// <param name="commandTimeout"></param> /// <returns></returns> public IEnumerable <TReturn> Get <TFirst, TSecond, TReturn>(string sql, Func <TFirst, TSecond, TReturn> map, dynamic param = null, IDbTransaction transaction = null, bool buffered = true, string splitOn = "Id", int?commandTimeout = null) { return(SqlMapper.Query(_session.Connection, sql, map, param as object, transaction, buffered, splitOn)); }
public static void SetMapper() { SqlMapper.SetTypeMap(typeof(Order), new ColumnAttributeTypeMapper <Order>()); }
/// <summary> /// 根据条件筛选数据集合 /// </summary> /// <param name="sql"></param> /// <param name="param"></param> /// <param name="buffered"></param> /// <returns></returns> public IEnumerable <dynamic> Get(string sql, dynamic param = null, bool buffered = true) { return(SqlMapper.Query(_session.Connection, sql, param as object, _session.Transaction, buffered)); }
static SqlService() { SqlMapper.AddTypeHandler(new PayloadMapper()); SqlMapper.AddTypeHandler(new HashMapper()); }
public List <City> GetCities() { List <City> CityList = SqlMapper.Query <City>(connection, "spGetAllCities", CommandType.StoredProcedure).ToList(); return(CityList); }
public async Task <IEnumerable <BookingServiceDetails> > Get() { return(await SqlMapper.QueryAsync <BookingServiceDetails>(cnn : conn, sql : "BookingServiceDetails_GetAll", commandType : CommandType.StoredProcedure)); }
public async Task <MessageSuccess> DeleteShowingByTime() { return(await SqlMapper.QueryFirstOrDefaultAsync <MessageSuccess>(conn, "sp_deleteshowedsByTimes", CommandType.StoredProcedure)); }
public List <UserType> ListUserTypes() { return(SqlMapper.Query <UserType>(connection, SQL_GET_USERS).ToList()); }
public async Task <IEnumerable <DayShow> > Top7DatesShow() { return(await SqlMapper.QueryAsync <DayShow>(cnn : conn, sql : "sp_Top7DatesShow", commandType : CommandType.StoredProcedure)); }
/// <summary> /// 提取数据 /// </summary> /// <param name="joinId"></param> /// <returns></returns> public TJoinDoc Get(Int32 joinId) { String stmtId = "TJoinDoc.Get"; return(SqlMapper.Instance().QueryForObject <TJoinDoc>(stmtId, joinId)); }
public async Task <ActionResult> CheckingData(string y = "") { var providerData = db.Facilities.ToList(); using (var client = new HttpClient()) { client.BaseAddress = new Uri(baseUrl); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/x-www-form-urlencoded")); Task <string> callTask = Task.Run(() => GetAccessToken()); // Wait for it to finish callTask.Wait(); // Get the result var ret = callTask.Result; // Add the Authorization header with the AccessToken. client.DefaultRequestHeaders.Add("Authorization", "Bearer " + ret); //try //{ foreach (var value in providerData) { // create the URL string. string url = string.Format(client.BaseAddress + "/api/PCClaims/GetCheckInData"); var parameters = new Dictionary <string, string> { { "ProviderId", value.ProviderId.ToString() }, { "Key", value.Key.ToString() }, { "StartDate", startDate.ToString() }, { "EndDate", endDate.ToString() } }; var encodedContent = new FormUrlEncodedContent(parameters); // make the request //System.Net.ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; var response = await client.PostAsync(url, encodedContent); // parse the response and return the data. if (response.IsSuccessStatusCode) { string jsonString = await response.Content.ReadAsStringAsync(); List <APIResponse> responseData = JsonConvert.DeserializeObject <List <APIResponse> >(jsonString); foreach (var api in responseData) { Logs logs = new Logs(); logs.ProviderName = value.ProviderName; logs.ProviderKey = api.providerId.ToString(); logs.Action = api.enrolleeNo; logs.LastName = api.lastName; logs.FirstName = api.firstName; logs.OtherNames = api.othername; logs.TrasactionDate = api.checkInDate; //logs.BatchTime = DateTime.Today; var objDetails = SqlMapper.QueryMultiple(con, "GetReg", new { EnrolleeNum = api.enrolleeNo, startDate = startDate, lastDate = endDate }, null, 100000, commandType: CommandType.StoredProcedure); PatientDetails details = new PatientDetails(); var Data = objDetails.Read <PatientDetails>(); details.RegistrationNo = Data.Select(x => x.RegistrationNo).LastOrDefault(); details.PlanType = Data.Select(x => x.PlanType).LastOrDefault(); details.CheckInBy = Data.Select(x => x.CheckInBy).LastOrDefault(); if (!string.IsNullOrEmpty(details.RegistrationNo)) { logs.PatientHospitalNo = details.RegistrationNo; } else { logs.PatientHospitalNo = "This enrollee number is incorrect,please edit the enrollee number"; } if (!string.IsNullOrEmpty(details.PlanType)) { logs.PlanType = details.PlanType; } else { logs.PlanType = "The enrollee number must be corrected to view this Data"; } if (!string.IsNullOrEmpty(details.CheckInBy)) { logs.CheckInBy = details.CheckInBy; } else { logs.CheckInBy = "The enrollee number must be corrected to view this Data"; } con.Close(); //check Values var checkexistence = data.CheckexistingValues(api.enrolleeNo, api.checkInDate).ToList(); if (checkexistence.Count < 1) { db.PatientChecks.Add(logs); } db.SaveChanges(); } } var result = await data.SendReportPerlocation(startDate, value.ProviderId.ToString(), value.ProviderEmail, value.ProviderName); if (result == "Success") { TempData["MessageSent"] = "Message Sent Sucessfully"; } else { TempData["MessageSent"] = result; break; } } //} //catch (Exception ex) //{ // TempData["error"] = "Invalid Value: This is not an Hospital Number" + ex.InnerException; // return View(); //} TempData["sucess"] = "Sucessfully Completed"; return(View()); } }
public BaseTests() { SqlMapper.RemoveTypeMap(typeof(Guid)); SqlMapper.AddTypeHandler(new MySqlGuidTypeHandler()); }
public IEnumerable <T> Query <T>(string sql, dynamic param = null) { return(SqlMapper.Query <T>(_connection, sql, param, CurrentTransaction)); }
public static IEnumerable <T> Query <T>(this DbConnection cnn, string command, Dictionary <string, object> parameters, CommandType commandType = CommandType.StoredProcedure) { return(SqlMapper.Query <T>(cnn, command, parameters, commandType: commandType)); }
public AccountRepository(IMySqlConnHelper mySqlConnHelper) { _mySqlConnHelper = mySqlConnHelper; SqlMapper.AddTypeHandler(new DapperCharsTypeHandler()); }
public static IEnumerable <TReturn> Query <TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TReturn>(this IDbConnection cnn, string sql, Func <TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TReturn> map, object parameters = null, IDbTransaction transaction = null, bool buffered = true, string splitOn = "Id", int?commandTimeout = null, CommandType?commandType = CommandType.StoredProcedure) { return(SqlMapper.Query(cnn, sql, map, parameters?.ToPropertyDictionary(), transaction, buffered, splitOn, commandTimeout, commandType)); }
public static IEnumerable <TReturn> Query <TReturn>(this IDbConnection cnn, string sql, Type[] types, Func <object[], TReturn> map, object parameters = null, IDbTransaction transaction = null, bool buffered = true, string splitOn = "Id", int?commandTimeout = null, CommandType?commandType = null) { return(SqlMapper.Query(cnn, sql, types, map, parameters?.ToPropertyDictionary(), transaction, buffered, splitOn, commandTimeout, commandType)); }
public CategoryRepository(SqlMapper dal) { _dal = dal; }