예제 #1
0
        //GET: Admin/ShipmentManager/Create
        public ActionResult Create()
        {
            var model = new ShipmentTypesEditViewModel
            {
                Status = 1
            };

            this.StatusList(1);
            this.Pair2List <ShipmentTypesEditViewModel, short, short>(ShipmentListProvider.GetMethodList(), m => m.PricingMethod, null);
            return(View(model));
        }
예제 #2
0
 //GET: Admin/ShipmentManager/Edit
 public ActionResult Edit(int id)
 {
     try
     {
         var model = m_shipmentWorker.GetManagerShipmentTypesEdit(id);
         this.StatusList(model.Status);
         this.Pair2List <ShipmentTypesEditViewModel, short, short>(ShipmentListProvider.GetMethodList(), m => m.PricingMethod, model.PricingMethod.ToString());
         return(View(model));
     }
     catch (Exception ex)
     {
         this.ShowError(ex);
         return(null);
     }
 }
예제 #3
0
 public ActionResult Edit(ShipmentTypesEditViewModel model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             m_shipmentWorker.UpdateManagerShipmentTypesEdit(model);
             return(RedirectToAction("Index"));
         }
         catch (Exception ex)
         {
             ModelState.AddModelError("General", ex.Message);
         }
     }
     this.StatusList(model.Status);
     this.Pair2List <ShipmentTypesEditViewModel, short, short>(ShipmentListProvider.GetMethodList(), m => m.PricingMethod, model.PricingMethod.ToString());
     return(View(model));
 }