コード例 #1
0
ファイル: TransactionsLogic.cs プロジェクト: No0zZy/Cursed
        /// <summary>
        /// Update transaction.
        /// </summary>
        /// <param name="model">Updated transaction information</param>
        public async Task UpdateDataModelAsync(TransactionBatch model)
        {
            var currentModel = await db.TransactionBatch.FirstOrDefaultAsync(i => i.Id == model.Id);

            db.Entry(currentModel).CurrentValues.SetValues(model);
            await db.SaveChangesAsync();
        }
コード例 #2
0
        /// <summary>
        /// Update facility.
        /// </summary>
        /// <param name="model">Updated facility information</param>
        public async Task UpdateDataModelAsync(Facility model)
        {
            var currentModel = await db.Facility.FirstOrDefaultAsync(i => i.Id == model.Id);

            db.Entry(currentModel).CurrentValues.SetValues(model);
            await db.SaveChangesAsync();
        }
コード例 #3
0
        /// <summary>
        /// Update product recipe relation.
        /// </summary>
        /// <param name="model">Updated product recipe relation information</param>
        public async Task UpdateDataModelAsync(RecipeProductChanges model)
        {
            var currentModel = await db.RecipeProductChanges.FirstOrDefaultAsync(i => i.RecipeId == model.RecipeId && i.ProductId == model.ProductId);

            db.Entry(currentModel).CurrentValues.SetValues(model);
            await db.SaveChangesAsync();
        }
コード例 #4
0
        /// <summary>
        /// Update tech process.
        /// </summary>
        /// <param name="model">Updated company information</param>
        public async Task UpdateDataModelAsync(TechProcess model)
        {
            var currentModel = await db.TechProcess.FirstOrDefaultAsync(i => i.RecipeId == model.RecipeId && i.FacilityId == model.FacilityId);

            db.Entry(currentModel).CurrentValues.SetValues(model);
            await db.SaveChangesAsync();
        }