Esempio n. 1
0
        protected void btnsave_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime        aDateTime = DateTime.Now;
                NewsEntities    db        = new NewsEntities();
                int             id        = int.Parse(Request.QueryString["mabv"]);
                News.tb_BaiViet obj       = db.tb_BaiViet.FirstOrDefault(x => x.ID_BaiViet == id);

                News.tb_LSBaiViet obj1 = new News.tb_LSBaiViet();

                obj1.ID_BaiViet = id;
                obj1.GhiChu     = txtghichu.Text;
                obj1.ID_User    = int.Parse(Session["username"].ToString());
                obj1.ThoiGian   = aDateTime;
                db.tb_LSBaiViet.Add(obj1);
                db.SaveChanges();
                getdata();
                txtghichu.Text = "";
            }
            catch
            {
                // Lỗi
            }
        }
Esempio n. 2
0
        public string getTenLoaiTK(int ID)
        {
            NewsEntities db = new NewsEntities();
            int          tk = (int)db.tb_User.FirstOrDefault(x => x.ID_User == ID).ID_LoaiTK;

            return(db.tb_LoaiTK.FirstOrDefault(x => x.ID_LoaiTK == tk).TenLoaiTK);
        }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["username"] == null || Session["username"].ToString() == "")
         {
             Response.Redirect("Login.aspx");
         }
         else
         {
             NewsEntities db    = new NewsEntities();
             int          id    = int.Parse(Session["username"].ToString());
             int          count = db.tb_User.Count(x => x.ID_User == id && (x.ID_LoaiTK == 1 || x.ID_LoaiTK == 3));
             if (count == 1)
             {
                 if (Request.QueryString["mabv"] == null)
                 {
                 }
                 else
                 {
                     getdata();
                     lbten.Text = getTen();
                     lbmo.Text  = getMo();
                 }
             }
             else
             {
                 Session.Clear();
             }
         }
     }
 }
Esempio n. 4
0
        public void GetAllNews_ShouldReturnListOfNews()
        {
            var httpResponse    = httpClient.GetAsync("/api/news").Result;
            var newsFromService = httpResponse
                                  .Content.ReadAsAsync <List <News.Models.News> >()
                                  .Result
                                  .OrderBy(n => n.Title)
                                  .ToList();

            Assert.AreEqual(HttpStatusCode.OK, httpResponse.StatusCode);
            Assert.AreEqual(httpResponse.Content.Headers.ContentType.MediaType, "application/json");
            Assert.AreEqual(3, newsFromService.Count);

            var context          = new NewsEntities();
            var newsFromDatabase = context.News.OrderBy(n => n.Title).ToList();

            Assert.AreEqual(3, newsFromDatabase.Count);

            for (int i = 0; i < newsFromDatabase.Count; i++)
            {
                Assert.AreEqual(newsFromDatabase[i].Id, newsFromService[i].Id);
                Assert.AreEqual(newsFromDatabase[i].Title, newsFromService[i].Title);
                Assert.AreEqual(newsFromDatabase[i].Content, newsFromService[i].Content);
                Assert.AreEqual(newsFromDatabase[i].PublishDate, newsFromService[i].PublishDate);
            }
        }
Esempio n. 5
0
        public string getAnh()
        {
            int          id = int.Parse(Session["username"].ToString());
            NewsEntities db = new NewsEntities();

            return(db.tb_User.FirstOrDefault(x => x.ID_User == id).AnhDaiDien);
        }
Esempio n. 6
0
        public string getMo()
        {
            int          id = int.Parse(Request.QueryString["mabv"]);
            NewsEntities db = new NewsEntities();

            return(db.tb_BaiViet.FirstOrDefault(x => x.ID_BaiViet == id).NoiDung);
        }
