Ejemplo n.º 1
0
        public bool CreateAction(InputCountParametrs inputCountParametrs)
        {
            ////TODO
            ////Mapper
            bool result = true;

            using (CashCountRepository repository = new CashCountRepository())
            {
                DataLayer.DataModels.CashCount count = new DataLayer.DataModels.CashCount()
                {
                    Name          = inputCountParametrs.Name,
                    AmountOfMoney = inputCountParametrs.AmountOfMoney,
                    Comment       = inputCountParametrs.Comment,
                    Valuta        = inputCountParametrs.Valuta,
                    UserId        = MyUser.UserId,
                    PeriodChanges = false
                };
                try
                {
                    repository.Create(count);
                    repository.Save();
                }
                catch
                {
                    result = false;
                }
            }

            return(result);
        }
        public bool UpdatePeriodChanges(int id)
        {
            bool result;

            using (CashCountRepository repository = new CashCountRepository())
            {
                result = repository.UpdatePeriodChanges(id);
                repository.Save();
            }
            return(result);
        }