public bool loggInn(AnsattModel.LogInAnsattModel ansatt)
 {
     return isValid(ansatt.anr, ansatt.Password);
 }
        public bool loggInn(AnsattModel.LogInAnsattModel ansatt)
        {
            try
                {
                    if (ansatt == null || ansatt.anr == null || ansatt.anr == "" || ansatt.Password == null || ansatt.Password == "")
                        return false;
                    return isValid(ansatt.anr, ansatt.Password);
                }
                catch (System.Data.SqlClient.SqlException ex)
                {
                    SWKA.WriteLine("Message :" + ex.Message + "<br/>" + Environment.NewLine + "StackTrace :" + ex.StackTrace +
                    "" + Environment.NewLine + "Date :" + DateTime.Now.ToString());
                    SWKA.WriteLine(Environment.NewLine + "-----------------------------------------------------------------------------" + Environment.NewLine);
                }
                catch (InvalidOperationException ex)
                {
                    SWKA.WriteLine("Message :" + ex.Message + "<br/>" + Environment.NewLine + "StackTrace :" + ex.StackTrace +
                     "" + Environment.NewLine + "Date :" + DateTime.Now.ToString());
                    SWKA.WriteLine(Environment.NewLine + "-----------------------------------------------------------------------------" + Environment.NewLine);
                }
                catch (ArgumentException ex)
                {
                    SWKA.WriteLine("Message :" + ex.Message + "<br/>" + Environment.NewLine + "StackTrace :" + ex.StackTrace +
                     "" + Environment.NewLine + "Date :" + DateTime.Now.ToString());
                    SWKA.WriteLine(Environment.NewLine + "-----------------------------------------------------------------------------" + Environment.NewLine);
                }
                catch (NullReferenceException ex)
                {
                    SWKA.WriteLine("Message :" + ex.Message + "<br/>" + Environment.NewLine + "StackTrace :" + ex.StackTrace +
                      "" + Environment.NewLine + "Date :" + DateTime.Now.ToString());
                    SWKA.WriteLine(Environment.NewLine + "-----------------------------------------------------------------------------" + Environment.NewLine);
                }
                catch (SystemException ex)
                {
                    SWKA.WriteLine("Message :" + ex.Message + "<br/>" + Environment.NewLine + "StackTrace :" + ex.StackTrace +
                     "" + Environment.NewLine + "Date :" + DateTime.Now.ToString());
                    SWKA.WriteLine(Environment.NewLine + "-----------------------------------------------------------------------------" + Environment.NewLine);
                }
                catch (Exception ex)
                {
                    SWKA.WriteLine("Message :" + ex.Message + "<br/>" + Environment.NewLine + "StackTrace :" + ex.StackTrace +
                    "" + Environment.NewLine + "Date :" + DateTime.Now.ToString());
                    SWKA.WriteLine(Environment.NewLine + "-----------------------------------------------------------------------------" + Environment.NewLine);
                }

                return false;
        }