private void Store(ExistentTransfer transfer) { var res = new Transfer { Ammount = transfer.Amount, Purse = transfer.SourcePurse.ToString(), Date = transfer.CreateTime }; if (transfer.InvoiceId > 0) { res.InvoiceId = ((int)transfer.InvoiceId); } if (transfer.TransferId > 0) { res.TransferId = ((int)transfer.TransferId); } if (!string.IsNullOrEmpty(transfer.Description)) { res.Description = transfer.Description; } try { _manager.Save(res); } catch (NotUniqueException) { } }
public ActionResult Create(Transfer transfer) { ViewBag.Msg = transferManager.Save(transfer) > 0 ? "Saved Succesfully" : "Save Failed"; if (ViewBag.Msg == "Saved Succesfully") { return(RedirectToAction("Create")); } else { ViewBag.Msg = "Oops something is wrong.....!!!!"; } return(View()); }