Beispiel #1
0
        public virtual ActionResult DeleteRequest(string resvId)
        {
            if (string.IsNullOrEmpty(resvId))
            {
                //RequestId should be passed
                this.Response.StatusCode = 203;
                return(Content("Inappropriate data can't perform delete operation"));
            }
            try
            {
                _service.DeleteCartonRequest(resvId);

                //Request deleted successfully
                //var requests = _service.GetRequests();
                //var model = new IndexViewModel
                //    {
                //        RecentRequests = requests.Select(p => new RequestViewModel(p)).ToList()
                //    };

                //return PartialView(Views._recentRequestListPartial, model);
                throw new NotImplementedException();
            }
            catch (Exception ex)
            {
                // Simulate the behavior of the obsolete HandleAjaxError attribute
                this.Response.StatusCode = 203;
                return(Content(ex.Message));
            }
        }
Beispiel #2
0
        public virtual ActionResult DeleteRequest(string resvId)
        {
            if (string.IsNullOrEmpty(resvId))
            {
                //RequestId should be passed
                this.Response.StatusCode = 203;
                return(Content("Inappropriate data can't perform delete operation"));
            }
            try
            {
                _service.DeleteCartonRequest(resvId);

                //Request deleted successfully
                //  var requests = _service.GetRequests();
                this.AddStatusMessage(string.Format("Request {0} deleted successfully.", resvId));
                return(RedirectToAction(MVC_REQ2.REQ2.Home.Actions.Index()));
            }
            catch (Exception ex)
            {
                // Simulate the behavior of the obsolete HandleAjaxError attribute
                this.Response.StatusCode = 203;
                return(Content(ex.Message));
            }
        }