Ejemplo n.º 1
0
        private async void userTableControl_Refresh(object sender, ItemClickEventArgs e)
        {
            try
            {
                string jsonResult = string.Empty;
                if (!String.IsNullOrEmpty(signinControl.Userinfo.Id))
                {
                    jsonResult = await LinqHelper.UpdateData("User", signinControl.Userinfo);
                }
                else
                {
                    jsonResult = await LinqHelper.SaveData(JsonConvert.SerializeObject(signinControl.Userinfo), "User");
                }

                var result = JsonConvert.DeserializeObject <JsonChangedTemplate>(jsonResult);
                if (null != result)
                {
                    if (result.ResultCode == (int)ResultCodeType.操作成功)
                    {
                        init();
                    }
                }
                signinControl.Dispose();
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
Ejemplo n.º 2
0
        private async void SigninControl_AddRecordClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                string jsonResult = await LinqHelper.Signin(JsonConvert.SerializeObject(signinControl.Userinfo));

                var result = JsonConvert.DeserializeObject <JsonChangedTemplate>(jsonResult);
                if (result != null)
                {
                    await MainPage.ShowMessage(result.ResultCode);
                }
                else
                {
                    this.LoginControl.Userinfo = new UserInfo();
                }
                signinControl.Dispose();
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }