コード例 #1
0
        public void UpdateDocumentById(WareHouseDocument wareHouseDocument)
        {
            WareHouseDocument toUpdate = context.WareHouseDocuments
                                         .Where(x => x.WareHouseDocumentId == wareHouseDocument.WareHouseDocumentId).First();

            toUpdate = wareHouseDocument;
            context.SaveChanges();
        }
コード例 #2
0
 public DocumentPropertiesWindow()
 {
     InitializeComponent();
     this._wareHouseDocument       = new WareHouseDocument();
     this._wareHouseDocument.Items = new List <Item>();
     UpdateButton.Enabled          = false;
     DeleteButton.Enabled          = false;
 }
コード例 #3
0
        public void DeleteDocument(Guid wareHouseDocumentId)
        {
            WareHouseDocument wareHouseDocumentToDelete = context.WareHouseDocuments.Where(x => x.WareHouseDocumentId == wareHouseDocumentId).First();

            DeleteItemsOfDocument(wareHouseDocumentToDelete);
            context.WareHouseDocuments
            .Attach(wareHouseDocumentToDelete);
            context.WareHouseDocuments
            .Remove(wareHouseDocumentToDelete);
            context.SaveChanges();
        }
コード例 #4
0
 public void DeleteItemsOfDocument(WareHouseDocument wareHouseDocument)
 {
     wareHouseDocument.Items.ToList().ForEach(x => context.Items.Attach(x));
     wareHouseDocument.Items.ToList().ForEach(x => context.Items.Remove(x));
     context.SaveChanges();
 }
コード例 #5
0
 public void CreateNewDocument(WareHouseDocument wareHouseDocument)
 {
     context.WareHouseDocuments.Add(wareHouseDocument);
     context.SaveChanges();
 }
コード例 #6
0
 public DocumentPropertiesWindow(WareHouseDocument wareHouseDocument)
 {
     InitializeComponent();
     this._wareHouseDocument = wareHouseDocument;
     CreateButton.Enabled    = false;
 }