Ejemplo n.º 1
0
        async public Task <Boolean> Run(string businessCode, string username, string password)
        {
            //var rezz = await WebServiceFunc.Login(businessCode, username, password);

            UIFunc.ShowLoading("Authorization...");
            var url0 = "Authenticate?businessCode=" + Uri.EscapeDataString(businessCode)
                       + "&username="******"&password="******"Error in authorization procedure");

                return(false);
            }

            var result = WebServiceFunc.DeserializeObjectFromStream <AuthenticateReturn>(rez.Value);

            if (!String.IsNullOrEmpty(result.Error))
            {
                UIFunc.HideLoading();
                await UIFunc.AlertError(result.Error);

                return(false);
            }

            var optrow = UserOptions.GetCurrent();

            optrow.Username      = username;
            optrow.Password      = password;
            optrow.UserRowId     = result.UserRowId;
            optrow.BusinessRowId = result.BusinessRowId;
            optrow.BusinessCode  = result.BusinessCode;
            DB.Update(optrow);

            UIFunc.HideLoading();
            return(true);
        }