Пример #1
0
        public bool DeleteUserDetails(phong useInfo)
        {
            phongban dt = db.phongbans.Single(s => s.ma.Equals(useInfo.Ma));

            db.phongbans.Remove(dt);
            db.SaveChanges();
            return(true);
        }
Пример #2
0
        public void Updatephongban(phong useInfo)
        {
            phongban dt = db.phongbans.Single(s => s.ma.Equals(useInfo.Ma));;

            //  dt.ma = useInfo.Ma;
            dt.ten   = useInfo.Ten;
            dt.sdt   = useInfo.SDT;
            dt.email = useInfo.Email;
            //    db.phongbans.Add(dt);
            db.SaveChanges();
        }
Пример #3
0
        public string InsertUserDetails(phong useInfo)
        {
            string Message;

            try
            {
                phongban dt = new phongban();
                dt.ma    = useInfo.Ma;
                dt.ten   = useInfo.Ten;
                dt.sdt   = useInfo.SDT;
                dt.email = useInfo.Email;
                db.phongbans.Add(dt);
                db.SaveChanges();
                Message = useInfo.Ten + "Success";
            }
            catch
            {
                Message = useInfo.Ten + "Thêm Thất bại!!";
            }
            return(Message);
        }