//GET: Admin/PaymentManager/Create public ActionResult Create() { this.StatusList(1); this.Pair2List <PaymentTypesEditViewModel, short, short>(PaymentListProvider.GetMethods(), m => m.Method, null); this.Pair2List <PaymentTypesEditViewModel, string, string>(m_posWorker.GetPosForList(), m => m.PosType, ""); var model = new PaymentTypesEditViewModel { Status = 1 }; return(View(model)); }
//GET: Admin/PaymentManager/Edit public ActionResult Edit(int id) { try { var model = m_paymentWorker.GetManagerPaymentTypesEdit(id); this.StatusList(model.Status); this.Pair2List <PaymentTypesEditViewModel, short, short>(PaymentListProvider.GetMethods(), m => m.Method, model.Method.ToString()); this.Pair2List <PaymentTypesEditViewModel, string, string>(m_posWorker.GetPosForList(), m => m.PosType, model.PosType); return(View(model)); } catch (Exception ex) { this.ShowError(ex); return(null); } }
public ActionResult Create(PaymentTypesEditViewModel model) { if (ModelState.IsValid) { try { m_paymentWorker.InsertManagerPaymentTypesEdit(model); return(RedirectToAction("Index")); } catch (Exception ex) { ModelState.AddModelError("General", ex.Message); } } this.StatusList(model.Status); this.Pair2List <PaymentTypesEditViewModel, short, short>(PaymentListProvider.GetMethods(), m => m.Method, model.Method.ToString()); return(View(model)); }