public ActionResult DownloadDocument(int id)
        {
            IUploadFilesservice fileClient = new IUploadFilesservice();
            IUploadFiles.TEDocument document = new IUploadFiles.TEDocument();
            IUploadFiles.TEDContent content = new IUploadFiles.TEDContent();
            TESignature[] signatures = new TESignature[0];

            fileClient.GetEDoc((string)Session["sessionID"], (string)Session["sessionKey"], id, ref document, ref content, false, ref signatures);
            byte[] file = Convert.FromBase64String(content.Content);
            return File(file, "application/binary", document.FileName);
        }
        public ActionResult UploadStatements(string Content, string Signature, string FileName, string NameDocument, string TypeDocument, int LinkType)
        {
            IUploadFiles.TEDContent edoccont = new IUploadFiles.TEDContent();
            IUploadFiles.TEDocument edoc = new IUploadFiles.TEDocument();

            //edoc.FileName = "Заявление об аккредитации_" + DateTime.Now.ToString("dd.MM.yyyy") + ".rtf";
            //edoc.NameDocument = "Заявление";
            //edoc.TypeDocument = "Заявление";

            //edoc.FileName = "Договор на оказание услуг_" + DateTime.Now.ToString("dd.MM.yyyy") + ".rtf";
            //edoc.NameDocument = "Договор по обеспечению проведения электронных аукционов";
            //edoc.TypeDocument = "Договор по обеспечению проведения электронных аукционов";

            edoc.FileName = FileName;
            edoc.NameDocument = NameDocument;
            edoc.TypeDocument = TypeDocument;
            //edoc.DateSignature = DateTime.Now;
            edoc.IDParent = 0;

            edoccont.Content = Content;
            edoccont.Signature = Signature;

            int idDoc = 0;

            uploadClient.AddEDoc((string)Session["sessionID"], (string)Session["sessionKey"], LinkType, edoc, edoccont, ref idDoc);

            return Json(true);
        }