public string AddEmergencyContanct(EmerygencyContact emerygencycontact)
        {
            var data = _SQLiteConnection.Table <EmerygencyContact>();
            var d1   = data.Where(x => x.name.ToLower() == emerygencycontact.name.ToLower()).FirstOrDefault();

            if (d1 == null)
            {
                _SQLiteConnection.Insert(emerygencycontact);
                return("Sucessfully Added");
            }
            else
            {
                var d2 = (from values in data
                          where values.name == d1.name
                          select values).FirstOrDefault();
                if (d2 != null)
                {
                    d2.phone1   = emerygencycontact.phone1;
                    d2.name     = emerygencycontact.name;
                    d2.relation = emerygencycontact.relation;
                    return("Sucessfully Updated");
                }
                else
                {
                    return("Already exist");
                }
            }
        }
 public ContacDetails(EmerygencyContact e)
 {
     username = Women_Safety_App.App.userName;
     InitializeComponent();
     emergencyContact1.ReturnCommand = new Command(() => emergencyContact1.Focus());
     //relationName = new Command(() => relationName.Focus());
     name.ReturnCommand = new Command(() => name.Focus());
 }
        public EmerygencyContact GetUserEmergencyContanctsForCall(string username)
        {
            var d1   = new EmerygencyContact();
            var data = _SQLiteConnection.Table <EmerygencyContact>().ToList();

            d1 = data.Where(x => x.username.ToLower() == username.ToLower() && x.priority.ToLower() == "high").FirstOrDefault();
            if (d1 == null)
            {
                d1 = data.Where(x => x.username.ToLower() == username.ToLower() && x.priority.ToLower() == "medium").FirstOrDefault();
                if (d1 == null)
                {
                    d1 = data.Where(x => x.username.ToLower() == username.ToLower() && x.priority.ToLower() == "low").FirstOrDefault();
                    return(d1);
                }
                else
                {
                    return(d1);
                }
            }
            else
            {
                return(d1);
            }
        }