Exemplo n.º 1
0
        public ActionResult TransferringMoney(PutMoneyModel model)
        {
            var user       = userService.GetUsersByEmail(model.Email);
            var billOfUser = billService.GetBillOnUser(user, model.IBankOnBillToSetMoney);

            var putMoneyToBillModel = new PutMoneyInBillModel()
            {
                Money = model.Money,
                IBankOnBillFromGetMoney = model.IBankOnBillFromGetMoney,
                billToSetMoney          = billOfUser
            };

            var statusPutBill = billService.TransferringFormBillToBill(putMoneyToBillModel, user);

            switch (statusPutBill)
            {
            case "no exist one of bills":
                model.ExistBills = true;
                return(View(model));

            default:

                var billFromGetMoney = billService.GetBillOnUser(user, model.IBankOnBillFromGetMoney);

                return(RedirectToAction("Index", "Home"));
            }
        }
Exemplo n.º 2
0
        public ActionResult PutMoney(PutMoneyModel model)
        {
            var user       = userService.GetUsersByEmail(model.Email);
            var billOfUser = billService.GetBillOnUser(user, model.IBankOnBillToSetMoney);

            var putMoneyToBillModel = new PutMoneyInBillModel()
            {
                Money = model.Money,
                IBankOnBillFromGetMoney = model.IBankOnBillFromGetMoney,
                billToSetMoney          = billOfUser
            };

            var statusPutBill = billService.PutMoneyInYourBill(putMoneyToBillModel);

            switch (statusPutBill)
            {
            case "no exist bill":
                model.ExistBills = true;
                return(View(model));

            case "no exist really bill":
                model.ExistBills = true;
                return(View(model));

            default:
                //statusBillService.SetStatusBill(billOfUser, "Put money", statusPutBill);
                return(RedirectToAction("Index", "Home"));
            }
        }
Exemplo n.º 3
0
        public ActionResult TransferringMoney()
        {
            var model = new PutMoneyModel()
            {
                Email      = "",
                ExistBills = false,
                IBankOnBillFromGetMoney = "",
                IBankOnBillToSetMoney   = "",
                Money = "",
            };

            return(View(model));
        }