Exemplo n.º 1
0
 public virtual void Remove(File file)
 {
     try
     {
         db.Files.DeleteOnSubmit(file);
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Exemplo n.º 2
0
 public virtual void Create(File file)
 {
     try
     {
         this.db.Files.InsertOnSubmit(file);
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Exemplo n.º 3
0
 public virtual void Update(File file)
 {
     try
     {
         File FileOld = this.GetById(file.ID);
         FileOld = file;
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
 partial void DeleteFile(File instance);
 partial void UpdateFile(File instance);
 partial void InsertFile(File instance);
		private void detach_Files(File entity)
		{
			this.SendPropertyChanging();
			entity.Upload = null;
		}
		private void attach_Files(File entity)
		{
			this.SendPropertyChanging();
			entity.Upload = this;
		}
Exemplo n.º 9
0
 public virtual int Delete(File file)
 {
     try
     {
         //File.IsDelete = true;
         db.SubmitChanges();
         return 0;
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }