public void UploadCVFile()
        {
            //recaived file, convert word document to ptf, save, and update linkToCV.
            var    httpRequest = HttpContext.Current.Request;
            string folderPeth  = ConfigurationManager.AppSettings["CVpath"];

            if (httpRequest.Files.Count > 0)
            {
                foreach (string file in httpRequest.Files)
                {
                    var postedFile = httpRequest.Files[file];
                    var filePath   = folderPeth + "\\" + postedFile.FileName;
                    postedFile.SaveAs(filePath);
                    //if (Path.GetExtension(filePath) == ".doc" || Path.GetExtension(filePath) == ".docx")
                    //{
                    //    Application appWord = new Application();
                    //    var wordDocument = appWord.Documents.Open(filePath);
                    //    var nfilePath = Path.ChangeExtension(filePath, ".pdf");
                    //    wordDocument.ExportAsFixedFormat(nfilePath, WdExportFormat.wdExportFormatPDF);
                    //    wordDocument.Close();
                    //    File.Delete(filePath);
                    //    filePath = nfilePath;
                    //}
                    if (file != "file")
                    {
                        GraduateDtoManager.GraduateDtoUploudFile(file, Path.GetFileName(filePath));
                    }
                }
            }
        }
        public HttpResponseMessage Get(string idGRD)
        {
            try
            {
                GraduateDtoManager.GraduateDtoEditingtrue(idGRD, true);

                var host = HttpContext.Current.Request.Url.AbsoluteUri;
                host = host.Substring(0, host.IndexOf("/api"));

                string logicalPath = System.Web.HttpContext.Current.Server.MapPath("~/Views/Email/OKActive.cshtml");
                var    response    = new HttpResponseMessage(HttpStatusCode.OK)
                {
                    Content = new StringContent(
                        System.IO.File.ReadAllText(logicalPath)
                        .Replace("000000000", idGRD)
                        .Replace("XXXXXXXX", host)
                        )
                };
                response.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("text/html")
                {
                    CharSet = "UTF8"
                };
                return(response);
            }
            catch (Exception)
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }
        }
 public void Delete(string id)
 {
     GraduateDtoManager.DeleteGraduateDto(id);
 }
 public void Put([FromBody] FullGraduateDto graduateDto)
 {
     GraduateDtoManager.GraduateDtoEditing(graduateDto);
 }
        public FullGraduateDto Post([FromBody] FullGraduateDto graduateDto)
        {
            var userId = Int32.Parse(HttpContext.Current.User.Identity.Name);

            return(GraduateDtoManager.NewGraduateDto(graduateDto, userId));
        }
 public List <FullGraduateDto> Get(int idSubject, int idJob)
 {
     return(GraduateDtoManager.GraduateDtoForJob(idSubject, idJob));
 }
 public FullGraduateDto Get(string id)
 {
     return(GraduateDtoManager.GraduateDtoById(id));
 }
 public List <MainGraduateDto> Get()
 {
     return(GraduateDtoManager.GraduateDtoList());
 }
 public ApiRes <MainGraduateDto> Get(int page, int size, string sort, [FromUri] GraduateFilters filters)
 {
     return(GraduateDtoManager.GraduateDtoLazyList(filters, sort, page, size));
 }