예제 #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);
        }
예제 #2
0
        public bool CreateAction(InputCountParametrs inputCountParametrs)
        {
            ////TODO
            ////Mapper

            //DataLayer.AccountingContext.CreditCounts.Add(new DataLayer.DataModels.CreditCount()
            //{
            //    AmountOfMoney = inputCountParametrs.AmountOfMoney,
            //    Comment = inputCountParametrs.Comment,
            //    Name = inputCountParametrs.Name,
            //    Valuta = inputCountParametrs.Valuta,
            //    BankName = inputCountParametrs.BankName,
            //    StartDate = Convert.ToDateTime(inputCountParametrs.StartDate).ToString("dd.MM.yyyy")
            //});
            //return true;
            return(false);
        }
예제 #3
0
 public virtual bool CreateAction(InputCountParametrs inputCountParametrs)
 {
     return(selectedCount.CreateAction(inputCountParametrs));
 }