Ejemplo n.º 1
0
        public async Task <object> NoticeList([FromBody] QueryList queryList)
        {
            var    context = HttpContext;
            string account = await _jwtUtil.GetMessageByToken(context);

            return(_noticeAppService.NoticeList(queryList, account));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 取得維修單列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public List <tek_repair> GetRepairList(QueryList query)
        {
            //狀態5的不傳
            string SQL = @"
                with tmp as (
	                select * from (
		                select row_number() over (partition by tek_name,mstatus order by tek_recipient_date desc) as con,* from (
			                select (select top 1 tek_m_status from Mobiletime_Staging where tek_repair_tek_mobiletime = a.tek_name order by id desc) as mstatus,b.tek_m_status,a.* 
			                from Repair_Staging a left outer join Mobiletime_Staging b on a.tek_name = tek_repair_tek_mobiletime
		                ) as x where isnull(mstatus,'') <> '5'
	                ) as y where con = 1
                )
                select top (@PageSize) * 
                from (
                    select *,row_number() over (order by tek_recipient_date desc) as rownumber from tmp  
                ) a
                where rownumber > @PageSize * (@Page - 1)
            ";

            var parameters = new SqlParameter[]
            {
                new SqlParameter("PageSize", query.PageSize),
                new SqlParameter("Page", query.Page),
            };

            try
            {
                return(AdoSupport.GetEntityList <tek_repair>(System.Data.CommandType.Text, SQL, sqlConnectionString, parameters));
            }
            catch (Exception ex)
            {
                throw new DaoException(SQL, "取得維修單列表時發生錯誤", ex);
            }
        }
Ejemplo n.º 3
0
        public override void EndProxyWebRequest(ProxyWebRequest proxyWebRequest, QueryList queryList, IService service, IAsyncResult asyncResult)
        {
            MailTipsApplication.GetMailTipsTracer.TraceFunction((long)this.traceId, "Entering MailTipsApplication.EndProxyWebRequest");
            GetMailTipsResponseMessageType getMailTipsResponseMessageType = service.EndGetMailTips(asyncResult);
            int hashCode = proxyWebRequest.GetHashCode();

            if (getMailTipsResponseMessageType == null)
            {
                Application.ProxyWebRequestTracer.TraceError((long)this.traceId, "{0}: Proxy web request returned NULL GetMailTipsResponseMessageType", new object[]
                {
                    TraceContext.Get()
                });
                queryList.SetResultInAllQueries(new MailTipsQueryResult(new NoEwsResponseException()));
                base.HandleNullResponse(proxyWebRequest);
                return;
            }
            ResponseCodeType responseCode = getMailTipsResponseMessageType.ResponseCode;

            if (responseCode != ResponseCodeType.NoError)
            {
                Application.ProxyWebRequestTracer.TraceError <object, string>((long)hashCode, "{0}: Proxy web request returned error code {1}", TraceContext.Get(), responseCode.ToString());
                queryList.SetResultInAllQueries(new MailTipsQueryResult(new ErrorEwsResponseException(responseCode)));
                return;
            }
            this.ProcessResponseMessages(hashCode, queryList, getMailTipsResponseMessageType);
        }
Ejemplo n.º 4
0
        public async void Init()
        {
            MainPage.Current.ActiveProgressRing();
            try
            {
                QueryList.Clear();
                string jsonResult = await LinqHelper.GetSearchData(SearchModel, "SearchQuery");

                if (SearchModel.ExportType.HasValue && SearchModel.ExportType.Value == ExportType.AllPages)
                {
                    var result = JsonConvert.DeserializeObject <JsonResultTemplate <SearchQuery> >(jsonResult);
                    if (result.ResultCode == (int)ResultCodeType.操作成功)
                    {
                        result.Data.ToList().ForEach(item => { QueryList.Add(item); });
                    }
                }
                else
                {
                    var result = JsonConvert.DeserializeObject <JsonSearchResultTemplate <SearchQuery> >(jsonResult);
                    SearchModel.TotalCount = result.Data.TotalSize;
                    SearchModel.PageIndex  = result.Data.PageIndex;
                    SearchModel.PageSize   = result.Data.PageSize;
                    result.Data.Data.ToList().ForEach(item => { QueryList.Add(item); });
                }
            }
            catch (Exception ex)
            {
                await MainPage.ShowErrorMessage(ex.Message);
            }
            finally
            {
                MainPage.Current.InActiveProgressRing();
            }
        }
Ejemplo n.º 5
0
        public object NoticeList(QueryList queryList, string account)
        {
            queryList.Query = string.IsNullOrEmpty(queryList.Query) ? "" : queryList.Query;
            Worker worker     = _ctx.Worker.SingleOrDefault(w => w.Account.Equals(account));
            var    noticeList = (from notice in _ctx.Notice
                                 join w in _ctx.Worker on notice.CreateHuman equals w.Id
                                 where notice.IsDelete == false && notice.Title.Contains(queryList.Query) && notice.CreateHuman == worker.Id
                                 orderby notice.Id
                                 select new
            {
                id = notice.Id,
                title = notice.Title,
                content = notice.Content,
                createHuman = w.Name,
                typeCode = notice.Type,
                type = TypeProvider._types.SingleOrDefault(t => t.Code == notice.Type).TypeName,
                createTime = _commonServer.ChangeTime(notice.CreateTime)
            }).ToList();
            var result = new
            {
                totalCount = noticeList.Count(),
                data       = noticeList.Skip((queryList.CurrentPage - 1) * queryList.CurrentPageSize).Take(queryList.CurrentPageSize),
            };

            return(result);
        }
Ejemplo n.º 6
0
 public void Prepare(ref Log returnLog)
 {
     try
     {
         TraceFile source = new TraceFile();
         source.InitializeAsReader(TraceSource);
         while (source.Read())
         {
             foreach (SQLEvent sqlEvent in EventList)
             {
                 if (source.GetString(source.GetOrdinal("EventClass")) == sqlEvent.EventName)
                 {
                     SQLStatement newStatement = new SQLStatement();
                     newStatement.Statement        = source.GetString(source.GetOrdinal("TextData"));
                     newStatement.ConnectionString = ConnectionString == "{PARENT}" ? _config.SourceConnectionString : ConnectionString;
                     QueryList.Add(newStatement);
                 }
             }
         }
         returnLog.EndTime = DateTime.Now;
         returnLog.Message = "Prepare successful.";
     }
     catch (Exception ex)
     {
         returnLog.EndTime    = DateTime.Now;
         returnLog.Successful = false;
         returnLog.Message    = "Prepare failed - " + ex.Message;
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// 取得全部維修資料
        /// </summary>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public IEnumerable <tek_repair> GetRepair(int page = 1, int pageSize = 10)
        {
            QueryList query = new QueryList();

            query.Page     = page;
            query.PageSize = pageSize;
            return(mobileRepository.GetRepairList(query));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 取得留言列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public IEnumerable <tek_onsitenote> GetOnSiteNoteList(int page = 1, int pageSize = 10)
        {
            QueryList query = new QueryList();

            query.Page     = page;
            query.PageSize = pageSize;
            return(mobileRepository.GetOnSiteNoteList(query));
        }
Ejemplo n.º 9
0
 protected override void ValidateParameters()
 {
     ArgumentAssert.IsNotEmpty <SearchQuery>(QueryList, "QueryList");
     if (MaxQueries > 0)
     {
         ArgumentAssert.IsInRange(QueryList, 1, MaxQueries, "QueryList");
     }
     QueryList.ValidateParameters();
 }
        public MainWindow()
        {
            InitializeComponent();

            QueryList queryList = new QueryList();

            queries = queryList.Load();
            combobox.ItemsSource = queries.OrderBy(i => i.Name);;
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 依照員工帳號與維修狀態,取得維修資料
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public IEnumerable <tek_repair> GetRepair(string id, string status, int page = 1, int pageSize = 10)
        {
            QueryList query = new QueryList();

            query.Page     = page;
            query.PageSize = pageSize;
            query.Keyword  = id;
            return(mobileRepository.GetRepairListByAccount(query).Where(p => p.tek_repairstatus == status));
        }
Ejemplo n.º 12
0
        public void GetMobileTimesTest()
        {
            QueryList query = new QueryList();

            query.Page     = 1;
            query.PageSize = 10;
            List <tek_repair> mobile = mobileRepository.GetRepairList(query);

            Assert.AreEqual(true, mobile.Count > 0);
        }
Ejemplo n.º 13
0
 /// <summary>
 /// 删除过期的数据
 /// </summary>
 public void CleanObsoletedRecord()
 {
     for (int i = QueryList.Count - 1; i > -1; i--)
     {
         if (DateTime.Now - QueryList[i].Time > ObsoletedTimeDuration)
         {
             QueryList.RemoveAt(i);
         }
     }
 }
Ejemplo n.º 14
0
 private void Set(string name, string value)
 {
     if (value == null)
     {
         QueryList.Remove(name);
     }
     else
     {
         QueryList[name] = value;
     }
 }
Ejemplo n.º 15
0
        public void GetRepairListByAccount()
        {
            QueryList query = new QueryList();

            query.Page     = 1;
            query.PageSize = 10;
            query.Keyword  = "aaa";
            List <tek_repair> mobile = mobileRepository.GetRepairListByAccount(query);

            Assert.AreEqual(true, mobile.Count > 0);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 取得留言列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public List <tek_onsitenote> GetOnSiteNoteList(QueryList query)
        {
            string SQL = @"
                select top (@PageSize) * 
                from (
                    select *,row_number() over (order by id desc) as rownumber from Onsitenote_Staging
                ) a
                where rownumber > @PageSize * (@Page - 1)
            ";

            //看最後一筆,排除 5
            SQL = @"
                with tmp as (
	                select * from (
		                select row_number() over (partition by tek_repair_no,mstatus order by createdon desc) as con,* from (
			                select (select top 1 tek_m_status from Mobiletime_Staging where tek_repair_tek_mobiletime = a.tek_repair_no order by id desc) as mstatus,b.tek_m_status,a.* 
			                from Onsitenote_Staging a left outer join Mobiletime_Staging b on a.tek_repair_no = tek_repair_tek_mobiletime
		                ) as x where isnull(mstatus,'') <> '5'
	                ) as y where con = 1
                )
                select top (@PageSize) * 
                from (
                    select *,row_number() over (order by createdon desc) as rownumber from tmp  
                ) a
                where rownumber > @PageSize * (@Page - 1)
            ";
            //只要有 5 就排除
            SQL = @"
               with tmp as (
                    select a.*,b.tek_m_status,
                    (select count(*) from Mobiletime_Staging c where c.tek_repair_tek_mobiletime = a.tek_repair_no and tek_m_status = '5') as has5,
                    row_number() over (partition by tek_repair_no,tek_m_status order by createdon desc) as con from Onsitenote_Staging a left outer join Mobiletime_Staging b on a.tek_repair_no = tek_repair_tek_mobiletime where isnull(tek_m_status,'') <> '5'
                )
                select top (@PageSize) * 
                from (
                    select *,row_number() over (order by createdon desc) as rownumber from tmp where con = 1 and has5 = 0 
                ) a
                where rownumber > @PageSize * (@Page - 1)
            ";
            var parameters = new SqlParameter[]
            {
                new SqlParameter("PageSize", query.PageSize),
                new SqlParameter("Page", query.Page),
            };

            try
            {
                return(AdoSupport.GetEntityList <tek_onsitenote>(System.Data.CommandType.Text, SQL, sqlConnectionString, parameters));
            }
            catch (Exception ex)
            {
                throw new DaoException(SQL, "取得留言列表時發生錯誤", ex);
            }
        }
        public BTNPCPlayer(NPCPlayer player, MainPlayer main)
        {
            npc        = player;
            mainPlayer = main;

            constructCountQuery = new QueryList <ConstructId, float>();
            agentCountQuery     = new QueryList <Soldier, float>();

            InitBT();
            ResetAgentCheckUpdated();
        }
Ejemplo n.º 18
0
 public override void EndProxyWebRequest(ProxyWebRequest proxyWebRequest, QueryList queryList, IService service, IAsyncResult asyncResult)
 {
     try
     {
         GetUserPhotoResponseMessageType getUserPhotoResponseMessageType = service.EndGetUserPhoto(asyncResult);
         queryList.SetResultInAllQueries(new UserPhotoQueryResult(getUserPhotoResponseMessageType.PictureData, getUserPhotoResponseMessageType.CacheId, getUserPhotoResponseMessageType.StatusCode, getUserPhotoResponseMessageType.Expires, getUserPhotoResponseMessageType.ContentType, this.upstreamTracer));
     }
     finally
     {
         this.proxyLatencyTracker.Stop();
     }
 }
Ejemplo n.º 19
0
        // Reads XPath queries from queryInfoList into XML_Query object.
        public void MakeXMLQuery(List <string> queryInfoList)
        {
            XML_Query query = new XML_Query();

            QueryList.Add(query);
            query.JobId          = queryInfoList[1].Split('=')[1];
            query.JobEnabled     = queryInfoList[2].Split('=')[1];
            query.JobName        = queryInfoList[3].Split('=')[1].Trim();
            query.JobDescription = queryInfoList[4].Split('=')[1].Trim();
            query.System         = queryInfoList[6].Split('=')[1];
            query.SubSystem      = queryInfoList[7].Split('=')[1];
            query.Source         = queryInfoList[8].Split('=')[1].Trim();
            query.Target         = queryInfoList[9].Split('=')[1];
            query.Query          = queryInfoList[12];
        }
Ejemplo n.º 20
0
        /// <summary>
        /// 新增一个查询项
        /// </summary>
        /// <param name="query">查询项</param>
        private void AddInputQuery(InputQuery query)
        {
            if (query == null)
            {
                //TO-DO: throw exception?
                return;
            }

            lock (QueryList)
            {
                QueryList.Add(query);
            }
            // TO-DO: Do not save anyway, add some saving policies
            SaveQuery();
        }
        public override void EndProxyWebRequest(ProxyWebRequest proxyWebRequest, QueryList queryList, IService service, IAsyncResult asyncResult)
        {
            TraceWrapper.SearchLibraryTracer.TraceDebug(this.traceId, "Entering FindMessageTrackingApplication.EndProxyWebRequest", new object[0]);
            FindMessageTrackingReportResponseMessageType findMessageTrackingReportResponseMessageType = service.EndFindMessageTrackingReport(asyncResult);

            if (findMessageTrackingReportResponseMessageType == null)
            {
                base.HandleNullResponse(proxyWebRequest);
                return;
            }
            if (findMessageTrackingReportResponseMessageType.ResponseClass != ResponseClassType.Success)
            {
                TraceWrapper.SearchLibraryTracer.TraceError <object, string, string>(this.traceId, "{0}: FindMTR proxy web request returned {1} and response code {2}", TraceContext.Get(), Names <ResponseClassType> .Map[(int)findMessageTrackingReportResponseMessageType.ResponseClass], findMessageTrackingReportResponseMessageType.ResponseCode);
            }
            this.ProcessResponseMessages(this.traceId, queryList, findMessageTrackingReportResponseMessageType);
        }
Ejemplo n.º 22
0
        public MemTestDB(IDataProvider provider)
        {
            _provider = provider;

            Products     = new QueryList <Product>();
            Customers    = new QueryList <Customer>();
            Orders       = new QueryList <Order>();
            OrderDetails = new QueryList <OrderDetail>();
            Categories   = new QueryList <Category>();

            _provider.Schema.Tables.Add(typeof(Product).ToSchemaTable(_provider));
            _provider.Schema.Tables.Add(typeof(Customer).ToSchemaTable(_provider));
            _provider.Schema.Tables.Add(typeof(Order).ToSchemaTable(_provider));
            _provider.Schema.Tables.Add(typeof(OrderDetail).ToSchemaTable(_provider));
            _provider.Schema.Tables.Add(typeof(Category).ToSchemaTable(_provider));
        }
        public MainWindow()
        {
            InitializeComponent();

            PersonList people = new PersonList();
            var        listp  = people.Load();

            PersonList = new ObservableCollection <Person>(listp);

            QueryList queries = new QueryList();
            var       listq   = queries.Load();

            QueryList = new ObservableCollection <Query>(listq);

            combobox.ItemsSource   = QueryList;
            combobox.SelectedIndex = 0;
        }
Ejemplo n.º 24
0
 private void ProcessResponseMessages(int traceId, QueryList queryList, GetMailTipsResponseMessageType response)
 {
     if (response.ResponseMessages == null)
     {
         Application.ProxyWebRequestTracer.TraceError((long)traceId, "{0}: Proxy web request returned NULL GetMailTipsResponseMessageType.ResponseMessages", new object[]
         {
             TraceContext.Get()
         });
         queryList.SetResultInAllQueries(new MailTipsQueryResult(new NoEwsResponseException()));
         return;
     }
     for (int i = 0; i < response.ResponseMessages.Length; i++)
     {
         MailTipsResponseMessageType mailTipsResponseMessageType = response.ResponseMessages[i];
         BaseQuery[] array = queryList.FindByEmailAddress(queryList[i].Email.Address);
         foreach (MailTipsQuery mailTipsQuery in array)
         {
             if (mailTipsResponseMessageType == null)
             {
                 Application.ProxyWebRequestTracer.TraceError <object, Microsoft.Exchange.InfoWorker.Common.Availability.EmailAddress>((long)traceId, "{0}: Proxy web request returned NULL MailTipsResponseMessageType for mailbox {1}.", TraceContext.Get(), queryList[i].Email);
                 mailTipsQuery.SetResultOnFirstCall(new MailTipsQueryResult(new NoEwsResponseException()));
             }
             else if (mailTipsResponseMessageType.ResponseCode != ResponseCodeType.NoError)
             {
                 Application.ProxyWebRequestTracer.TraceError <object, Microsoft.Exchange.InfoWorker.Common.Availability.EmailAddress, ResponseCodeType>((long)traceId, "{0}: Proxy web request returned error MailTipsResponseMessageType for mailbox {1}. Error coee is {2}.", TraceContext.Get(), queryList[i].Email, mailTipsResponseMessageType.ResponseCode);
                 mailTipsQuery.SetResultOnFirstCall(new MailTipsQueryResult(new ErrorEwsResponseException(mailTipsResponseMessageType.ResponseCode)));
             }
             else
             {
                 MailTips mailTips = mailTipsResponseMessageType.MailTips;
                 if (mailTips == null)
                 {
                     Application.ProxyWebRequestTracer.TraceDebug <object, Microsoft.Exchange.InfoWorker.Common.Availability.EmailAddress>((long)traceId, "{0}: Proxy web request returned NULL MailTips for mailbox {1}.", TraceContext.Get(), queryList[i].Email);
                     mailTipsQuery.SetResultOnFirstCall(new MailTipsQueryResult(new NoMailTipsInEwsResponseMessageException()));
                 }
                 else
                 {
                     MailTips            mailTips2         = MailTipsApplication.ParseWebServiceMailTips(mailTips);
                     MailTipsQueryResult resultOnFirstCall = new MailTipsQueryResult(mailTips2);
                     mailTipsQuery.SetResultOnFirstCall(resultOnFirstCall);
                 }
             }
         }
     }
 }
Ejemplo n.º 25
0
        /// <summary>
        /// Standard constructor for the tool window.
        /// </summary>
        public QueryListPane() : base(null)
        {
            // Set the window title reading it from the resources.
            this.Caption = Resources.ToolWindowTitle;
            // Set the image that will appear on the tab of the window frame
            // when docked with an other window
            // The resource ID correspond to the one defined in the resx file
            // while the Index is the offset in the bitmap strip. Each image in
            // the strip being 16x16.
            this.BitmapResourceID = 301;
            this.BitmapIndex      = 1;

            // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
            // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
            // the object returned by the Content property.
            _view        = new QueryList();
            base.Content = _view;
        }
 private void ProcessResponseMessages(int traceId, QueryList queryList, FindMessageTrackingReportResponseMessageType response)
 {
     if (response == null)
     {
         Application.ProxyWebRequestTracer.TraceError((long)traceId, "{0}: Proxy web request returned NULL FindMessageTrackingReportResponseMessageType", new object[]
         {
             TraceContext.Get()
         });
         return;
     }
     foreach (BaseQuery baseQuery in ((IEnumerable <BaseQuery>)queryList))
     {
         FindMessageTrackingBaseQuery findMessageTrackingBaseQuery = (FindMessageTrackingBaseQuery)baseQuery;
         findMessageTrackingBaseQuery.SetResultOnFirstCall(new FindMessageTrackingBaseQueryResult
         {
             Response = response
         });
     }
 }
Ejemplo n.º 27
0
 private static void GenerateQuery(QueryDefinition queryDefinition, QueryList inputList, QuerySet querySet)
 {
     if (queryDefinition.Grouping == QueryGrouping.Area)
     {
         foreach (var area in inputList.Areas)
         {
             var areaQueries = querySet.EnsureArea(area.Name);
             // Filter by 'queries' if present.
             if (area.Queries.Any(q => string.Equals(q, queryDefinition.Id)))
             {
                 areaQueries.Queries.Add(GenerateAreaQuery(queryDefinition, area));
             }
         }
     }
     else
     {
         throw new NotSupportedException("Only area-grouped queries are supported at this time.");
     }
 }
        void OnTapped()
        {
            //checks that the database has elements before proceeding
            if (QueryList.Count() > 0)
            {
                //adds first category
                HistoricalStandingsDataList.Add(new HistoricalStandingTitleModel {
                    Title = QueryList.First().TournamentName
                });

                //checks for each element if there already exists a matching category, adds it if not
                for (int i = 1; i < QueryList.Count(); i++)
                {
                    if (QueryList.ElementAt(i).TournamentName != QueryList.ElementAt(i - 1).TournamentName)
                    {
                        bool add = true;
                        foreach (var item in HistoricalStandingsDataList)
                        {
                            if (item.Title.ToUpper() == QueryList.ElementAt(i).TournamentName.ToUpper())
                            {
                                add = false;
                            }
                        }
                        if (add)
                        {
                            HistoricalStandingsDataList.Add(new HistoricalStandingTitleModel {
                                Title = QueryList.ElementAt(i).TournamentName
                            });
                        }
                    }
                }
                ShowListView = !_showListView;
                if (_showListView)
                {
                    ArrowImage = "up_arrow.png";
                }
                else
                {
                    ArrowImage = "down_arrow.png";
                }
            }
        }
        public MySqlUserQueriesTests()
        {
            var services = new ServiceCollection();

            services.AddIdentity <DapperIdentityUser, DapperIdentityRole>(x =>
            {
                x.Password.RequireDigit           = false;
                x.Password.RequiredLength         = 1;
                x.Password.RequireLowercase       = false;
                x.Password.RequireNonAlphanumeric = false;
                x.Password.RequireUppercase       = false;
            })
            .AddDapperIdentityFor <MySqlConfiguration>();

            var serviceProvider = services.BuildServiceProvider();

            var queryList = new QueryList(serviceProvider);

            _queryFactory = new QueryFactory(queryList);
        }
Ejemplo n.º 30
0
 private void ReadInQueries()
 {
     using (StreamReader sr = new StreamReader(DDB_Control.Tearsheet_Queries))
     {
         List <string> QueryList = new List <string>();;
         while (!sr.EndOfStream)
         {
             string line = sr.ReadLine();
             if (line.IndexOf("---") > -1)
             {
                 string fieldName = line.Substring(0, line.IndexOf("---")).Trim();
                 QueryList.Add(line.Substring(line.IndexOf("---") + 3).Trim());
                 QueryClusters.Add(fieldName, QueryList);
                 QueryList = new List <string>();
             }
             else
             {
                 QueryList.Add(line);
             }
         }
     }
 }