Esempio n. 1
0
        //private BatchService client;

        //public BatchService Client
        //{
        //    get
        //    {
        //        if (client == null)
        //        {
        //            client = new BatchService(grpcClient);
        //        }
        //        return client;
        //    }
        //}

        public BatchList GetBatchMag(int uID, string sID, bool rtype, bool trans, string stime, string etime, string gprsNum)
        {
            try
            {
                BatchRequest request = new BatchRequest {
                    StationId = sID, ReportType = rtype, TransType = trans, StartTime = stime, EndTime = etime, Gprsid = gprsNum
                };

                BatchList info = grpcClient.ListBatchData(request);

                if (batchRecordsDic.ContainsKey(uID))
                {
                    batchRecordsDic[uID] = info;
                }
                else
                {
                    batchRecordsDic.Add(uID, info);
                }

                return(info);
            }
            catch (Exception exp)
            {
                Debug.WriteLine("RPC failed" + exp);
                throw;
            }
        }