Git Product home page Git Product logo

medicle-app-'s Introduction

Medicle app.

Medical treatment and patient booking.

It's Medical/health app for fast and affordable filling for medical treatment app start up and login trace.

Apps.cs MainPage = new RootPage ();

RootPage.cs public RootPage () { ShowLoginDialog();

	async void ShowLoginDialog()
	{
		var page = new LoginPage();
        ViewPages.Instance.loginPage = page;
		await Navigation.PushModalAsync(page);

LoginPage.cs public LoginPage () { InitializeComponent (); this.BindingContext = new LoginViewModel(this.Navigation); NavigationPage.SetHasNavigationBar(this, false);

LoginViewModel.cs public LoginViewModel( INavigation p_navigation ) { LoginCommand = new Command(async (object o) => { await API.Instance.Login(this.navigation, EmailAddress, Password, ConnectionSuccess, ConnectionFail); });

called whenever response from server is recieved

    private async Task ConnectionSuccess(API.LoginResponse response)
    {
        API.Instance.SaveAccount(response.token, response.user);
        ViewPages.Instance.homePage.Refresh();
        if (response.user != null && response.user.isAccountInfoEmpty())
        {
            ViewPages.Instance.rootPage.goToAccountInfoPage();
            ViewPages.Instance.accountInfoPage.showEditAccountInfoPage();
        }
        try {
        await navigation.PopModalAsync();
        await navigation.PopModalAsync();
        } catch (Exception e) {
            Console.WriteLine("LoginViewModel: Warning cannot pop model");
        }
    }

called whenever error response from server is recieved

    private async Task ConnectionFail(API.ServerResponseErrorCode errorCode)
    {
        if (errorCode == API.ServerResponseErrorCode.ERROR_CONNECTION_TIMEOUT)
            await MessagePopup.Show(this.navigation, MessagePopup.Type.Error, MessagePopup.Icon.Connection, "Oops!", "Server is unreachable");
        
        else if (errorCode == API.ServerResponseErrorCode.ERROR_INCORRECT_USERNAME_OR_PASSWORD)
            await MessagePopup.Show(this.navigation, MessagePopup.Type.Warning, MessagePopup.Icon.User, "Oops!", "Incorrect email address or password");

        else
            await MessagePopup.Show(this.navigation, MessagePopup.Type.Error, MessagePopup.Icon.User, "Sorry", "An unknown error has appeared");
    };

medicle-app-'s People

Contributors

mrpranjal001 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.