Esempio n. 7
0
        // Lay ten chuyen muc tren cung end



        // Phân trang theo chuyên mục start
        // link tham khảo: https://www.dotnetcurry.com/ShowArticle.aspx?ID=345
        public void FetchData(int take, int pagesize)
        {
            int idcm = int.Parse(Request.QueryString["ID_ChuyenMuc"]);

            using (NewsEntities dc = new NewsEntities())
            {
                var query = from p in dc.BaiViet.Where(x => x.ID_ChuyenMuc == idcm).OrderBy(o => o.ID_BaiViet).Take(take).Skip(pagesize)
                            select new
                {
                    idbaiviet = p.ID_BaiViet,
                    anhthum   = p.AnhThumbnail,
                    Tenbai    = p.TenBaiViet,
                    Count     = dc.BaiViet.Where(x => x.ID_ChuyenMuc == idcm).Count()
                };

                NewsEntities    db      = new NewsEntities();
                PagedDataSource pgitems = new PagedDataSource();
                pgitems.AllowCustomPaging = true;
                pgitems.AllowPaging       = true;
                pgitems.DataSource        = query;
                pgitems.PageSize          = 3;
                dgvchuyenmuc.DataSource   = pgitems;
                dgvchuyenmuc.DataBind();
                if (!IsPostBack)
                {
                    RowCount = query.First().Count;
                    CreatePagingControl();
                }
            }
        }
Esempio n. 8
0
        public string getAnh1()
        {
            int          id = int.Parse(Request.QueryString["manv"].ToString());
            NewsEntities db = new NewsEntities();

            return(db.tb_User.FirstOrDefault(x => x.ID_User == id).AnhDaiDien);
        }
Esempio n. 9
0
        protected void btnAddcm_Click(object sender, EventArgs e)
        {
            NewsEntities db = new NewsEntities();

            News.tb_Role obj1 = new News.tb_Role();

            int cm = int.Parse(cbbChuyenMuc.SelectedValue);

            int tk = int.Parse(cbbLoaiTK.SelectedValue);

            if (int.Parse(cbbLoaiTK.SelectedValue) == 2)
            {
                int count = db.tb_Role.Count(x => x.ID_ChuyenMuc == cm && x.ID_LoaiTK == 2);

                if (count >= 1)
                {
                    lbhienthi1.Text = "Đã có tổng biên cho chuyên mục rồi";
                    return;
                }
            }
            lbhienthi1.Text   = "";
            obj1.ID_User      = Int32.Parse(txtMaNV.Text);
            obj1.ID_LoaiTK    = int.Parse(cbbLoaiTK.SelectedValue);
            obj1.ID_ChuyenMuc = int.Parse(cbbChuyenMuc.SelectedValue);

            db.tb_Role.Add(obj1);
            db.SaveChanges();
            getDGVCM2();
            getDGVCM1();
        }
Esempio n. 10
0
        public void UpdateNews_WhenDataIsValid_ShouldReturnStatusCodeOkAndUpdateNews()
        {
            var context      = new NewsEntities();
            var newsToUpdate = context.News.FirstOrDefault(n => n.Title == "News1");

            var content = new FormUrlEncodedContent(new[]
            {
                new KeyValuePair <string, string>("title", "Updated Title"),
                new KeyValuePair <string, string>("content", "Updated content"),
                new KeyValuePair <string, string>("publishDate",
                                                  newsToUpdate.PublishDate.ToString(CultureInfo.InvariantCulture))
            });

            var httpResponse    = httpClient.PutAsync("/api/news/" + newsToUpdate.Id, content).Result;
            var newsFromService = httpResponse.Content.ReadAsAsync <News.Models.News>().Result;

            Assert.AreEqual(HttpStatusCode.OK, httpResponse.StatusCode);

            context = new NewsEntities();
            var newsFromDatabase = context.News.Find(newsToUpdate.Id);

            Assert.IsNotNull(newsFromDatabase);
            Assert.AreEqual("Updated Title", newsFromDatabase.Title);
            Assert.AreEqual("Updated content", newsFromDatabase.Content);
            Assert.AreEqual(new DateTime(2015, 12, 20, 12, 0, 0), newsFromDatabase.PublishDate);

            Assert.AreEqual(3, context.News.Count());
        }
