Esempio n. 1
0
        private void InitUI()
        {
            Action <LawData> action = null;

            MouseTool.ShowLoading();
            LawCT_Title.Text = Settings.Default.LawButtonName;
            new HttpRequest();
            if (NetworkTool.CheckNetwork() > 0)
            {
                if (action == null)
                {
                    action = new Action <LawData>(_003CInitUI_003Eb__1b);
                }
                GetLawData.AsyncPOST(action);
                return;
            }
            DataTable dataTable = MSCE.GetDataTable("select LawJson from LawData");

            if (dataTable.Rows.Count > 0)
            {
                LawData ld = JsonConvert.DeserializeObject <LawData>(dataTable.Rows[0]["LawJson"].ToString());
                GetLawData_DoAction(ld);
            }
            else
            {
                AutoClosingMessageBox.Show("無法取得資料,請稍後再試");
                MouseTool.ShowArrow();
            }
        }
Esempio n. 2
0
        private void InitUI()
        {
            MouseTool.ShowLoading();
            //LawCT_Title.Text = PaperLess_Emeeting.Properties.Settings.Default.LawButtonName;
            LawCT_Title.Text = ButtonName;
            Network.HttpRequest hr = new Network.HttpRequest();
            if (NetworkTool.CheckNetwork() > 0)
            {
                // 非同步POST方法
                GetLawData.AsyncPOST((ld) => { GetLawData_DoAction(ld); });
                //, () => { this.Dispatcher.BeginInvoke(new Action(() => { AutoClosingMessageBox.Show("無法取得資料,請稍後再試"); })); });
            }
            else
            {
                DataTable dt = MSCE.GetDataTable("select LawJson from LawData");


                if (dt.Rows.Count > 0)
                {
                    LawData ld = JsonConvert.DeserializeObject <LawData>(dt.Rows[0]["LawJson"].ToString());
                    GetLawData_DoAction(ld);
                }
                else
                {
                    AutoClosingMessageBox.Show("無法取得資料,請稍後再試");
                    MouseTool.ShowArrow();
                }
            }



            #region  步POST
            //LawData lawData = GetLawData.POST();

            //if (lawData != null)
            //{
            //    int i=0;
            //    foreach (LawDataLaw item in lawData.LawList)
            //    {
            //        i++;
            //        bool IsLastRow= (i==lawData.LawList.Length);
            //        LawRowSP.Children.Add(new LawRow(item,IsLastRow, LawListCT_HangTheDownloadEvent_Callback));
            //    }
            //}
            //else
            //{
            //    AutoClosingMessageBox.Show("無法取得資料,請稍後再試");
            //}
            #endregion
        }