Beispiel #1
0
        /// <summary>
        /// 清除输入框
        /// </summary>
        /// <param name="o"></param>
        public void CleanData(object o)
        {
            this.Title  = "";
            this.Detail = "";

            this.AddVisibility  = Visibility.Visible;
            this.EditVisibility = Visibility.Collapsed;

            this.WorkDateTime = DateTime.Now;
            this.Begin_time   = DateTime.Now;
            this.End_time     = DateTime.Now;

            this.Status = StatusCollection.First();
        }
Beispiel #2
0
        /// <summary>
        /// 初始化,读取在线配置信息
        /// </summary>
        private void Inint(object o)
        {
            var loadingDialog = new LoadingDialog();

            var result = DialogHost.Show(loadingDialog, "RootDialog", delegate(object sender, DialogOpenedEventArgs args)
            {
                string access_token = MainStaticData.AccessToken;

                string get_data = "https://api.bobdong.cn/time_manager/data/select?access_token=" + access_token;

                var datas = NetHelper.HttpCall(get_data, null, HttpEnum.Get);

                this.ThisContorler = o;

                var datasObject = JsonHelper.Deserialize <ReturnData <ObservableCollection <WorkTimeData> > >(datas);

                ThreadStart start = delegate()
                {
                    Mainthread.BeginInvoke((Action) delegate()// 异步更新界面
                    {
                        if (datasObject.code != 0)
                        {
                        }
                        else
                        {
                            DataItems.Clear();
                            foreach (var item in datasObject.data)
                            {
                                DataItems.Add(new WorkTimeData_ViewData(item));
                            }
                        }

                        StatusCollection = MainStaticData.StstusCollection;

                        TypeCollection = MainStaticData.TypeCollection;

                        WorkDateTime = DateTime.Now;

                        Status = StatusCollection.First();


                        args.Session.Close(false);
                    });
                };

                new Thread(start).Start(); // 启动线程
            });
        }