public int SaveResume(Resumes resume) { try { // add/update indent var count = this.Resumes.Count(a => a.CandidateID.Equals(resume.CandidateID)); if (count == 0) { Resumes.Add(resume); } else { Resumes u = this.Resumes.Where(s => s.CandidateID == resume.CandidateID).FirstOrDefault <Resumes>(); // change contact in disconnected mode (out of DBContext scope) if (u != null) { u.CandidateID = resume.CandidateID; u.CandidatePhoto = resume.CandidatePhoto; u.FileType = resume.FileType; u.ResumePath = resume.ResumePath; } this.Entry(u).State = EntityState.Modified; } this.SaveChanges(); return(resume.CandidateID); } catch { throw; } }
//SOBE private void AnimateIn() { Resumes.TranslateTo(0, 0, 600, Easing.Linear); optionsMenu.TranslateTo(0, 0, 600, Easing.Linear); accountPage.FadeTo(.01, 900, Easing.SinInOut); arrow_menu.RotateXTo(0); }
protected void btnSubmit_Click(object sender, EventArgs e) { string new_filename = string.Empty; if (fuImage.PostedFile.ContentLength != 0) { string original_filename = Path.GetFileName(fuImage.PostedFile.FileName); new_filename = Guid.NewGuid().ToString() + Path.GetExtension(original_filename); string new_filepath = Server.MapPath("~/Uploads/Resume/" + new_filename); fuImage.PostedFile.SaveAs(new_filepath); ViewState["GImage"] = new_filename; } using (VaranegarEntities db = new VaranegarEntities()) { Resumes re = new Resumes(); re.resumeid = Guid.NewGuid(); re.IsDelete = false; re.resumeFile = new_filename; re.SubmitDate = DateTime.Now; re.submitIP = Request.UserHostAddress; db.Resumes.Add(re); db.SaveChanges(); pnlsuccess.Visible = true; } }
public string DoPrintStuLicence() { BP.Pub.RTFEngine en = new Pub.RTFEngine(); Student stu = new Student(this.No); en.HisGEEntity = stu; //当前的实体. //增加从表. BP.Demo.Resumes dtls = new Resumes(); dtls.Retrieve(ResumeAttr.RefPK, stu.No); en.AddDtlEns(dtls); string saveTo = BP.Sys.SystemConfig.PathOfTemp; // \\DataUser\\Temp\\ string billFileName = this.No + "StuTest.doc"; //要生成的数据. en.MakeDoc(BP.Sys.SystemConfig.PathOfDataUser + "\\CyclostyleFile\\StudentDemo.rtf", saveTo, billFileName, null, false); string url = "/DataUser/Temp/" + billFileName; string info = "单据生成成功:<a href='" + url + "' >打印</a>,<a href='/SDKFlowDemo/App/PrintJoin.aspx'>拼接打印</a>"; return(info); }
public async Task AddResume(Resume resume) { if (!(await Resumes.AnyAsync(x => x.Id == resume.Id))) { await this.Resumes.AddAsync(resume); await this.SaveChangesAsync(); } }
public async Task <HttpResponseMessage> LoginAccount([FromBody] Credent credential) { Resumes resumes = new Resumes(); string id = await resumes.checkIndent(credential.Account, credential.Password); if (id == null) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } return(Request.CreateResponse(HttpStatusCode.Found, id)); }
public async Task <HttpResponseMessage> DeleteResume(string id) { Resumes resumes = new Resumes(); if (await resumes.deleteResumeById(id)) { return(Request.CreateResponse(HttpStatusCode.OK)); } else { return(Request.CreateResponse(HttpStatusCode.NotFound)); } }
public void SaveResumeInResumes(Resume.Resume cv) { var temp = FindResume(cv.Name); if (temp != null) { Resumes.Remove(temp); Resumes.Insert(0, cv); } else { Resumes.Insert(0, cv); } }
public async Task <HttpResponseMessage> GetComments(string Id) { Resumes resumes = new Resumes(); IList <Comment> comments = await resumes.getCommentById(Id); if (comments == null) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } else { return(Request.CreateResponse(HttpStatusCode.Found, comments)); } }
public async Task <HttpResponseMessage> GetResume(string id) { Resumes resumes = new Resumes(); Resume resume = await resumes.getResumeById(id); if (resume == null) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } else { return(Request.CreateResponse(HttpStatusCode.Found, resume)); } }
public async Task <HttpResponseMessage> GetAll() { Resumes resumes = new Resumes(); IList <BsonDocument> documents = await resumes.getAll(); if (documents.Count == 0) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } else { return(Request.CreateResponse(HttpStatusCode.Found, documents)); } }
public async Task <HttpResponseMessage> GetAll() { Resumes resumes = new Resumes(); IList <Account> accounts = await resumes.getAllAccounts(); if (accounts != null) { return(Request.CreateResponse(HttpStatusCode.Found, accounts)); } else { return(Request.CreateResponse(HttpStatusCode.NotFound)); } }
public async Task <HttpResponseMessage> CreateComment([FromBody] Comment comment) { if (comment == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } Resumes resumes = new Resumes(); if (await resumes.createComment(comment)) { return(Request.CreateResponse(HttpStatusCode.OK)); } else { return(Request.CreateResponse(HttpStatusCode.NotFound)); } }
public HttpResponseMessage RecordInserts(string instanceUrl, string token, Resumes parsedResumes) { string restQuery = instanceUrl + @"/services/apexrest/Sovren/"; using (var client = new HttpClient()) { client.BaseAddress = new Uri(restQuery); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); HttpContent content = new StringContent(JsonConvert.SerializeObject(parsedResumes), Encoding.UTF8, "application/json"); HttpResponseMessage response = client.PostAsync(restQuery, content).Result; return(response); } }
public IActionResult UpdateResume(Resumes r) { var deger = " "; if (c.Resumes.Where(e => e.Sid == r.Sid && r.Mid == 0).SingleOrDefault() != null) { Resumes x = c.Resumes.Where(e => e.Sid == r.Sid).FirstOrDefault(); Student s = c.Students.Where(k => k.Id == r.Sid).FirstOrDefault(); deger = s.Email; x.PhoneNumber = r.PhoneNumber; x.Address = r.Address; x.Experience = r.Experience; x.Dob = r.Dob; x.ForeignLanguages = r.ForeignLanguages; x.HighSchool = r.HighSchool; x.Hobbies = r.Hobbies; x.Skills = r.Skills; x.University = r.University; c.Resumes.Update(x); c.SaveChanges(); } else if (c.Resumes.Where(e => e.Mid == r.Mid && r.Sid == 0).SingleOrDefault() != null) { Resumes y = c.Resumes.Where(e => e.Sid == r.Sid).FirstOrDefault(); Mentor m = c.Mentors.Where(k => k.Id == r.Mid).FirstOrDefault(); deger = m.Email; y.PhoneNumber = r.PhoneNumber; y.Address = r.Address; y.Experience = r.Experience; y.Dob = r.Dob; y.ForeignLanguages = r.ForeignLanguages; y.HighSchool = r.HighSchool; y.Hobbies = r.Hobbies; y.Skills = r.Skills; y.University = r.University; c.Resumes.Update(y); c.SaveChanges(); } return(RedirectToAction("Main", new RouteValueDictionary( new { controller = "Home", action = "Main", user = deger }))); }
//<----defines the authenticate logic----> public async Task AuthenticateAsync(HttpAuthenticationContext context, CancellationToken cancellationToken) { HttpRequestMessage request = context.Request; AuthenticationHeaderValue authentication = request.Headers.Authorization; if (request.Headers.Authorization != null && request.Headers.Authorization.Scheme.Equals("basic", StringComparison.OrdinalIgnoreCase)) { string enUsernameAndPassword = authentication.Parameter; if (enUsernameAndPassword != null) { try { // Convert 64-base encoding credential to binary Encoding encoding = Encoding.GetEncoding("ISO-8859-1"); string UsernameAndPassword; UsernameAndPassword = encoding.GetString(Convert.FromBase64String(enUsernameAndPassword)); int seperator = UsernameAndPassword.IndexOf(':'); string username = UsernameAndPassword.Substring(0, seperator); string password = UsernameAndPassword.Substring(seperator + 1); Resumes resumes = new Resumes(); // if username is Tom, password is 123, authenticate. Otherwise, unauthenticate. if (await resumes.checkIndent(username, password) != null) { var claims = new List <Claim>() { new Claim(ClaimTypes.Name, username) }; var id = new ClaimsIdentity(claims, "Basic"); var principal = new ClaimsPrincipal(new[] { id }); context.Principal = principal; } } catch (FormatException) { HttpContext.Current.Response.StatusCode = 401; } } } else { context.ErrorResult = new UnauthorizedResult(new AuthenticationHeaderValue[0], context.Request); } }
public List <Resumes> GetFiles(string filePath) { var directory = new DirectoryInfo(filePath); var files = directory.GetFiles(); if (files.Any()) { var resumes = new List <Resumes>(); foreach (var file in files) { var resume = new Resumes(); resume.FilePath = file.FullName; resume.FileName = file.Name; resumes.Add(resume); } return(resumes); } return(null); }
public bool UpdateResumePath(int candId, string path, string fileType) { try { Resumes res = this.Resumes.Where(a => a.CandidateID.Equals(candId)).FirstOrDefault <Resumes>(); // change contact in disconnected mode (out of DBContext scope) if (res != null) { res.ResumePath = path; res.FileType = fileType; } this.Entry(res).State = EntityState.Modified; this.SaveChanges(); return(true); } catch { throw; } }
public async Task <HttpResponseMessage> CreateAccount([FromBody] Person person) { if (person == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } BsonDocument document = new BsonDocument(); Resumes resumes = new Resumes(); if (await resumes.accountExist(person.Account)) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } document["Account"] = person.Account; document["Name"] = person.Name; document["Email"] = person.Email; document["Password"] = person.Password; ObjectId Id = await resumes.Insert(document); return(Request.CreateResponse(HttpStatusCode.Created, Id)); }
public async Task <HttpResponseMessage> CreateResume([FromBody] Resume resume) { if (resume == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } Resumes resumes = new Resumes(); int last = resume.Id.Length - 1; string tmp = resume.Id.Remove(last); resume.Id = tmp.Remove(0, 1); string id = resume.Id; if (await resumes.createResume(resume)) { return(Request.CreateResponse(HttpStatusCode.OK)); } else { return(Request.CreateResponse(HttpStatusCode.NotFound)); } }
public HttpResponseMessage Get(int id) { try { if (id > 0) { Resumes resume = this._repo.GetResume(id); string resumeFileName = resume.ResumePath; string resumeFile = ""; string resumeVirtualPath = ""; if (!string.IsNullOrWhiteSpace(resumeFileName)) { resumeFile = new FileInfo(resumeFileName).Name; resumeVirtualPath = "/" + resumeFileName.Replace(HttpContext.Current.Request.PhysicalApplicationPath, String.Empty).Replace("\\", "/"); } HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, new { ResumeFileName = resumeFile, ResumeVirtualPath = resumeVirtualPath }); return(response); } else { return(Request.CreateErrorResponse(HttpStatusCode.NoContent, new Exception("No input found to get data"))); } } catch (Exception ex) { _tracer.Error(Request, this.ControllerContext.ControllerDescriptor.ControllerType.FullName, ex.StackTrace); return(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new StringContent(ex.Message) }); } }
/// <summary> /// 添加数据信息 /// </summary> /// <param name="res"></param> /// <returns></returns> public int AddResumes(Resumes res) { string str = "insert into Resumes values (@R_Name,@R_Age,@R_Phone,@R_Address,@R_Email,@R_Experience,@R_Picture,@R_Occupation,@R_Salary,@R_School,@R_Studyingtime,@R_Major,@R_Degree,@R_WorkExperience,@R_Selfevaluation)"; return(DapperHelper <Resumes> .Execute(str, new { R_Name = res.R_Name, R_Age = res.R_Age, R_Phone = res.R_Phone, R_Address = res.R_Address, R_Email = res.R_Email, R_Experience = res.R_Experience, R_Picture = res.R_Picture, R_Occupation = res.R_Occupation, R_Salary = res.R_Salary, R_School = res.R_School, R_Studyingtime = res.R_Studyingtime, R_Major = res.R_Major, R_Degree = res.R_Degree, R_WorkExperience = res.R_WorkExperience, R_Selfevaluation = res.R_Selfevaluation })); }
public async void RemoveResume(Resume.Resume cv) { var temp = FindResume(cv.Name); if (temp != null) //si c'est un cv et pas un template { var storagelist = await FileManagement.GetResumeFoldersList(); foreach (var stlist in storagelist) { var files = await stlist.GetFilesAsync(); foreach (var file in files) { if (file.Name == cv.Name) { await file.DeleteAsync(); } } } Resumes.Remove(cv); } }
private async void Open_Import(object sender, RoutedEventArgs e) { FileOpenPicker openPicker = new FileOpenPicker() { ViewMode = PickerViewMode.Thumbnail, SuggestedStartLocation = PickerLocationId.DocumentsLibrary }; openPicker.FileTypeFilter.Add(".cv"); var ImportCV = await openPicker.PickSingleFileAsync(); if (ImportCV != null) { StorageFolder folder = await FileManagement.GetLocalResumeFolder(); await ImportCV.CopyAsync(folder, ImportCV.Name, NameCollisionOption.ReplaceExisting); var cv = await FileManagement.Read_file(Path.GetFileNameWithoutExtension(ImportCV.Name), folder); bool exist = false; foreach (Resume.Resume r in Resumes) { if (r.Name == cv.Name) { Resumes.Remove(r); Resumes.Insert(0, cv); exist = true; break; } } if (!exist) { Resumes.Add(cv); } } Window.Current.Content = new StartPage(); }
public void AddResumes(IList <IFormFile> R_Picture, Resumes resum) { long size = 0; var filename = ""; foreach (var file in R_Picture) { filename = ContentDispositionHeaderValue .Parse(file.ContentDisposition) .FileName .Trim('"'); //这个hostingEnv.WebRootPath就是要存的地址可以改下 filename = hostingEnv.WebRootPath + $@"\images\{filename}"; size += file.Length; using (FileStream fs = System.IO.File.Create(filename)) { file.CopyTo(fs); fs.Flush(); } } //添加信息 if (resum != null) { resum.R_Picture = R_Picture[0].FileName; string json = JsonConvert.SerializeObject(resum); string ss = Sender("post", "/api/Resumes", json); if (int.Parse(ss) > 0) { Response.Redirect("/Resumes/ShowResumes?name=" + resum.R_Name); } else { Response.WriteAsync("<script>alert('添加失败')</script>"); } } }
/// <summary> /// 修改简历信息 /// </summary> /// <param name="res"></param> /// <returns></returns> public int UpdateResumes(Resumes res) { var rest = "update Resumes set R_Name = @R_Name,R_Age = @R_Age,R_Phone = @R_Phone,R_Address = @R_Address,R_Email = @R_Email,R_Experience = @R_Experience,R_Picture = @R_Picture,R_Occupation = @R_Occupation,R_Salary = @R_Salary,R_School = @R_School,R_Studyingtime = @R_Studyingtime,R_Major = @R_Major,R_Degree = @R_Degree,R_WorkExperience = @R_WorkExperience,R_Selfevaluation = @R_Selfevaluation where R_Id = @R_Id"; return(DapperHelper <Resumes> .Execute(rest, new { R_Id = res.R_Id, R_Name = res.R_Name, R_Age = res.R_Age, R_Phone = res.R_Phone, R_Address = res.R_Address, R_Email = res.R_Email, R_Experience = res.R_Experience, R_Picture = res.R_Picture, R_Occupation = res.R_Occupation, R_Salary = res.R_Salary, R_School = res.R_School, R_Studyingtime = res.R_Studyingtime, R_Major = res.R_Major, R_Degree = res.R_Degree, R_WorkExperience = res.R_WorkExperience, R_Selfevaluation = res.R_Selfevaluation })); }
public HttpResponseMessage Get(int id) { try { if (id > 0) { Candidates cand = this._repo.GetCandidate(id); Resumes resume = this._repo.GetResume(cand.CandidateID); CandidateModel model = new CandidateModel() { Candidate = cand, Resume = resume }; if (!string.IsNullOrWhiteSpace(resume.ResumePath)) { string f = resume.ResumePath.Substring(resume.ResumePath.LastIndexOf("\\") + 1); model.ResumeVirtualPath = "/Resumes/" + resume.CandidateID + "/" + f; //Request.GetRequestContext().VirtualPathRoot + } HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, model); return(response); } else { return(Request.CreateErrorResponse(HttpStatusCode.NoContent, new Exception("No input found to get data"))); } } catch (Exception ex) { _tracer.Error(Request, this.ControllerContext.ControllerDescriptor.ControllerType.FullName, ex.StackTrace); return(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new StringContent(ex.Message) }); } }
public void UpdateResumes(IList <IFormFile> R_Picture, Resumes resutt) { long size = 0; var filename = ""; foreach (var file in R_Picture) { filename = ContentDispositionHeaderValue .Parse(file.ContentDisposition) .FileName .Trim('"'); //这个hostingEnv.WebRootPath就是要存的地址可以改下 filename = hostingEnv.WebRootPath + $@"\images\{filename}"; size += file.Length; using (FileStream fs = System.IO.File.Create(filename)) { file.CopyTo(fs); fs.Flush(); } } //修改信息 resutt.R_Picture = R_Picture[0].FileName; string json = JsonConvert.SerializeObject(resutt); var rest = Sender("put", "/api/Resumes/UpdateResumes", json); if (Convert.ToInt32(rest) > 0) { Response.Redirect("/Resumes/ShowResumes?name=" + resutt.R_Name); } else { Content("<script>alert('修改失败')</script>", "text/html"); } }
public HttpResponseMessage Post(InterviewSchedule schedule) { try { if (schedule != null) { string user = iRecruit.Security.Extensions.FetchUserFromRequestHeader(this.ActionContext); if (schedule.InterviewScheduleID == 0) { schedule.CreatedBy = user; } else { schedule.ModifiedBy = user; } string emailNotifications = this._repo.SaveInterviewSchedule(schedule); if (!string.IsNullOrWhiteSpace(emailNotifications)) { EmailHelper helper = new EmailHelper(); string calPath = HttpContext.Current.Server.MapPath("~/Schedules/Interview Schedule.ics"); new System.IO.FileInfo(calPath).Directory.Create(); try { helper.CreateCalenderEvent("", schedule.Subject, schedule.Description, schedule.StartTime, schedule.EndTime, ref calPath); EmailMessage message = new EmailMessage() { To = emailNotifications, Subject = "Technical Interview - #" + schedule.CandidateID }; List <string> mailAttachment = new List <string>(); string resumePhysicalPath = ""; if (schedule.AttachResume.Equals("1")) { Resumes resume = this._repo.GetResume(schedule.CandidateID); if (!string.IsNullOrWhiteSpace(resume.ResumePath)) { string f = resume.ResumePath.Substring(resume.ResumePath.LastIndexOf("\\") + 1); resumePhysicalPath = HttpContext.Current.Server.MapPath("~/Resumes/" + resume.CandidateID + "/" + f); mailAttachment.Add(resumePhysicalPath); } } helper.Send(message, mailAttachment, calPath, false); } finally { if (!string.IsNullOrWhiteSpace(calPath)) { try { File.Delete(calPath); }catch { } } } // cleanup temp files } HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, true); return(response); } else { return(Request.CreateErrorResponse(HttpStatusCode.NoContent, new Exception("No data found to save"))); } } catch (Exception ex) { _tracer.Error(Request, this.ControllerContext.ControllerDescriptor.ControllerType.FullName, ex.StackTrace); return(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new StringContent(ex.Message) }); } }
public int UpdateResumes(Resumes res) { return(bll.UpdateResumes(res)); }