Ejemplo n.º 1
0
        public bool doAuth(string username, string password, Context context)
        {
            GlobalUsername = username;
            GlobalPassword = password;
            string[] str = connection();

            if (str[0] == "0")
            {
                ISharedPreferences       prefs  = Application.Context.GetSharedPreferences("FlowPref", FileCreationMode.Private);
                ISharedPreferencesEditor editor = prefs.Edit();
                editor.PutString("uname", username);
                editor.PutString("uid", str[1]);
                editor.PutString("authmode", str[2]);
                editor.PutString("userstatus", str[3]);
                editor.PutString("logincount", str[4]);
                editor.PutString("lastlogin", str[5]);
                editor.Apply();

                //it was a successfull login so update the values in db
                OnlineServices.BasicHttpBinding_IService1 obj = new OnlineServices.BasicHttpBinding_IService1();
                obj.UpdateUserLogin(str[1], Int32.Parse(str[4]), true);
                return(true);
            }
            else
            {
                if (str[2] != "local")
                {
                    return(nonSQLAuthentication(str[2]));
                }
                else
                {
                    return(false);
                }
            }
        }
Ejemplo n.º 2
0
 private string[] connection()
 {
     string[] strDefault = new string[2];
     try
     {
         OnlineServices.BasicHttpBinding_IService1 obj = new OnlineServices.BasicHttpBinding_IService1();
         return(obj.GetUserData(GlobalUsername, GlobalPassword));
     }
     catch (Exception ex)
     {
         strDefault[0] = "5";
         strDefault[1] = ex.InnerException.Message.ToString();
         return(strDefault);
     }
 }
Ejemplo n.º 3
0
        public void GetProfile(string uid)
        {
            string[] strDefault             = new string[6];
            ISharedPreferencesEditor editor = prefs.Edit();

            try
            {
                OnlineServices.BasicHttpBinding_IService1 obj = new OnlineServices.BasicHttpBinding_IService1();
                strDefault = obj.GetProfile(uid);
                editor.PutString("profileguid", strDefault[0]);
                editor.PutString("firstname", strDefault[2]);
                editor.PutString("lastname", strDefault[3]);
                editor.PutString("fullname", strDefault[2] + " " + strDefault[3]);
                editor.PutString("email", strDefault[4]);
                editor.PutString("phone", strDefault[5]);
                editor.Apply();
            }
            catch (Exception ex)
            {
            }
        }