public ActionResult Add(Core.Domain.Customer model)
        {
            string ErrorMsg = "";

            _CustomerService = new CustomerService();

            int ID = _CustomerService.Insert(model, ref ErrorMsg);

            if (ErrorMsg != "")
            {
                if (TempData["ErrorMsg"] == null)
                {
                    TempData["ErrorMsg"] = ErrorMsg;
                }
            }
            else if (ID > 0)
            {
                if (TempData["ErrorMsg"] == null)
                {
                    TempData["ErrorMsg"] = model.CustomerName + "  Added Successfully";
                }
            }
            return(RedirectToAction("List"));
            //  }
        }
Exemple #2
0
 public static CustomerDAO FromDomain(Core.Domain.Customer customer)
 {
     return(new CustomerDAO
     {
         Id = customer.Id,
         Fullname = customer.Fullname,
     });
 }
 public MainViewModel()
 {
     Owner        = new Customer("isaac");
     Transactions = new ObservableCollection <Transaction>();
     this.LoadTransactions();
     UpdateAccount(Core.Api.LoadAccount(Owner));
     DepositCommand = new Command <int>(
         amount =>
     {
         UpdateAccount(Core.Api.Deposit(amount, Owner));
         WithdrawCommand.Refresh();
     }, TryParseInt);
     WithdrawCommand = new Command <int>(
         amount => UpdateAccount(Core.Api.Withdraw(amount, Owner)),
         TryParseInt,
         () => account.IsInCredit);
 }