private void Done(object sender, EventArgs e)
        {
            if (IsFieldsEmpty())
            {
                this.ShowMessage(Resource.String.please_fill_all_fields);
                return;
            }

            var userMoneyModel = new MoneyModel()
            {
                Description = edtDescription.Text,
                Amount      = long.Parse(edtAmount.Text),
                Group       = feeGroup.Id,
                Time        = deadLine
            };

            var progressDialog = this.CreateDialog(GetString(Resource.String.adding_fee),
                                                   GetString(Resource.String.wait));

            progressDialog.Show();

            this.DoRequest(MoneysController.Instance.Add(userMoneyModel), () =>
            {
                progressDialog.Dismiss();
                this.ShowMessage(Resource.String.create_fee_success);

                SetResult(Result.Ok);
                Finish();
            });
        }
Exemplo n.º 2
0
        public InsuredEmployment()
        {
            RevenuAnnuelSalarie = new MoneyModel()
            {
                Min = 0, Max = 9999999999, MaxLength = 10, AcceptDecimals = true
            };
            RevenuAnnuelAutonome = new MoneyModel()
            {
                Min = 0, Max = 9999999999, MaxLength = 10, AcceptDecimals = true
            };

            DateFinEmploi          = DateModel.CreateLastFiveYearsDateModel();
            DateFinTravailAutonome = DateModel.CreateLastFiveYearsDateModel();

            AdresseEntreprise = new AddressModel(false);

            PourcentagePhysique = new SliderModel()
            {
                Name      = nameof(PourcentagePhysique),
                StepValue = 1,
                MaxValue  = 100,
                MinValue  = 0,
                Value     = "0"
            };

            PourcentagePhysiqueAutonome = new SliderModel()
            {
                Name      = nameof(PourcentagePhysiqueAutonome),
                StepValue = 1,
                MaxValue  = 100,
                MinValue  = 0,
                Value     = "0"
            };
        }
        public MoneyController(Roulette r)
        {
            _Container = r;

            _moneyView = new MoneyView(this);
            _moneyModel = new MoneyModel();
        }
Exemplo n.º 4
0
        public List <MoneyModel> ParseFileFromLocalStore()
        {
            lock (sync)
            {
                const string tableTag    = "//table";
                const string tableRowTag = ".//tr";
                const string tableColTag = ".//td";
                const string tableId     = "DataGrid1";

                string FileName = Resources.DestinationName;

                List <MoneyModel> courseList = new List <MoneyModel>();

                HtmlDocument doc = new HtmlDocument();

                doc.Load(FileName);

                if (doc != null)
                {
                    // Get all tables in the document
                    HtmlNodeCollection tables    = doc.DocumentNode.SelectNodes(tableTag);
                    HtmlNodeCollection tablerows = null;

                    for (int i = 0; i < tables.Count; ++i)
                    {
                        if (tables[i].Id == tableId)
                        {
                            tablerows = tables[i].SelectNodes(tableRowTag);
                        }
                    }

                    //start from 1 to ignore table headers
                    for (int i = 1; i < tablerows.Count; ++i)
                    {
                        HtmlNodeCollection tablecolumns = tablerows[i].SelectNodes(tableColTag);

                        string ISOID1          = tablecolumns[0].InnerText;
                        string CharacterCode1  = tablecolumns[1].InnerText;
                        string CurrencyCount1  = tablecolumns[2].InnerText;
                        string CurrencyName1   = tablecolumns[3].InnerText;
                        string CurrencyCource1 = tablecolumns[4].InnerText;

                        MoneyModel tmp = new MoneyModel();

                        //UTF8Encoding utf8 = new UTF8Encoding();

                        tmp.ISOID          = Convert.ToInt32(ISOID1);
                        tmp.CharacterCode  = CharacterCode1;
                        tmp.CurrencyCount  = Convert.ToDouble(CurrencyCount1);
                        tmp.CurrencyName   = CurrencyName1;
                        tmp.CurrencyCource = Convert.ToDouble(CurrencyCource1.Replace('.', ','));

                        courseList.Add(tmp);
                    }
                }

                return(courseList);
            }
        }
