コード例 #1
0
ファイル: ProductService.cs プロジェクト: jetwind/MyBatisNet
 public ProductService()
 {
     DomSqlMapBuilder getdombuilder = new DomSqlMapBuilder();
     if(getdombuilder!=null)
         ProductService._getsqlmapper = getdombuilder.Configure() as SqlMapper;
     _getsqlManager = Mapper.Instance();
 }
コード例 #2
0
        static CentaPostCacheRW()
        {
            try
            {
                var builder = new DomSqlMapBuilder();
                Mapper = builder.Configure("SqlMap.config") as SqlMapper;

            }
            catch (IBatisNet.DataMapper.Exceptions.DataMapperException ex)
            {
                throw ex;
            }
        }
コード例 #3
0
ファイル: CustomerService.cs プロジェクト: jetwind/MyBatisNet
        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
        }
コード例 #4
0
 public HddMetricsRepository(IMySqlSettings mySqlSettings)
 {
     // Добавляем парсилку типа DateTimeOffset в качестве подсказки для SQLite
     SqlMapper.AddTypeHandler(new DateTimeOffsetHandler());
     mySql = mySqlSettings;
 }
コード例 #5
0
 public async Task <IEnumerable <AllDesShwing> > GetAllShowing()
 {
     return(await SqlMapper.QueryAsync <AllDesShwing>(cnn : conn, sql : "sp_GetAllShowing", commandType : CommandType.StoredProcedure));
 }
コード例 #6
0
 /// <inheritdoc cref="BaseRepo{T}.AddTypeHandler"/>
 protected override void AddTypeHandler()
 {
     SqlMapper.ResetTypeHandlers();
     SqlMapper.AddTypeHandler(new ObjectTypeHandler <IList <ExchangeItem> >());
 }
コード例 #7
0
 static DapperExtension()
 {
     DefaultTypeMap.MatchNamesWithUnderscores = true;
     SqlMapper.AddTypeHandler(new DateTimeToTicksHandler());
 }
コード例 #8
0
 /// <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));
 }
コード例 #9
0
 public async Task <IEnumerable <GetAllReligion> > Gets()
 {
     return(await SqlMapper.QueryAsync <GetAllReligion>(connection, "Sp_Get_ReligionAll", CommandType.StoredProcedure));
 }
コード例 #10
0
 public HomeService(IValidationDictionary validationDictionary)
 {
     _dal = new SqlMapper(GlobalConfig.Get().SqlMapperConfig);
     _validatonDictionary = validationDictionary;
 }
コード例 #11
0
ファイル: Store.cs プロジェクト: mcpride/yessql
        static Store()
        {
            SqlMapper.ResetTypeHandlers();

            // Add Type Handlers here
        }
コード例 #12
0
ファイル: GroupRepository.cs プロジェクト: huynhvantam/Todo
        public IList <GroupRes> GetListGroupRP()
        {
            IList <GroupRes> getListGroupRP = SqlMapper.Query <GroupRes>(con, "GetListGroup", commandType: CommandType.StoredProcedure).ToList();

            return(getListGroupRP);
        }
コード例 #13
0
 protected override async Task LoadData(RequestContext requestContext)
 {
     TransformData = await SqlMapper.QueryAsync <IDictionary <string, object> >(requestContext);
 }
コード例 #14
0
ファイル: ProductService.cs プロジェクト: jetwind/MyBatisNet
        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);
        }
コード例 #15
0
 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));
 }
コード例 #16
0
 public SqlMapper.GridReader QueryMultiple(string sql, dynamic param = null, int?commandTimeout = null, CommandType?commandType = null)
 {
     return(SqlMapper.QueryMultiple(_connection, sql, param, CurrentTransaction, commandTimeout, commandType));
 }
コード例 #17
0
 static TokenRepoMySql()
 {
     SqlMapper.SetTypeMap(typeof(RefreshToken), RefreshTokenMapper.GetMapper());
 }
コード例 #18
0
 public StoryRepository(SqlMapper dal)
 {
     _dal = dal;
 }
コード例 #19
0
        public IList <RentReq> ListRent()
        {
            IList <RentReq> listRent = SqlMapper.Query <RentReq>(con, "proc_GetRent", commandType: CommandType.StoredProcedure).ToList();

            return(listRent);
        }
コード例 #20
0
 /// <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));
 }
コード例 #21
0
ファイル: ColumnMapper.cs プロジェクト: hessli/Able.Store
 public static void SetMapper()
 {
     SqlMapper.SetTypeMap(typeof(Order), new ColumnAttributeTypeMapper <Order>());
 }
コード例 #22
0
 /// <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));
 }
コード例 #23
0
ファイル: SqlService.cs プロジェクト: AlexDr654/wabbajack
 static SqlService()
 {
     SqlMapper.AddTypeHandler(new PayloadMapper());
     SqlMapper.AddTypeHandler(new HashMapper());
 }
コード例 #24
0
        public List <City> GetCities()
        {
            List <City> CityList = SqlMapper.Query <City>(connection, "spGetAllCities", CommandType.StoredProcedure).ToList();

            return(CityList);
        }
コード例 #25
0
 public async Task <IEnumerable <BookingServiceDetails> > Get()
 {
     return(await SqlMapper.QueryAsync <BookingServiceDetails>(cnn : conn, sql : "BookingServiceDetails_GetAll", commandType : CommandType.StoredProcedure));
 }
コード例 #26
0
 public async Task <MessageSuccess> DeleteShowingByTime()
 {
     return(await SqlMapper.QueryFirstOrDefaultAsync <MessageSuccess>(conn, "sp_deleteshowedsByTimes", CommandType.StoredProcedure));
 }
コード例 #27
0
 public List <UserType> ListUserTypes()
 {
     return(SqlMapper.Query <UserType>(connection, SQL_GET_USERS).ToList());
 }
コード例 #28
0
 public async Task <IEnumerable <DayShow> > Top7DatesShow()
 {
     return(await SqlMapper.QueryAsync <DayShow>(cnn : conn, sql : "sp_Top7DatesShow", commandType : CommandType.StoredProcedure));
 }
コード例 #29
0
        /// <summary>
        /// 提取数据
        /// </summary>
        /// <param name="joinId"></param>
        /// <returns></returns>
        public TJoinDoc Get(Int32 joinId)
        {
            String stmtId = "TJoinDoc.Get";

            return(SqlMapper.Instance().QueryForObject <TJoinDoc>(stmtId, joinId));
        }
コード例 #30
0
ファイル: HomeController.cs プロジェクト: Oluyide/checkindata
        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());
            }
        }
コード例 #31
0
 public BaseTests()
 {
     SqlMapper.RemoveTypeMap(typeof(Guid));
     SqlMapper.AddTypeHandler(new MySqlGuidTypeHandler());
 }
コード例 #32
0
 public IEnumerable <T> Query <T>(string sql, dynamic param = null)
 {
     return(SqlMapper.Query <T>(_connection, sql, param, CurrentTransaction));
 }
コード例 #33
0
 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));
 }
コード例 #34
0
 public AccountRepository(IMySqlConnHelper mySqlConnHelper)
 {
     _mySqlConnHelper = mySqlConnHelper;
     SqlMapper.AddTypeHandler(new DapperCharsTypeHandler());
 }
コード例 #35
0
 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));
 }
コード例 #36
0
 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));
 }
コード例 #37
0
 public CategoryRepository(SqlMapper dal)
 {
     _dal = dal;
 }