Пример #1
0
        public async Task <DataRespond> insertFormFileAsync([FromForm] FormFileRequest formFileRequest)
        {
            DataRespond data = new DataRespond();

            try
            {
                FormFile formFile = m_formFileResponsitory.getFormFileById(formFileRequest.formfileid);
                data.success = true;
                data.message = "update success";
                if (formFileRequest.giaychungnhanboiduong != null)
                {
                    deleteFile(formFile.giaychungnhanboiduong);
                    formFile.giaychungnhanboiduong = await uploadFile(formFileRequest.giaychungnhanboiduong);

                    m_formFileResponsitory.updateFormFile(formFile);
                    return(data);
                }
                if (formFileRequest.bantukiemdiem != null)
                {
                    deleteFile(formFile.bantukiemdiem);
                    formFile.bantukiemdiem = await uploadFile(formFileRequest.bantukiemdiem);

                    m_formFileResponsitory.updateFormFile(formFile);
                    return(data);
                }
                if (formFileRequest.nhanxetnguoihd != null)
                {
                    deleteFile(formFile.nhanxetnguoihd);
                    formFile.nhanxetnguoihd = await uploadFile(formFileRequest.nhanxetnguoihd);

                    m_formFileResponsitory.updateFormFile(formFile);
                    return(data);
                }
                if (formFileRequest.nhanxetchibo != null)
                {
                    deleteFile(formFile.nhanxetchibo);
                    formFile.nhanxetchibo = await uploadFile(formFileRequest.nhanxetchibo);

                    m_formFileResponsitory.updateFormFile(formFile);
                    return(data);
                }
                if (formFileRequest.quydinhketnap != null)
                {
                    deleteFile(formFile.quydinhketnap);
                    formFile.quydinhketnap = await uploadFile(formFileRequest.quydinhketnap);

                    m_formFileResponsitory.updateFormFile(formFile);
                    return(data);
                }
            }
            catch (Exception e)
            {
                data.message = e.Message;
                data.error   = e;
                data.success = false;
            }
            return(data);
        }
Пример #2
0
        public ActionResult FormInformationFromFormFileRequest(FormFileRequest formFileRequest)
        {
            FormInformation fi = InfoPathAnalytics.FormInformationFromFormFileRequest(formFileRequest);

            if (string.Compare(formFileRequest.Format, "xml", true) == 0)
            {
                return(new XmlResult(fi));
            }
            return(new JsonResult()
            {
                Data = fi,
                ContentEncoding = System.Text.Encoding.UTF8,
                ContentType = "application/json"
            });
        }
Пример #3
0
        public ActionResult AllFormPropertiesFromFormFileRequest(FormFileRequest formFileRequest)
        {
            FormPropertyList fpl = InfoPathAnalytics.AllFormPropertiesFromFormFileRequest(formFileRequest);

            if (string.Compare(formFileRequest.Format, "xml", true) == 0)
            {
                return(new XmlResult(fpl));
            }
            return(new JsonResult()
            {
                Data = fpl,
                ContentEncoding = System.Text.Encoding.UTF8,
                ContentType = "application/json"
            });
        }
Пример #4
0
 public ActionResult PreprocessedViewFromFormFileRequest(FormFileRequest viewRequest = null, Dictionary <string, string> parameters = null)
 {
     return(new ObjectResult <PreprocessedViewFile>(InfoPathAnalytics.PreprocessedViewFromFormFileRequest(
                                                        viewRequest,
                                                        parameters)));
 }
Пример #5
0
 public ActionResult ManifestWithPropertiesFromFormFileRequest(FormFileRequest formFileRequest)
 {
     return(new ObjectResult <ManifestFileWithProperties>(InfoPathAnalytics.ManifestWithPropertiesFromFormFileRequest(
                                                              formFileRequest)));
 }