Пример #1
0
        public static bool Report(string type, string report_id, string report_abstract_content = "", string report_abstract_id = "", string report_content = "", string order_id = "")
        {
            bool   flag;
            string str = "&report_id=" + report_id;

            if (type.ToString() == "1")
            {
                str = str + "&order_id=" + order_id;
            }
            string json = HttpUtils.Post(MicroPrinter.App.AppContext.Instance.BaseURL + "/report/index/?type=" + type, ((str + "&report_abstract_content=" + report_abstract_content) + "&report_abstract_id=" + report_abstract_id) + "&report_content=" + report_content, "");

            try
            {
                JObject obj2 = JObject.Parse(json);
                if ((obj2 == null) || (obj2["data"].ToString() == "[]"))
                {
                    flag = false;
                }
                else
                {
                    MsgDisplay.ContentUpdate("抱歉:当前遇到问题,请换一台设备取件!");
                    flag = obj2["status"].ToString() == "1";
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine("Report:" + exception.Message);
                flag = false;
            }
            return(flag);
        }
Пример #2
0
        public static MsgDisplay GetFirstDisplay(bool isFav)
        {
            var source = GetFirst();

            var result = new MsgDisplay()
            {
                Id                    = source.Id,
                Name                  = source.Name,
                TenantId              = source.TenantId,
                TenantName            = source.TenantName,
                AuthorId              = source.AuthorId,
                AuthorName            = source.AuthorName,
                ForceNotify           = source.ForceNotify,
                IsPrivate             = source.IsPrivate,
                AuthorProfileThumbUrl = UserData.GetFirst().ProfileThumbUrl,
                Recipients            = new List <ResultProfile>()
                {
                    UserData.GetFirstProfile()
                },
                Text         = source.Text,
                RegionKey    = source.RegionKey,
                IsActive     = source.IsActive,
                DateCreated  = source.DateCreated,
                DateModified = source.DateModified,
                Files        = new List <ResultProfile>(),
                Favourite    = isFav
            };

            return(result);
        }
Пример #3
0
 public void Awake()
 {
     if (instance != null)
     {
         Debug.Log("Too many message display scripts!");
         return;
     }
     instance = this;
 } //singleton
Пример #4
0
    } //Singleton loop

    private void Start()
    {
        msgD       = MsgDisplay.instance;
        cH         = GetComponent <CityHandler>();
        decks      = GetComponent <Decks>();
        deckHandUI = GameObject.Find("UIScripts").GetComponent <DeckHandUI>();
        rP         = GetComponent <ResolutionPhase>();
        aiI        = GetComponent <AIInfo>();
        aiC        = GetComponent <AICities>();
    }
 private void Start()
 {
     msgD = MsgDisplay.instance;
     cC   = CameraControll.instance;
     tS   = TemplateSelection.instance;
     aIC  = AICities.instance;
     turnStructureScript = TurnStructure.instance;
     currentPhase        = initPhase.Welcome;
     msgD.DisplayMessage("Welcome", 2f);
 }
Пример #6
0
        public FormMain()
        {
            InitializeComponent();
            _msgDisplay              = new MsgDisplay(this, "MarketOps");
            _dataProvider            = DataProvidersFactory.GetStockDataProvider();
            _systemDataLoader        = SystemDataLoaderFactory.Get(_dataProvider);
            _systemExecutionLogger   = new SystemExecutionLoggerToTextBox(edtSimDataLog);
            _configSystemDefinitions = ConfigSystemDefsLoader.Load();
            _systemDefinitionFactory = new SystemDefinitionFactory(_dataProvider, _systemDataLoader, new SlippageNone(), new CommissionNone(), _systemExecutionLogger);
            StatsFactories.Initialize();

            dbgPositions.OnPositionClick += dbgPositions_OnPositionClick;

            this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
            tcCharts.TabPages.Clear();
            PrepareStockDataRangeSource();
            InitializeSim();
            LoadConfig();
        }
Пример #7
0
        public override async Task Execute()
        {
            Result = await Session.LoadAsync <Msg>(Id);

            if (Result != null)
            {
                ResultFiles = await VisibleDisplayProjection
                              .Transform(Session.Query <VisibleFile, VisibleIndex>().Where(c => c.Id.In(Result.Files)))
                              .ToListAsync();

                ResultRecipients = await ResultProfileProjection
                                   .Transform(Session.Query <UserMaster, UserIndex>().Where(c => c.Id.In(Result.Recipients))
                                              .OfType <IEntityProfile>()).ToListAsync();

                if (!string.IsNullOrEmpty(Result.ReplyId))
                {
                    ResultReply = await MsgDisplayTrans
                                  .Transform(Session.Query <MsgMaster, MsgIndex>().Where(c => c.Id == Result.ReplyId))
                                  .FirstOrDefaultAsync();
                }
            }
        }
Пример #8
0
 private void Start()
 {
     targettingScript = CityPlacement.instance;
     gSP  = GameStartPhases.instance;
     msgD = MsgDisplay.instance;
 }
Пример #9
0
        public static string Get(string Url, string needMachineCode = "1")
        {
            string json = "";

            try
            {
                string   machineCode = MicroPrinter.App.AppContext.Instance.MachineCode;
                string[] textArray1  = new string[] { "GetStart ", Url, " MachineCode:", machineCode, "; needMachineCode: ", needMachineCode, "; GetEnd" };
                Console.WriteLine(string.Concat(textArray1));
                if (((needMachineCode != "1") || (machineCode == string.Empty)) && (needMachineCode != "-1"))
                {
                    Console.WriteLine("Get cannot send");
                    string[] textArray2 = new string[] { " Get 请求未发出 :机器码 不存在,接口且要求传机器码!!!" };
                    Console.WriteLine(string.Concat(textArray2));
                }
                else
                {
                    Console.WriteLine("Get can send");
                    string text1 = Url + MicroPrinter.App.AppContext.Instance.UrlCommon;
                    Url = text1;
                    try
                    {
                        Console.WriteLine("try to send Get request start");
                        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url);
                        request.Proxy                  = null;
                        request.KeepAlive              = false;
                        request.Method                 = "GET";
                        request.ContentType            = "application/json; charset=UTF-8";
                        request.AutomaticDecompression = DecompressionMethods.GZip;
                        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                        StreamReader    reader1  = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
                        string          str3     = reader1.ReadToEnd();
                        reader1.Close();
                        Stream responseStream = response.GetResponseStream();
                        responseStream.Close();
                        if (response != null)
                        {
                            response.Close();
                        }
                        if (request != null)
                        {
                            request.Abort();
                        }
                        json = str3;
                        Console.WriteLine("try to send Get request end");
                    }
                    catch (Exception exception)
                    {
                        Console.WriteLine("Get 网络异常: " + exception.Message);
                        MsgDisplay.ContentUpdate("提示:网络异常,请检查网络连接");
                        json = null;
                    }
                    JObject obj2 = JObject.Parse(json);
                    Console.Write("当前时间:" + $"{DateTime.Now}");
                    Console.WriteLine(" Get 请求服务器 from : " + Url);
                    Console.Write("当前时间:" + $"{DateTime.Now}");
                    Console.WriteLine(" Get 服务器返回:" + obj2);
                    if (obj2["status"].ToString() != "1")
                    {
                        MsgDisplay.ContentUpdate("提示:" + obj2["msg"].ToString());
                    }
                }
            }
            catch (Exception exception2)
            {
                Console.WriteLine("Get Exception: " + exception2.Message);
                json = null;
            }
            return(json);
        }