示例#1
0
        public List <UserLoginDTO> GetList_Active_WithModel(UserLoginSearchDTO searchModel)
        {
            log.MethodStart();

            List <UserLoginDTO> objList = new List <UserLoginDTO>();

            //var searchModel = JsonSerializer.Deserialize<MenuSearchDTO>(param);

            using (var trans = _db.Database.BeginTransaction())
            {
                try
                {
                    var objDataList = _db.TCUserLogins.FromSqlRaw <TCUserLogin>("sp_GET_TCUser_Active {0}", searchModel.usr_username).ToList();

                    objList = _mapper.Map <List <UserLoginDTO> >(objDataList);

                    trans.Commit();
                }
                catch (Exception ex)
                {
                    // TODO: Handle failure
                    trans.Rollback();
                }
                finally
                {
                    trans.Dispose();
                }
            }

            log.MethodFinish();

            return(objList);
        }
示例#2
0
        public async Task <List <UserLoginPermissionDTO> > GetListByModelAsync(UserLoginSearchDTO searchData)
        {
            List <UserLoginPermissionDTO> objList = new List <UserLoginPermissionDTO>();

            objList = await _apiHelper.GetDataListByModelAsync <UserLoginPermissionDTO, UserLoginSearchDTO>("userlogin_api/Get_ListByModel", searchData);

            return(objList);
        }
示例#3
0
        public async Task <List <UserLoginDTO> > GetListByParamAsync(UserLoginSearchDTO searchData)
        {
            List <UserLoginDTO> objList = new List <UserLoginDTO>();

            var searchJson = JsonSerializer.Serialize(searchData);

            objList = await _apiHelper.GetDataListByParamsAsync <UserLoginDTO>("userlogin_api/Get_List", searchJson);

            return(objList);
        }
示例#4
0
        //public List<UserLoginDTO> GetListWithParam(string param)
        //{
        //    log.MethodStart();

        //    List<UserLoginDTO> objList = new List<UserLoginDTO>();

        //    var searchModel = JsonSerializer.Deserialize<UserLoginDTO>(param);

        //    using (var trans = _db.Database.BeginTransaction())
        //    {
        //        try
        //        {
        //            var objDataList = _db.TCUsers.FromSqlRaw<TCUserLogin>("sp_GET_TCUser {0}", searchModel.usr_userName).ToList();

        //            objList = _mapper.Map<List<UserLoginDTO>>(objDataList);

        //            trans.Commit();
        //        }
        //        catch (Exception ex)
        //        {
        //            // TODO: Handle failure
        //            trans.Rollback();
        //        }
        //        finally
        //        {
        //            trans.Dispose();
        //        }
        //    }

        //    log.MethodFinish();

        //    return objList;
        //}

        public List <UserLoginPermissionDTO> GetListWithModel(UserLoginSearchDTO searchModel)
        {
            log.MethodStart();

            List <UserLoginPermissionDTO> objList = new List <UserLoginPermissionDTO>();

            //var searchModel = JsonSerializer.Deserialize<MenuSearchDTO>(param);

            using (var trans = _db.Database.BeginTransaction())
            {
                try
                {
                    objList = _db.UserLoginPermissionDTOs.FromSqlRaw <UserLoginPermissionDTO>
                                  ("sp_GET_TCUserLogin {0}, {1}, {2}, {3}, {4}, {5}, {6}",
                                  searchModel.usp_arh_code,
                                  searchModel.usp_prv_code,
                                  searchModel.usp_hos_code,
                                  searchModel.usp_lab_code,
                                  searchModel.usp_rol_code,
                                  searchModel.usr_active,
                                  searchModel.usr_email
                                  ).ToList();

                    trans.Commit();
                }
                catch (Exception ex)
                {
                    // TODO: Handle failure
                    trans.Rollback();
                }
                finally
                {
                    trans.Dispose();
                }
            }

            log.MethodFinish();

            return(objList);
        }
        public IEnumerable <UserLoginPermissionDTO> Get_ListByModel([FromBody] UserLoginSearchDTO searchModel)
        {
            var objReturn = _service.GetListWithModel(searchModel);

            return(objReturn);
        }