예제 #1
0
        public void InsertManagerShipmentTypesEdit(ShipmentTypesEditViewModel model)
        {
            var item = Mapper.Map <Shipment_Types>(model);

            m_ConentContext.Shipment_Types.Add(item);
            m_ConentContext.SaveChanges();
        }
예제 #2
0
        public void UpdateManagerShipmentTypesEdit(ShipmentTypesEditViewModel model)
        {
            var query = from s in m_ConentContext.Shipment_Types
                        where s.Id == model.Id
                        select s;
            var item = query.FirstOrDefault();

            Mapper.Map(model, item);
            m_ConentContext.SaveChanges();
        }
예제 #3
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));
        }
예제 #4
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));
 }