Esempio n. 11
0
        protected void btnrepass_Click(object sender, EventArgs e)
        {
            NewsEntities db = new NewsEntities();
            int          id = int.Parse(Session["username"].ToString());

            string oldpass = db.tb_User.FirstOrDefault(x => x.ID_User == id).Password.ToString();

            if (oldpass == getMKMH(txtoldpass.Text))
            {
                if (txtpass.Text == txtrepass.Text)
                {
                    News.tb_User obj = db.tb_User.FirstOrDefault(x => x.ID_User == id);
                    if (obj == null)
                    {
                        Response.Redirect("Index.aspx");
                    }
                    else
                    {
                        obj.Password = getMKMH(txtrepass.Text);
                        db.SaveChanges();
                        Response.Redirect("Login.aspx");
                    }
                }
            }
            else
            {
            }
        }
        public void SeedDatabase()
        {
            var context = new NewsEntities();

            context.News.Delete();


            context.News.Add(new News.Models.News()
            {
                Title       = "News1",
                Content     = "Content1",
                PublishDate = DateTime.Parse("20.01.2015")
            });

            context.News.Add(new News.Models.News()
            {
                Title       = "News2",
                Content     = "Content2",
                PublishDate = DateTime.Parse("21.01.2015")
            });

            context.News.Add(new News.Models.News()
            {
                Title       = "News3",
                Content     = "Content3",
                PublishDate = DateTime.Parse("20.01.2015")
            });

            context.SaveChanges();
        }
Esempio n. 13
0
        public string getTenCM(int ID)
        {
            NewsEntities db = new NewsEntities();
            int          cm = (int)db.tb_Role.FirstOrDefault(x => x.ID_User == ID).ID_ChuyenMuc;

            return(db.tb_ChuyenMuc.FirstOrDefault(x => x.ID_ChuyenMuc == cm).TenChuyenMuc);
        }
        public IHttpActionResult GetArticles(string status = "")
        {
            var articles = new List <ViewArticleJournalist>();

            //ViewModelJournalist jr = new ViewModelJournalist();

            using (var context = new NewsEntities())
            {
                //var article = context.Article.ToList();

                var article = context.Article.Where(f => f.Status == status).ToList();
                if (article == null)
                {
                    return(NotFound());
                }

                foreach (var n in article)
                {
                    ViewArticleJournalist vm = new ViewArticleJournalist();
                    vm.img          = n.Img;
                    vm.Titre        = n.Titre;
                    vm.body         = n.Body;
                    vm.Date         = n.Date;
                    vm.Journalistes = n.Journalistes.Nom;
                    articles.Add(vm);
                }
            }
            return(Ok(articles));
        }
Esempio n. 15
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                NewsEntities db = new NewsEntities();

                News.tb_User obj = new News.tb_User();
                obj.TenUser  = txtTenNV.Text;
                obj.NickName = txtNgheDanh.Text;
                obj.DiaChi   = txtDiaChi.Text;
                obj.Email    = txtEmail.Text;
                obj.GioiTinh = txtGioiTinh.Text;
                obj.Password = mahoa(txtMaNV.Text);
                db.tb_User.Add(obj);
                db.SaveChanges();

                News.tb_Role objcm = new News.tb_Role();
                objcm.ID_User      = int.Parse(txtMaNV.Text);
                objcm.ID_ChuyenMuc = int.Parse(cbbChuyenMuc.SelectedValue);
                objcm.ID_LoaiTK    = int.Parse(cbbLoaiTK.SelectedValue);

                db.tb_Role.Add(objcm);
                db.SaveChanges();

                Response.Redirect("User.aspx");
            }
            catch
            {
                //
            }
        }
Esempio n. 16
0
        public ActionResult AddImg(ProfileImg model, HttpPostedFileBase imageUpload)
        {
            var    db            = new NewsEntities();
            string currentUserId = User.Identity.GetUserId();

            model.jourId = currentUserId;
            ProfileImg img1 = db.ProfileImgs.FirstOrDefault(i => i.jourId == currentUserId);

            //if (db.ProfileImgs.Where(m => model.jourId == currentUserId) == null)
            //{
            if (img1 == null)
            {
                if (imageUpload != null)
                {
                    model.img = new byte[imageUpload.ContentLength];
                    imageUpload.InputStream.Read(model.img, 0, imageUpload.ContentLength);
                    var fileName = Path.GetFileName(imageUpload.FileName);
                    var path     = Path.Combine(Server.MapPath("~/images"), fileName);
                    imageUpload.SaveAs(path);
                    ViewBag.fileName = imageUpload.FileName;
                }
                db.ProfileImgs.Add(model);
                db.SaveChanges();
                ViewBag.Message = "File uploaded successfully.";
            }
            else
            {
                ViewBag.Message = "You have already upload an profile image before.";
            }
            return(View(model));
        }
