示例#1
0
        public void DeleteGallery(int galleryId)
        {
            try
            {

                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    var remove = (from aremove in vdc.Galleries
                                  where aremove.GalleryId == galleryId
                                  select aremove).FirstOrDefault();

                    if (remove != null)
                    {
                        vdc.Galleries.DeleteOnSubmit(remove);
                        vdc.SubmitChanges();
                    }
                }

            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
示例#2
0
        public void DeleteHeader(int productLabelId)
        {
            try
            {

                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    var remove = (from aremove in vdc.ProductHeaders
                                  where aremove.ProductLabelId == productLabelId
                                  select aremove).FirstOrDefault();

                    if (remove != null)
                    {
                        vdc.ProductHeaders.DeleteOnSubmit(remove);
                        vdc.SubmitChanges();
                    }
                }

            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
示例#3
0
        public void UpdatePromo(PromoModel model)
        {
            try
            {
                Promo table = new Promo();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    table = vdc.Promos.Single(a => a.PromoId == model.PromoId);
                    table.PromoId = model.PromoId;
                    table.PromoTitle = model.PromoTitle;
                    table.PromoDescription = model.PromoDescription;
                    table.ImageString = model.ImageString;
                    vdc.SubmitChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
示例#4
0
        public void InsertPriceList(PriceListModel model)
        {
            try
            {
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    PriceList table = new PriceList();
                    table.ProductCategoryId = model.ProductCategoryId;
                    table.ProductName = model.ProductName;
                    table.ProductDescription = model.ProductDescription;
                    table.Price = model.Price;

                    vdc.PriceLists.InsertOnSubmit(table);
                    vdc.SubmitChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
示例#5
0
        public void InsertProductCategory(ProductCategoryModel pcm)
        {
            try
            {
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    ProductCategory receivedPM = new ProductCategory();
                    receivedPM.ProductCategory1 = pcm.ProductCategory;

                    vdc.ProductCategories.InsertOnSubmit(receivedPM);
                    vdc.SubmitChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
示例#6
0
        public void UpdateAboutUsImage(int aboutUsId, string imageUrl)
        {
            try
            {
                AboutUs au = new AboutUs();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    au = vdc.AboutUs.Single(a => a.AboutUsId == aboutUsId);
                    au.ImageUrl = imageUrl;

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

                throw ex;
            }
        }
示例#7
0
        public void InsertPartner(string imageURL)
        {
            try
            {
                int sequence = 0;

                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    var partner = from p in vdc.Partners.ToList()
                                  orderby p.Sequence descending
                                  select p;
                    if (partner.Count() > 0)
                    {
                        sequence = partner.First().Sequence + 1;
                    }
                    else
                    {
                        sequence = 1;
                    }
                }
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    Partner receivedPM = new Partner();
                    receivedPM.ImageUrl = imageURL;
                    receivedPM.Sequence = sequence;

                    vdc.Partners.InsertOnSubmit(receivedPM);
                    vdc.SubmitChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
        public void UpdateProductList(ProductsListModel aum)
        {
            try
            {
                ProductsList au = new ProductsList();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    au = vdc.ProductsLists.Single(a => a.ProductId == aum.ProductsId);
                    au.ProductId = aum.ProductsId;
                    au.MainDescription = aum.MainDescription;
                    au.DetailsDescription = aum.DetailsDescription;
                    vdc.SubmitChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
示例#9
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;
            }
        }
示例#10
0
        public void UpdateHeader(ProductHeaderModel model)
        {
            try
            {
                ProductHeader table = new ProductHeader();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    table = vdc.ProductHeaders.Single(a => a.ProductLabelId == model.ProductLabelId);
                    table.ProductTableTitleDescription = model.ProductTableTitleDescription;
                    vdc.SubmitChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
示例#11
0
        public void InsertGallery(GalleryModel model)
        {
            try
            {
                int row = 0;
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    var tableList = from p in vdc.Galleries.ToList()
                                    where p.Row == 1
                                    select p;

                    if (tableList.ToList().Count <= 3)
                    {
                        row = 1;
                    }

                    var tableList2 = from p in vdc.Galleries.ToList()
                                     where p.Row == 2
                                     select p;

                    if (tableList2.ToList().Count <= 3 && tableList.ToList().Count == 3)
                    {
                        row = 2;
                    }

                    var tableList3 = from p in vdc.Galleries.ToList()
                                     where p.Row == 3
                                     select p;

                    if (tableList3.ToList().Count <= 3 && tableList.ToList().Count == 3 && tableList2.ToList().Count == 3)
                    {
                        row = 3;
                    }

                    var tableList4 = from p in vdc.Galleries.ToList()
                                     where p.Row == 4
                                     select p;

                    if (tableList4.ToList().Count <= 3 && tableList.ToList().Count == 3 && tableList2.ToList().Count == 3 && tableList3.ToList().Count == 3)
                    {
                        row = 4;
                    }

                    var tableList5 = from p in vdc.Galleries.ToList()
                                     where p.Row == 5
                                     select p;

                    if (tableList5.ToList().Count <= 3 && tableList.ToList().Count == 3 && tableList2.ToList().Count == 3 && tableList3.ToList().Count == 3 && tableList4.ToList().Count == 3)
                    {
                        row = 5;
                    }

                    var tableList6 = from p in vdc.Galleries.ToList()
                                     where p.Row == 6
                                     select p;

                    if (tableList6.ToList().Count <= 3 && tableList.ToList().Count == 3 && tableList2.ToList().Count == 3 && tableList3.ToList().Count == 3 && tableList4.ToList().Count == 3 && tableList5.ToList().Count == 3)
                    {
                        row = 6;
                    }

                    var tableList7 = from p in vdc.Galleries.ToList()
                                     where p.Row == 7
                                     select p;

                    if (tableList6.ToList().Count <= 3 && tableList.ToList().Count == 3 && tableList2.ToList().Count == 3 && tableList3.ToList().Count == 3 && tableList4.ToList().Count == 3 && tableList5.ToList().Count == 3 && tableList6.ToList().Count == 3)
                    {
                        row = 7;
                    }

                    var tableList8 = from p in vdc.Galleries.ToList()
                                     where p.Row == 8
                                     select p;

                    if (tableList8.ToList().Count <= 3 && tableList.ToList().Count == 3 && tableList2.ToList().Count == 3 && tableList3.ToList().Count == 3 && tableList4.ToList().Count == 3 && tableList5.ToList().Count == 3 && tableList6.ToList().Count == 3 && tableList7.ToList().Count == 3)
                    {
                        row = 8;
                    }

                    var tableList9 = from p in vdc.Galleries.ToList()
                                     where p.Row == 9
                                     select p;

                    if (tableList9.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3)
                    {
                        row = 9;
                    }

                    var tableList10 = from p in vdc.Galleries.ToList()
                                     where p.Row == 10
                                     select p;

                    if (tableList10.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3)
                    {
                        row = 10;
                    }

                    var tableList11 = from p in vdc.Galleries.ToList()
                                      where p.Row == 11
                                      select p;

                    if (tableList11.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3)
                    {
                        row = 11;
                    }

                    var tableList12 = from p in vdc.Galleries.ToList()
                                      where p.Row == 12
                                      select p;

                    if (tableList12.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3)
                    {
                        row = 12;
                    }

                    var tableList13 = from p in vdc.Galleries.ToList()
                                      where p.Row == 13
                                      select p;

                    if (tableList13.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3)
                    {
                        row = 13;
                    }

                    var tableList14 = from p in vdc.Galleries.ToList()
                                      where p.Row == 14
                                      select p;

                    if (tableList14.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3)
                    {
                        row = 14;
                    }

                    var tableList15 = from p in vdc.Galleries.ToList()
                                      where p.Row == 15
                                      select p;

                    if (tableList15.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3)
                    {
                        row = 15;
                    }

                    var tableList16 = from p in vdc.Galleries.ToList()
                                      where p.Row == 16
                                      select p;

                    if (tableList16.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3)
                    {
                        row = 16;
                    }

                    var tableList17 = from p in vdc.Galleries.ToList()
                                      where p.Row == 17
                                      select p;

                    if (tableList17.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3
                        && tableList16.ToList().Count == 3)
                    {
                        row = 17;
                    }

                    var tableList18 = from p in vdc.Galleries.ToList()
                                      where p.Row == 18
                                      select p;

                    if (tableList18.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3
                        && tableList16.ToList().Count == 3
                        && tableList17.ToList().Count == 3)
                    {
                        row = 18;
                    }

                    var tableList19 = from p in vdc.Galleries.ToList()
                                      where p.Row == 19
                                      select p;

                    if (tableList19.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3
                        && tableList16.ToList().Count == 3
                        && tableList17.ToList().Count == 3
                        && tableList18.ToList().Count == 3)
                    {
                        row = 19;
                    }

                    var tableList20 = from p in vdc.Galleries.ToList()
                                      where p.Row == 20
                                      select p;

                    if (tableList20.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3
                        && tableList16.ToList().Count == 3
                        && tableList17.ToList().Count == 3
                        && tableList18.ToList().Count == 3
                        && tableList19.ToList().Count == 3)
                    {
                        row = 20;
                    }

                    var tableList21 = from p in vdc.Galleries.ToList()
                                      where p.Row == 21
                                      select p;

                    if (tableList21.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3
                        && tableList16.ToList().Count == 3
                        && tableList17.ToList().Count == 3
                        && tableList18.ToList().Count == 3
                        && tableList19.ToList().Count == 3
                        && tableList20.ToList().Count == 3)
                    {
                        row = 21;
                    }

                    var tableList22 = from p in vdc.Galleries.ToList()
                                      where p.Row == 22
                                      select p;

                    if (tableList22.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3
                        && tableList16.ToList().Count == 3
                        && tableList17.ToList().Count == 3
                        && tableList18.ToList().Count == 3
                        && tableList19.ToList().Count == 3
                        && tableList20.ToList().Count == 3
                        && tableList21.ToList().Count == 3)
                    {
                        row = 22;
                    }

                    var tableList23 = from p in vdc.Galleries.ToList()
                                      where p.Row == 23
                                      select p;

                    if (tableList23.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3
                        && tableList16.ToList().Count == 3
                        && tableList17.ToList().Count == 3
                        && tableList18.ToList().Count == 3
                        && tableList19.ToList().Count == 3
                        && tableList20.ToList().Count == 3
                        && tableList21.ToList().Count == 3
                        && tableList22.ToList().Count == 3)
                    {
                        row = 23;
                    }

                    var tableList24 = from p in vdc.Galleries.ToList()
                                      where p.Row == 24
                                      select p;

                    if (tableList24.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3
                        && tableList16.ToList().Count == 3
                        && tableList17.ToList().Count == 3
                        && tableList18.ToList().Count == 3
                        && tableList19.ToList().Count == 3
                        && tableList20.ToList().Count == 3
                        && tableList21.ToList().Count == 3
                        && tableList22.ToList().Count == 3
                        && tableList23.ToList().Count == 3)
                    {
                        row = 24;
                    }

                    var tableList25 = from p in vdc.Galleries.ToList()
                                      where p.Row == 25
                                      select p;

                    if (tableList25.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3
                        && tableList16.ToList().Count == 3
                        && tableList17.ToList().Count == 3
                        && tableList18.ToList().Count == 3
                        && tableList19.ToList().Count == 3
                        && tableList20.ToList().Count == 3
                        && tableList21.ToList().Count == 3
                        && tableList22.ToList().Count == 3
                        && tableList23.ToList().Count == 3
                        && tableList24.ToList().Count == 3)
                    {
                        row = 25;
                    }

                    var tableList26 = from p in vdc.Galleries.ToList()
                                      where p.Row == 26
                                      select p;

                    if (tableList26.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3
                        && tableList16.ToList().Count == 3
                        && tableList17.ToList().Count == 3
                        && tableList18.ToList().Count == 3
                        && tableList19.ToList().Count == 3
                        && tableList20.ToList().Count == 3
                        && tableList21.ToList().Count == 3
                        && tableList22.ToList().Count == 3
                        && tableList23.ToList().Count == 3
                        && tableList24.ToList().Count == 3
                        && tableList25.ToList().Count == 3)
                    {
                        row = 26;
                    }

                    var tableList27 = from p in vdc.Galleries.ToList()
                                      where p.Row == 27
                                      select p;

                    if (tableList27.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3
                        && tableList16.ToList().Count == 3
                        && tableList17.ToList().Count == 3
                        && tableList18.ToList().Count == 3
                        && tableList19.ToList().Count == 3
                        && tableList20.ToList().Count == 3
                        && tableList21.ToList().Count == 3
                        && tableList22.ToList().Count == 3
                        && tableList23.ToList().Count == 3
                        && tableList24.ToList().Count == 3
                        && tableList25.ToList().Count == 3
                        && tableList26.ToList().Count == 3)
                    {
                        row = 27;
                    }

                    var tableList28 = from p in vdc.Galleries.ToList()
                                      where p.Row == 28
                                      select p;

                    if (tableList28.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3
                        && tableList16.ToList().Count == 3
                        && tableList17.ToList().Count == 3
                        && tableList18.ToList().Count == 3
                        && tableList19.ToList().Count == 3
                        && tableList20.ToList().Count == 3
                        && tableList21.ToList().Count == 3
                        && tableList22.ToList().Count == 3
                        && tableList23.ToList().Count == 3
                        && tableList24.ToList().Count == 3
                        && tableList25.ToList().Count == 3
                        && tableList26.ToList().Count == 3
                        && tableList27.ToList().Count == 3)
                    {
                        row = 28;
                    }

                    var tableList29 = from p in vdc.Galleries.ToList()
                                      where p.Row == 29
                                      select p;

                    if (tableList29.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3
                        && tableList16.ToList().Count == 3
                        && tableList17.ToList().Count == 3
                        && tableList18.ToList().Count == 3
                        && tableList19.ToList().Count == 3
                        && tableList20.ToList().Count == 3
                        && tableList21.ToList().Count == 3
                        && tableList22.ToList().Count == 3
                        && tableList23.ToList().Count == 3
                        && tableList24.ToList().Count == 3
                        && tableList25.ToList().Count == 3
                        && tableList26.ToList().Count == 3
                        && tableList27.ToList().Count == 3
                        && tableList28.ToList().Count == 3)
                    {
                        row = 29;
                    }
                    var tableList30 = from p in vdc.Galleries.ToList()
                                      where p.Row == 30
                                      select p;

                    if (tableList30.ToList().Count <= 3
                        && tableList.ToList().Count == 3
                        && tableList2.ToList().Count == 3
                        && tableList3.ToList().Count == 3
                        && tableList4.ToList().Count == 3
                        && tableList5.ToList().Count == 3
                        && tableList6.ToList().Count == 3
                        && tableList7.ToList().Count == 3
                        && tableList8.ToList().Count == 3
                        && tableList9.ToList().Count == 3
                        && tableList10.ToList().Count == 3
                        && tableList11.ToList().Count == 3
                        && tableList12.ToList().Count == 3
                        && tableList13.ToList().Count == 3
                        && tableList14.ToList().Count == 3
                        && tableList15.ToList().Count == 3
                        && tableList16.ToList().Count == 3
                        && tableList17.ToList().Count == 3
                        && tableList18.ToList().Count == 3
                        && tableList19.ToList().Count == 3
                        && tableList20.ToList().Count == 3
                        && tableList21.ToList().Count == 3
                        && tableList22.ToList().Count == 3
                        && tableList23.ToList().Count == 3
                        && tableList24.ToList().Count == 3
                        && tableList25.ToList().Count == 3
                        && tableList26.ToList().Count == 3
                        && tableList27.ToList().Count == 3
                        && tableList28.ToList().Count == 3
                        && tableList29.ToList().Count == 3)
                    {
                        row = 30;
                    }
                }

                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    Gallery table = new Gallery();
                    table.GalleryTitle = model.GalleryTitle;
                    table.GalleryDescription = model.GalleryDescription;
                    table.ImageString = model.ImageString;
                    table.Row = row;

                    vdc.Galleries.InsertOnSubmit(table);
                    vdc.SubmitChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
示例#12
0
        public void UpdateContactAdditional(int id, string title, string description)
        {
            try
            {
                ContactAdditional table = new ContactAdditional();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    table = vdc.ContactAdditionals.Single(a => a.ContactAdditionalId == id);
                    table.ContactDescription = description;
                    table.ContactTitle = title;

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

                throw ex;
            }
        }
示例#13
0
        public void UpdateContactNumbers(int contactNumberId, string contactNumber)
        {
            try
            {
                ContactNumber table = new ContactNumber();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    table = vdc.ContactNumbers.Single(a => a.ContactNumberId == contactNumberId);
                    table.ContactNumber1 = contactNumber;

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

                throw ex;
            }
        }
示例#14
0
        public void UpdateCompanyName(int contactId, string companyName)
        {
            try
            {
                Contact table = new Contact();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    table = vdc.Contacts.Single(a => a.ContactId == contactId);
                    table.CompanyName = companyName;

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

                throw ex;
            }
        }
示例#15
0
        public void UpdateGallery(GalleryModel model)
        {
            try
            {
                Gallery table = new Gallery();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    table = vdc.Galleries.Single(a => a.GalleryId == model.GalleryId);
                    table.GalleryId = model.GalleryId;
                    table.GalleryTitle = model.GalleryTitle;
                    table.GalleryDescription = model.GalleryDescription;
                    table.ImageString = model.ImageString;
                    vdc.SubmitChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
示例#16
0
        public void UpdateProductsMain(ProductsMainModel aum)
        {
            try
            {
                ProductsMain au = new ProductsMain();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    au = vdc.ProductsMains.Single(a => a.ProductsMainId == aum.ProductsMainId);
                    au.ProductsMainId = aum.ProductsMainId;
                    au.ProductMainParagraph = aum.ProductMainParagraph;
                    au.ProductSubParagraph = aum.ProductSubParagraph;
                    au.ProductMainParagraphTitle = aum.ProductMainParagraphTitle;
                    au.ProductSubParagraphTitle = aum.ProductSubParagraphTitle;
                    vdc.SubmitChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
示例#17
0
        public void InsertProductHeader(ProductHeaderModel model)
        {
            try
            {
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    ProductHeader table = new ProductHeader();
                    table.ProductTableTitleDescription = model.ProductTableTitleDescription;
                    table.ProductCategoryId = model.ProductCategoryId;

                    vdc.ProductHeaders.InsertOnSubmit(table);
                    vdc.SubmitChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
示例#18
0
        public void UpdateProductCategory(ProductCategoryModel pcm)
        {
            try
            {
                ProductCategory table = new ProductCategory();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    table = vdc.ProductCategories.Single(a => a.ProductCategoryId == pcm.ProductCategoryId);
                    table.ProductCategoryId = pcm.ProductCategoryId;
                    table.ProductCategory1 = pcm.ProductCategory;
                    vdc.SubmitChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
示例#19
0
        public void UpdateEmailAddress(int emailAddressId, string emailAddress)
        {
            try
            {
                EmailAddress table = new EmailAddress();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    table = vdc.EmailAddresses.Single(a => a.EmailAddressId == emailAddressId);
                    table.EmailAddress1 = emailAddress;

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

                throw ex;
            }
        }
示例#20
0
        public void UpdateProductsMainImage(int id, string imageUrl)
        {
            try
            {
                ProductsMain au = new ProductsMain();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    au = vdc.ProductsMains.Single(a => a.ProductsMainId == id);
                    au.ImageURLString = imageUrl;

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

                throw ex;
            }
        }
示例#21
0
        public void UpdatePriceList(PriceListModel model)
        {
            try
            {
                PriceList table = new PriceList();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    table = vdc.PriceLists.Single(a => a.PriceListId == model.PriceListId);
                    table.ProductDescription = model.ProductDescription;
                    table.ProductName = model.ProductName;
                    table.Price = model.Price;
                    vdc.SubmitChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
示例#22
0
        public void UpdateShoppingHours(int id, string description)
        {
            try
            {
                ShoppingHour table = new ShoppingHour();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    table = vdc.ShoppingHours.Single(a => a.ShoppingHoursId == id);
                    table.ShoppingHours = description;

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

                throw ex;
            }
        }
示例#23
0
        public void UpdateSocialMedia(int id, string description)
        {
            try
            {
                SocialMedia table = new SocialMedia();
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    table = vdc.SocialMedias.Single(a => a.SocialMediaId == id);
                    table.SocialMediaUrl = description;

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

                throw ex;
            }
        }
示例#24
0
        public void InsertProductList(ProductsListModel plm)
        {
            try
            {
                using (VenturadaDataContext vdc = new VenturadaDataContext())
                {
                    ProductsList receivedPM = new ProductsList();
                    receivedPM.MainDescription = plm.MainDescription;
                    receivedPM.DetailsDescription = plm.DetailsDescription;

                    vdc.ProductsLists.InsertOnSubmit(receivedPM);
                    vdc.SubmitChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }