Пример #1
0
        public St_Stkjournal AddStockJournal(St_Stkjournal stkJournal)
        {
            _stockControlDBContext.St_Stkjournals.Add(stkJournal);

            _stockControlDBContext.SaveChanges();

            return(stkJournal);
        }
Пример #2
0
        public St_Stkjournal EditStockJournal(St_Stkjournal stkJournal)
        {
            var stockJournalInDb = GetStockJournal(stkJournal.Stk_Coy);

            stockJournalInDb.Stk_Branch  = stkJournal.Stk_Branch;
            stockJournalInDb.Stk_Year    = stkJournal.Stk_Year;
            stockJournalInDb.Stk_Month   = stkJournal.Stk_Month;
            stockJournalInDb.Stk_Loc     = stkJournal.Stk_Loc;
            stockJournalInDb.Stk_Type    = stkJournal.Stk_Type;
            stockJournalInDb.Stk_Account = stkJournal.Stk_Account;
            stockJournalInDb.Stk_Debit   = stkJournal.Stk_Debit;
            stockJournalInDb.Stk_Credit  = stkJournal.Stk_Credit;
            stockJournalInDb.Stk_Rem     = stkJournal.Stk_Rem;
            stockJournalInDb.Stk_Update  = stkJournal.Stk_Update;
            stockJournalInDb.Stk_Period  = stkJournal.Stk_Period;

            return(stockJournalInDb);
        }
Пример #3
0
        public St_Stkjournal EditStockJournal(St_Stkjournal stkJournal)
        {
            var stockJournalInDb = _stockControlDBContext.St_Stkjournals.SingleOrDefault(x => x.Stk_Coy == stkJournal.Stk_Coy);

            if (stockJournalInDb != null)
            {
                stockJournalInDb.Stk_Debit  = stkJournal.Stk_Debit;
                stockJournalInDb.Stk_Credit = stkJournal.Stk_Credit;
                stockJournalInDb.Stk_Rem    = stkJournal.Stk_Rem;
                stockJournalInDb.Stk_Update = stkJournal.Stk_Update;
                stockJournalInDb.Stk_Period = stkJournal.Stk_Period;

                _stockControlDBContext.St_Stkjournals.Update(stockJournalInDb);

                _stockControlDBContext.SaveChanges();
            }

            return(stkJournal);
        }
Пример #4
0
 public void DeleteStockJournal(St_Stkjournal stkJournal)
 {
     stockJournals.Remove(stkJournal);
 }
Пример #5
0
        public St_Stkjournal AddStockJournal(St_Stkjournal stkJournal)
        {
            stockJournals.Add(stkJournal);

            return(stkJournal);
        }
Пример #6
0
        public void DeleteStockJournal(St_Stkjournal stkJournal)
        {
            _stockControlDBContext.St_Stkjournals.Remove(stkJournal);

            _stockControlDBContext.SaveChanges();
        }