Esempio n. 17
0
 public string GetProfile()
 {
     if (User.Identity.IsAuthenticated)
     {
         string userId     = User.Identity.GetUserId();
         var    db         = new NewsEntities();
         var    journalist = db.Journalists.Find(userId);
         if (journalist != null)
         {
             if (journalist.ProfileImgs.Count() != 0)
             {
                 byte[] img = journalist.ProfileImgs.FirstOrDefault(p => p.jourId == journalist.JourID).img;
                 return(@System.Convert.ToBase64String(img));
             }
             else
             {
                 byte[] noImg = db.ProfileImgs.Find(13).img;
                 return(@System.Convert.ToBase64String(noImg));
             }
         }
         else
         {
             byte[] noImg = db.ProfileImgs.Find(13).img;
             return(@System.Convert.ToBase64String(noImg));
         }
     }
     else
     {
         byte[] noImg = db.ProfileImgs.Find(13).img;
         return(@System.Convert.ToBase64String(noImg));
     }
 }
Esempio n. 18
0
        protected void btnadd_Click(object sender, EventArgs e)
        {
            NewsEntities db = new NewsEntities();

            News.tb_ChuyenMuc obj = new News.tb_ChuyenMuc();

            if (int.Parse(cbbchuyenmuccha.SelectedValue) == 101)
            {
                obj.TenChuyenMuc    = txtten.Text;
                obj.ID_ChuyenMucCha = 1;

                db.tb_ChuyenMuc.Add(obj);
                db.SaveChanges();

                getdata();
                getcbbcm();
            }
            else
            {
                obj.TenChuyenMuc    = txtten.Text;
                obj.ID_ChuyenMucCha = int.Parse(cbbchuyenmuccha.SelectedValue);

                db.tb_ChuyenMuc.Add(obj);
                db.SaveChanges();
                getdata();
                getcbbcm();
            }
        }
Esempio n. 19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["username"] == null || Session["username"].ToString() == "")
         {
             Response.Redirect("Login.aspx");
         }
         else
         {
             NewsEntities db    = new NewsEntities();
             int          id    = int.Parse(Session["username"].ToString());
             int          count = db.tb_User.Count(x => x.ID_User == id && x.ID_LoaiTK == 1);
             if (count == 1)
             {
                 getcbbcm();
                 getdata();
                 txtid.Enabled = false;
             }
             else
             {
                 Session.Clear();
             }
         }
     }
 }
Esempio n. 20
0
        public IHttpActionResult GetJournalist(int id = 0)
        {
            JournalistViewModel vm;

            using (var context = new NewsEntities())
            {
                var j = context.Journalistes.Where(jl => jl.ID == id).FirstOrDefault();
                if (j == null)
                {
                    return(NotFound());
                }


                vm              = new JournalistViewModel();
                vm.ID           = id;
                vm.Nom          = j.Nom;
                vm.Prenom       = j.Prenom;
                vm.NombrArticle = j.Article.Count();
                var al = new List <ArticleModel>();
                foreach (var a in j.Article)
                {
                    ArticleModel am = new ArticleModel();
                    am.ID    = a.ID;
                    am.Titre = a.Titre;
                    am.Body  = a.Body;
                    am.Img   = a.Img;
                    am.Date  = a.Date.ToString();
                    am.Video = a.video;

                    al.Add(am);
                }
                vm.articles = al;
            };
            return(Ok(vm));
        }
Esempio n. 21
0
        public string getdata2()
        {
            NewsEntities db        = new NewsEntities();
            DateTime     aDateTime = DateTime.Now;

            int month1 = int.Parse(aDateTime.Month.ToString());

            int year = int.Parse(aDateTime.Year.ToString());

            int month2 = 0;
            int year2  = 0;

            int t = int.Parse(aDateTime.AddMonths(-1).Month.ToString());

            if (t == 12)
            {
                month2 = 12;
                year2  = year - 1;
            }
            else
            {
                month2 = month1;
                year2  = year;
            }

            List <News.ThongKe> monthdata2 = db.ThongKe.Where(x => x.ThoiGian.Month == month2 && x.ThoiGian.Year == year2).ToList();
            string tk2 = "";

            for (int i = 0; i < monthdata2.Count(); i++)
            {
                tk2 += monthdata2[i].SoTruyCap.ToString() + "/";
            }
            tk2 = tk2.Substring(0, tk2.Length - 1);
            return(tk2);
        }
