Beispiel #1
0
        public virtual ActionResult Create(int?dispatchID)
        {
            Dispatch.typedispatchDisplay();
            TempData["sDispatch"] = from x in PaymentsMethodsExtensions.typedispatchDisplay()
                                    orderby x.Key
                                    select new SelectListItem()
            {
                Text  = x.Value,
                Value = x.Key
            };

            var dispatch = dispatchID.HasValue ? Dispatch.DispatchById(dispatchID.Value) : new DispatchTable {
                Editable = true
            };

            return(View(dispatch));
        }
Beispiel #2
0
        public virtual ActionResult Edit(int?dispatchID)
        {
            try
            {
                TempData["sDispatch"] = from x in PaymentsMethodsExtensions.typedispatchDisplay()
                                        orderby x.Key
                                        select new SelectListItem()
                {
                    Text  = x.Value,
                    Value = x.Key
                };

                DispatchTable dispatch = new DispatchTable();
                dispatch = Dispatch.DispatchById(Convert.ToInt32(dispatchID));
                dispatch.ProductsQuery = DispatchItems.DispatchItemsByDispatchID(Convert.ToInt32(dispatchID));
                DispatchModel model = new DispatchModel(dispatch);
                return(View(model));
            }
            catch (Exception ex)
            {
                var exception = EntityExceptionHelper.GetAndLogNetStepsException(ex, NetSteps.Data.Entities.Constants.NetStepsExceptionType.NetStepsApplicationException);
                throw exception;
            }
        }