Exemplo n.º 5
0
        public IActionResult Delete(Guid id)
        {
            var model = new MoneyModel();

            model.DeleteMove(id);

            return(RedirectToAction("Month", "Reports", new { id = model.ReportUrl }));
        }
Exemplo n.º 6
0
        public IActionResult Uncheck(Guid id, PrimalMoveNature nature)
        {
            var model = new MoneyModel();

            var line = model.UncheckMove(id, nature);

            return(PartialView("../Reports/MoveLine", line));
        }
Exemplo n.º 7
0
        public ActionResult MoneyAccount()
        {
            MoneyModel moneyModel = new MoneyModel {
                Money = 100, UserId = int.Parse(User.Identity.Name)
            };

            return(View(moneyModel));
        }
Exemplo n.º 8
0
 public PaymentModel(
     MoneyModel cost,
     DateTime date,
     string method)
 {
     this.Cost   = cost;
     this.Date   = date;
     this.Method = method;
 }
Exemplo n.º 9
0
        public void ExchangeMoney(int id, MoneyModel money, CurrencyModel to)
        {
            _balance.ExchangeMoney(money, to);

            foreach (var currency in _balance.GetCurrencies())
            {
                _balanceDataManager.UpdateMoneyAmount(id, currency.Key.currencyId, currency.Value);
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// 读取工资设定
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        private static MoneyModel OpenSet()
        {
            FileStream      fs = new FileStream(Directory.GetCurrentDirectory() + @"\Config\Model.XML", FileMode.OpenOrCreate, FileAccess.Read);
            BinaryFormatter bf = new BinaryFormatter();
            MoneyModel      mm = (MoneyModel)bf.Deserialize(fs);

            fs.Close();
            return(mm);
        }
Exemplo n.º 11
0
        public IActionResult GetEventsByMoney([FromBody] MoneyModel moneyModel, int km)
        {
            var events = _eventService.GetEventsByMoney(moneyModel.UserId, km, moneyModel.MinMoney, moneyModel.MaxMoney);

            if (events == null)
            {
                return(Ok(0));
            }
            return(Ok(events));
        }
Exemplo n.º 12
0
 public VegasSolitaireMainViewModel(IEventAggregator aggregator,
                                    CommandContainer command,
                                    IGamePackageResolver resolver,
                                    MoneyModel money
                                    )
     : base(aggregator, command, resolver)
 {
     _money1 = money;
     Money   = money.Money;
 }
Exemplo n.º 13
0
 public ActionResult MoneyAccount(MoneyModel moneyModel)
 {
     if (ModelState.IsValid)
     {
         MoneyAccount moneyAccount = new MoneyAccount(unitOfWork);
         moneyAccount.AddMoney(moneyModel.UserId, moneyModel);
         return(RedirectToAction("Index", "Account"));
     }
     return(View());
 }
Exemplo n.º 14
0
        public void AddMoney(int id, MoneyModel moneyModel)
        {
            var user = _unitOfWork.Users.GetItemById(id);

            _unitOfWork.Dispose();
            _unitOfWork = new UnitOfWork();
            user.Money += moneyModel.Money;
            _unitOfWork.Users.UpdateItem(user);
            _unitOfWork.Save();
        }
Exemplo n.º 15
0
 public void AddMoney(MoneyModel money)
 {
     if (currencies.ContainsKey(money.currency))
     {
         currencies[money.currency] = (currencies[money.currency] + money.amount);
     }
     else
     {
         currencies.Add(money.currency, money.amount);
     }
 }
Exemplo n.º 16
0
 public CreateBudgetModel(
     string description,
     MoneyModel limit,
     RecurrenceModel recurrence,
     CategoryModel category)
 {
     this.Description = description;
     this.Limit       = limit;
     this.Recurrence  = recurrence;
     this.Category    = category;
 }
Exemplo n.º 17
0
 public void ChargeMoney(MoneyModel money)
 {
     if (currencies.ContainsKey(money.currency))
     {
         currencies[money.currency] = (currencies[money.currency] - money.amount);
     }
     else
     {
         currencies.Add(money.currency, money.amount * -1);
     }
 }
Exemplo n.º 18
0
        public void ExchangeMoney(MoneyModel moneyFrom, CurrencyModel currencyTo)
        {
            double ratio = Math.Round(moneyFrom.currency.ratio / currencyTo.ratio, 2);

            AddMoney(new MoneyModel {
                currency = currencyTo,
                amount   = (Math.Round(moneyFrom.amount * ratio * 100) / 100)
            });

            ChargeMoney(moneyFrom);
        }
Exemplo n.º 19
0
        public IActionResult Register(UserModel model, string returnUrl)
        {
            if (model.Login == null ||
                model.Password == null ||
                Regex.Matches(model.Login, @"[a-zA-Z0-9]").Count == 0 ||
                Regex.Matches(model.Password, @"[a-zA-Z0-9]").Count == 0
                )
            {
                ModelState.AddModelError("Login", "Invalid login or password");
                return(View(model));
            }

            if (db.Users.FirstOrDefault(u => u.Login == model.Login) != null)
            {
                ModelState.AddModelError("Login", "Login already claimed");
                return(View(model));
            }



            string salt = model.Login;

            UserModel  user  = new UserModel();
            MoneyModel money = new MoneyModel();

            user.Money = money;


            user.Login = model.Login;

            user.Password = getHash(salt + model.Password);
            _logger.LogInformation("Auth controller - Register method. Login: "******" Password hash: " +
                                   user.Password);

            db.Money.Add(money);
            db.SaveChanges();
            user.Id = money.Id;
            _logger.LogInformation(db.SaveChanges().ToString());

            user.GameStats = new GameStatsModel()
            {
                chips_earned = 0, Loses = 0, Wins = 0, Id = money.Id
            };

            db.Users.Add(user);
            db.SaveChanges();
            db.GameStats.Add(user.GameStats);
            db.SaveChanges();


            TempData["login"] = user.Login;
            return(RedirectToAction("SuccessRegister"));
        }
    private void CreateMoneyController()
    {
        MoneyModel = new MoneyModel();
        MoneyController MCont = new MoneyController
        {
            View  = MoneyView,
            Model = MoneyModel
        };

        MCont.Init();
        MoneyModel.Money = 40;
    }
Exemplo n.º 21
0
 public AboutBenefitModel()
 {
     RequestedAmount = new MoneyModel()
     {
         Min            = 1,
         Max            = 100000,
         MaxLength      = 6,
         AcceptDecimals = false
     };
     Diagnosis     = "";
     PhysicianInfo = new PhysicianModel();
 }
Exemplo n.º 22
0
        public MoneyModel MakeChange(float amount)
        {
            MoneyModel moneyObj  = new MoneyModel();
            decimal    amountDec = (decimal)amount;

            moneyObj.SilverDollars = GetDollars(ref amountDec);
            moneyObj.HalfDollars   = GetHalfDollars(ref amountDec);
            moneyObj.Quarters      = GetQuarters(ref amountDec);
            moneyObj.Dimes         = GetDimes(ref amountDec);
            moneyObj.Nickels       = GetNickels(ref amountDec);
            moneyObj.Pennies       = GetPennies(ref amountDec);
            return(moneyObj);
        }
Exemplo n.º 23
0
        public async Task <JsonResult> GetChips()
        {
            UserModel user = await db.Users.FirstOrDefaultAsync(u => u.Login == User.Identity.Name);

            MoneyModel moneyModel = await db.Money.FirstOrDefaultAsync(m => m.Id == user.Id);

            decimal money = moneyModel.Chips;

            _logger.LogDebug(money.ToString());
            return(Json(new
            {
                chips = money
            }));
        }
Exemplo n.º 24
0
        public void SetMoney(int id, MoneyModel money)
        {
            _balance.AddMoney(new MoneyModel
            {
                currency = money.currency,
                amount   = money.amount
            });

            _balanceDataManager.UpdateMoneyAmount(
                id,
                money.currency.currencyId,
                money.amount
                );
        }
Exemplo n.º 25
0
 private BudgetModel(
     string id,
     string description,
     MoneyModel limit,
     RecurrenceModel recurrence,
     CategoryModel category,
     PeriodModel?period)
 {
     this.Id          = id;
     this.Description = description;
     this.Limit       = limit;
     this.Recurrence  = recurrence;
     this.Category    = category;
     this.Period      = period;
 }
Exemplo n.º 26
0
        private void Init()
        {
            var content = Intent.GetStringExtra("MoneyDetail");

            moneyModel = JsonConvert.DeserializeObject <MoneyModel>(content);
            feeGroup   = AppConstantValues.FeeGrooups.Find(x => x.Id.Equals(moneyModel.Group));
            deadLine   = moneyModel.Time;

            tvTitle.Text           = GetString(Resource.String.edit_fee);
            edtDescription.Text    = moneyModel.Description;
            edtAmount.Text         = moneyModel.Amount.ToString();
            edtChooseFeeGroup.Text = GetString(feeGroup.TitleId);
            imgViewChooseFeeGroup.SetImageResource(feeGroup.ImageId);
            edtDeadline.Text = deadLine.ToDateString();
        }
        public List <Currency> GetAllCurrencies()
        {
            List <Currency> listCurrencies = new List <Currency>();

            model = new MoneyModel();
            foreach (MoneyEntities.Money dbCurrency in model.Money.ToList())
            {
                Currency currency = new Currency();
                currency.CurrencyId    = dbCurrency.CurrencyId;
                currency.CurrencyValue = Convert.ToDecimal(dbCurrency.CurrencyValue);
                currency.CurrencyType  = dbCurrency.CurrencyType;
                listCurrencies.Add(currency);
            }

            return(listCurrencies);
        }
Exemplo n.º 28
0
        //[ValidateAntiForgeryToken]
        public ActionResult Create(MoneyModel moneyModel)
        {
            if (ModelState.IsValid)
            {
                var account = new AccountBook();
                account.Id         = Guid.NewGuid();
                account.Categoryyy = Convert.ToInt32(moneyModel.Type);
                account.Amounttt   = Convert.ToInt32(moneyModel.Money);
                account.Remarkkk   = moneyModel.Remark;
                _accountBookService.Add(account);
                _accountBookService.Save();

                return(RedirectToAction("AccountingBook"));
            }
            return(View(moneyModel));
        }
Exemplo n.º 29
0
        public bool TryConvert(MoneyModel o, out IMoney result)
        {
            result = null;

            if (o == null)
            {
                return(false);
            }

            result = new Money
            {
                Amount     = o.Amount,
                CurrencyId = o.CurrencyId
            };

            return(true);
        }
Exemplo n.º 30
0
        public List <MoneyModel> Get()
        {
            var getdata = db.AccountBook.Take(100).ToList();
            List <MoneyModel> MoneyList = new List <MoneyModel>();
            var i = 1;

            foreach (var data in getdata)
            {
                var result = new MoneyModel();
                result.SN     = i++;
                result.type   = data.Categoryyy == 1 ? "支出" : "收入";
                result.date   = data.Dateee;
                result.price  = data.Amounttt.ToString("#,0");
                result.others = data.Remarkkk;

                MoneyList.Add(result);
            }
            return(MoneyList);
        }
Exemplo n.º 31
0
        public IActionResult BlackJack()
        {
            if (!User.Identity.IsAuthenticated)
            {
                ModelState.AddModelError("Login", "Please, login in");
                return(RedirectToAction("Loginin", "Authentication"));
            }


            UserModel  userModel  = db.Users.FirstOrDefault(u => u.Login == User.Identity.Name);
            MoneyModel moneyModel = db.Money.FirstOrDefault(u => u.Id == userModel.Id);

            GameStatsModel gameStatsModel = db.GameStats.FirstOrDefault(u => u.Id == userModel.Id);

            userModel.Money     = moneyModel;
            userModel.GameStats = gameStatsModel;

            return(View(userModel));
        }