Example #1
0
        public bool UpdateReceptionistInfo(string uname, string pass, string fullname, string phone, string addresss)
        {
            Receptionist a = e.Receptionists.FirstOrDefault(Receptionist => Receptionist.Username == uname);

            if (a == null)
            {
                return(false);
            }
            if (a == null)
            {
                return(false);
            }
            if (pass != "")
            {
                a.Password = pass;
            }
            if (fullname != "")
            {
                a.FullName = fullname;
            }
            if (phone != null)
            {
                a.Phone = phone;
            }
            if (addresss != "")
            {
                a.Address = addresss;
            }
            e.SaveChanges();
            return(true);
        }
Example #2
0
        public string authenticateReceptionist(string username, string pass, ref string i)
        {
            Receptionist Rec = e.Receptionists.FirstOrDefault(Admin => Admin.Username == username && Admin.Password == pass);

            if (Rec != null)
            {
                i = Rec.Username;
                return(Rec.FullName);
            }
            return("");
        }
Example #3
0
        public bool DeleteReceptionistInfo(string uname)
        {
            Receptionist r = e.Receptionists.FirstOrDefault(Receptionist => Receptionist.Username == uname);

            if (r == null)
            {
                return(false);
            }
            e.Receptionists.Remove(r);
            e.SaveChanges();
            return(true);
        }
Example #4
0
        public bool AddReceptionist(string uname, string pass, string fullname, string phone, string addresss)
        {
            Receptionist a = new Receptionist();

            a.Username = uname;
            a.Password = pass;
            a.FullName = fullname;
            a.Phone    = phone;
            a.Address  = addresss;

            e.Receptionists.Add(a);
            e.SaveChanges();
            return(true);
        }