示例#1
0
        public ActionResult UploadImportFile()
        {
            var model = new UploadImportFileViewModel();
            var view = RenderView("UploadImportFile", model);

            return ComboWireJson(true, view, model, JsonRequestBehavior.AllowGet);
        }
示例#2
0
        public ActionResult UploadImportFile(HttpPostedFileBase uploadFile, UploadImportFileViewModel model)
        {
            WireJson result;
            if (ModelState.IsValid && uploadFile != null)
            {
                model.FileStream = uploadFile.InputStream;

                var response = GetCommand<UploadBlogsImportFileCommand>().ExecuteCommand(model);

                result = new WireJson(response != null, response);
            }
            else
            {
                result = new WireJson(false);
            }

            if (result.Success)
            {
                result.Messages = Messages.Success.ToArray();
            }
            else
            {
                result.Messages = Messages.Error.ToArray();
            }

            return new WrappedJsonResult
                {
                    Data = result
                };
        }
示例#3
0
        public ActionResult UploadImportFile(HttpPostedFileBase uploadFile, UploadImportFileViewModel model)
        {
            if (ModelState.IsValid && uploadFile != null)
            {
                model.FileStream = uploadFile.InputStream;

                var response = GetCommand<UploadBlogsImportFileCommand>().ExecuteCommand(model);

                return WireJson(response != null, response);
            }

            return WireJson(false);
        }