Esempio n. 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //string idbv = Request.QueryString["ID_BaiViet"];
                getbaiviet();
                shortcm();
                relatednewbaivietmoi();
                getbaivietcungcm();
                getdatafeature();
                getdatapopular();
                getdatalastest();
                laytencmpushtag();
                countbaiviet();
                getdatacommentlogin();
                getdatacommentlogout();

                int          id = int.Parse(Request.QueryString["ID_Baiviet"]);
                NewsEntities db = new NewsEntities();

                int lx = int.Parse(db.tb_BaiViet.FirstOrDefault(x => x.ID_BaiViet == id).LuotXem.ToString());

                News.tb_BaiViet obj = db.tb_BaiViet.FirstOrDefault(x => x.ID_BaiViet == id);

                obj.LuotXem = lx + 1;
                db.SaveChanges();
            }
        }
Esempio n. 23
0
        static void Main()
        {
            var  ctxUser1     = new NewsEntities();
            bool updateFailed = false;

            Console.WriteLine("Application started.");
            Console.WriteLine("Text from DB: " + ctxUser1.DbNews.FirstOrDefault().NewsContent + "\nEnter the corrected text:");
            ctxUser1.DbNews.FirstOrDefault().NewsContent = "Baby pandas team up to resist their medication";


            var ctxUser2 = new NewsEntities();

            Console.WriteLine("Application started.");
            Console.WriteLine("Text from DB: " + ctxUser1.DbNews.FirstOrDefault().NewsContent + "\nEnter the corrected text:");
            ctxUser2.DbNews.FirstOrDefault().NewsContent = @"Two young pandas were unimpressed when a breeder tried to feed them medicine instead of their usual bamboo in southwest China's Chengdu.
The keeper was trying to use a syringe to put medicine in the cubs' mouths but, as this video shows, they resisted by rolling over and climbing on top of him.";

            try
            {
                ctxUser1.SaveChanges();
                Console.WriteLine("Changes successfully saved in the DB.");
            }
            catch (Exception)
            {
                Console.WriteLine("Conflict!");
                updateFailed = true;
            }

            try
            {
                ctxUser2.SaveChanges();
                Console.WriteLine("Changes successfully saved in the DB.");
            }
            catch (Exception)
            {
                Console.WriteLine("Conflict!");
                updateFailed = true;
            }

            while (updateFailed)
            {
                using (var ctx = new NewsEntities())
                {
                    Console.WriteLine("Text from DB: " + ctx.DbNews.FirstOrDefault().NewsContent + ". \nEnter the corrected text:");
                    ctx.DbNews.FirstOrDefault().NewsContent = @"Two young pandas were unimpressed when a breeder tried to feed them medicine instead of their usual bamboo in southwest China's Chengdu.
The keeper was trying to use a syringe to put medicine in the cubs' mouths but, as this video shows, they resisted by rolling over and climbing on top of him.";
                    try
                    {
                        ctx.SaveChanges();
                        Console.WriteLine("Changes successfully saved in the DB.");
                        updateFailed = false;
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("Another user is accessing this entry atm. Please try again later.");
                    }
                }
            }
        }
Esempio n. 24
0
        // láy ten bài viết hiện thị trong tab mostread theo id_baiviet end


        // Lây tên bài viết hiện thị trong tab mostrecent theo id_bài viết start
        public void getdatamostrecent()
        {
            NewsEntities db = new NewsEntities();
            List <News_Users.BaiViet> listmostread = db.BaiViet.OrderBy(x => x.ID_BaiViet).Skip(8).Take(4).ToList();

            dgvmostrecent.DataSource = listmostread;
            dgvmostrecent.DataBind();
        }
Esempio n. 25
0
        public int getRole()
        {
            int          id = int.Parse(Session["username"].ToString());
            NewsEntities db = new NewsEntities();
            string       r  = db.tb_User.FirstOrDefault(x => x.ID_User == id).ID_LoaiTK.ToString();

            return(int.Parse(r));
        }
Esempio n. 26
0
        public int getRole2()
        {
            int          id = int.Parse(Session["username"].ToString());
            NewsEntities db = new NewsEntities();
            int          r  = db.tb_Role.Count(x => x.ID_User == id && x.ID_LoaiTK == 2);

            return(r);
        }
Esempio n. 27
0
        // lấy ten bài viết hiện thị trong tab mostrecent theo id_baiviet end


        // lay tat cả bài viet start
        public void getallbaiviet()
        {
            NewsEntities db = new NewsEntities();
            List <News_Users.BaiViet> listall = db.BaiViet.OrderBy(x => x.ID_BaiViet).ToList();

            tatcabaiviet.DataSource = listall;
            tatcabaiviet.DataBind();
        }
Esempio n. 28
0
        public void getData()
        {
            NewsEntities        db    = new NewsEntities();
            List <News.tb_User> lstSP = db.tb_User.Where(x => x.ID_LoaiTK != 4 && x.ID_User != 1).ToList();

            dgvuser.DataSource = lstSP;
            dgvuser.DataBind();
        }
Esempio n. 29
0
        //Slide bài viet mới theo id bài viêt end


        ////Hien thi 3 bài viets random Start
        //public void getbaivietrandom()
        //{
        //    NewsEntities db = new NewsEntities();
        //    List<News_Users.BaiViet> num = db.BaiViet.OrderBy(x => x.ID_BaiViet).ToList();
        //    Random rand = new Random();
        //    int toskip = rand.Next(1, 10);
        //    List<News_Users.BaiViet> listsport = db.BaiViet.OrderBy(x => x.TGViet).Skip(toskip).Take(3).ToList();
        //    dgvbaivietrandom.DataSource = listsport;
        //    dgvbaivietrandom.DataBind();
        //}
        //public string showbaivietrandom(string tenbaiviet)
        //{
        //    NewsEntities db = new NewsEntities();
        //    return db.BaiViet.First(x => x.TenBaiViet == tenbaiviet).TenBaiViet;
        //}
        //public string layanhanhtheoidbai(int idbaiviet)
        //{
        //    NewsEntities db = new NewsEntities();
        //    return db.BaiViet.First(x => x.ID_BaiViet == idbaiviet).AnhThumbnail;
        //}
        //// Hiện thị 3 bài viết randon END



        // lấy tên các chuyên mục cha và con hiên thị trong repeater start
        public void getdgvchuyenmuccha()
        {
            NewsEntities db = new NewsEntities();
            List <News_Users.ChuyenMuc> listcha = db.ChuyenMuc.Where(x => x.ID_ChuyenMucCha == 1 && x.ID_ChuyenMuc != 101).ToList();

            dgvchuyenmuccha.DataSource = listcha;
            dgvchuyenmuccha.DataBind();
        }
Esempio n. 30
0
        //Slide bài viet mới theo id bài viêt start
        public void slidetenbaivietmoi()
        {
            NewsEntities db = new NewsEntities();
            List <News_Users.BaiViet> listbaiviet = db.BaiViet.OrderByDescending(x => x.ID_BaiViet).Take(6).ToList();

            dgvbaivietmoi.DataSource = listbaiviet;
            dgvbaivietmoi.DataBind();
        }
        private static void Main()
        {
            // First User
            var firstContext = new NewsDB();

            // Step: 1

            var firstUser = new NewsEntities();
            var secondUser = new NewsEntities();

            try
            {
                Console.WriteLine("User one text from DB: " + firstUser.News.First().NewsContent);
                Console.WriteLine("User two text from DB: " + secondUser.News.First().NewsContent);

                Console.Write("User one enter the corected text: ");
                firstUser.News.First().NewsContent = Console.ReadLine();

                Console.Write("User two enter the corected text: ");
                secondUser.News.First().NewsContent = Console.ReadLine();

                firstUser.SaveChanges();
                Console.WriteLine("User One successfully saved in the DB.");

                secondUser.SaveChanges();
                Console.WriteLine("User Two successfully saved in the DB.");
            }
            catch (DbUpdateConcurrencyException)
            {
                Console.WriteLine("Conflict!");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }