예제 #1
0
        public AboutUsModel GenerateAboutUsModel()
        {
            AboutUsModel aum = new AboutUsModel();
            try
            {
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    var aboutus = from about in vdc.AboutUs.ToList()
                                  orderby about.AboutUsId ascending
                                  select about;
                    aum = new AboutUsModel();
                    aum.AboutUsId = aboutus.FirstOrDefault().AboutUsId;
                    aum.AboutUsParagraph = aboutus.FirstOrDefault().AboutUsParagraph;
                    aum.AboutUsTitle = aboutus.FirstOrDefault().AboutUsTitle;
                    aum.ImageUrl = aboutus.FirstOrDefault().ImageUrl;
                    return aum;
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
예제 #2
0
        public void UpdateAboutUs(AboutUsModel aum)
        {
            try
            {
                AboutUs au = new AboutUs();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    au = vdc.AboutUs.Single(a => a.AboutUsId == aum.AboutUsId);
                    au.AboutUsId = aum.AboutUsId;
                    au.AboutUsParagraph = aum.AboutUsParagraph;
                    au.AboutUsTitle = aum.AboutUsTitle;

                    vdc.SubmitChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }