コード例 #1
0
        public void CreatePicture(Picture data)
        {
            DatabaseDataContext context = new DatabaseDataContext();

            context.Pictures.InsertOnSubmit(data);
            context.SubmitChanges();
        }
コード例 #2
0
		private void detach_Pictures(Picture entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
コード例 #3
0
		private void attach_Pictures(Picture entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
コード例 #4
0
 partial void DeletePicture(Picture instance);
コード例 #5
0
 partial void UpdatePicture(Picture instance);
コード例 #6
0
 partial void InsertPicture(Picture instance);
コード例 #7
0
        public void UpdatePicture(Picture data)
        {
            DatabaseDataContext context = new DatabaseDataContext();

            Picture picture = context.Pictures.Where(u => u.PictureID == data.PictureID).SingleOrDefault();
            picture.Caption = data.Caption;
            picture.LargeURL = data.LargeURL;
            picture.Latitude = data.Latitude;
            picture.Longitude = data.Longitude;
            picture.MediumURL = data.MediumURL;
            picture.SmallURL = data.SmallURL;
            picture.ViewCount = data.ViewCount;

            context.SubmitChanges();
        }