public bool vProductAndDescriptionDelete(vProductAndDescription vproductanddescription)
        {
            return Execute<bool>(dal =>
            {
                vProductAndDescription vproductanddescriptionDelete = dal.vProductAndDescription.Where(x => x.ProductID == vproductanddescription.ProductID).FirstOrDefault();
                if (vproductanddescriptionDelete != null)
                {
                    dal.vProductAndDescription.DeleteOnSubmit(vproductanddescriptionDelete);
                    dal.SubmitChanges();
                    return true;
                }
                return false;

            });
        }
        public bool vProductAndDescriptionUpdate(vProductAndDescription vproductanddescription)
        {
            return Execute<bool>(dal =>
               {
               vProductAndDescription vproductanddescriptionUpdate = dal.vProductAndDescription.Where(x => x.ProductID == vproductanddescription.ProductID).FirstOrDefault();
               if (vproductanddescriptionUpdate != null)
               {
                   vproductanddescriptionUpdate.ProductID = vproductanddescription.ProductID;
                   vproductanddescriptionUpdate.Name = vproductanddescription.Name;
                   vproductanddescriptionUpdate.ProductModel = vproductanddescription.ProductModel;
                   vproductanddescriptionUpdate.CultureID = vproductanddescription.CultureID;
                   vproductanddescriptionUpdate.Description = vproductanddescription.Description;
                   vproductanddescriptionUpdate.ThumbNailPhoto = vproductanddescription.ThumbNailPhoto;
                   vproductanddescriptionUpdate.ThumbnailPhotoFileName = vproductanddescription.ThumbnailPhotoFileName;
                   vproductanddescriptionUpdate.LargePhoto = vproductanddescription.LargePhoto;
                   vproductanddescriptionUpdate.LargePhotoFileName = vproductanddescription.LargePhotoFileName;

                   dal.SubmitChanges();
                   return true;
               }
               return false;

               });
        }
 partial void DeletevProductAndDescription(vProductAndDescription instance);
 partial void InsertvProductAndDescription(vProductAndDescription instance);
Ejemplo n.º 5
0
 public void vProductAndDescriptionUpdate(vProductAndDescription vproductanddescription)
 {
     adventureWorks_BC.vProductAndDescriptionUpdate(vproductanddescription);
 }