/// <summary> /// Saves to an xml file /// </summary> /// <param name="jobApplication">Strcut of the jobApplication</param> public bool InsertApplication(jobApplication jobApp) { using (var writer = new System.IO.StreamWriter(dbFilePath + "\\" + jobApp.applicationDate.ToString("yyyyMMddhhmm") + "_" + jobApp.company + "_" + jobApp.title + ".xml", true)) { var serializer = new XmlSerializer(jobApp.GetType()); serializer.Serialize(writer, jobApp); writer.Flush(); } return(true); }
private void CloseJobApplicationToolStripMenuItem_Click(object sender, EventArgs e) { //Close Job Application string strFilePath = Array.FindAll(records, x => x.Contains(mainTreeView.SelectedNode.Name))[0]; DataStoreLayer ds = new DataStoreLayer(); jobApplication jApp = ds.LoadJobApplication(strFilePath); jApp.closedOn = DateTime.Now; File.Delete(Array.FindAll(records, x => x.Contains(mainTreeView.SelectedNode.Name))[0]); ds.InsertApplication(jApp); System.IO.File.Move(strFilePath, strFilePath.Replace(Path.GetFileNameWithoutExtension(strFilePath), "closed_" + Path.GetFileNameWithoutExtension(strFilePath))); drawTree(); }
private void CreateFollowUpsToolStripMenuItem_Click(object sender, EventArgs e) { //Create FollowUps from Job Application. jobApplication jApplication = new jobApplication(); DataStoreLayer dstore = new DataStoreLayer(); jApplication = dstore.LoadJobApplication(Array.FindAll(records, x => x.Contains(mainTreeView.SelectedNode.Name))[0]); JobActivityForm jobActForm = new JobActivityForm(jApplication); if (this.MdiParent.MdiChildren.Length > 2) { this.MdiParent.MdiChildren[2].Close(); } jobActForm.MdiParent = this.MdiParent; jobActForm.Show(); this.MdiParent.MdiChildren[2].Activate(); }
private void btnSave_Click(object sender, EventArgs e) { //generate XML jobApplication jb = new jobApplication(); jb.createdOn = DateTime.Now; jb.modifiedOn = DateTime.Now; jb.applicationDate = dateTimePickerAppliedOn.Value; jb.closedOn = new DateTime(1981, 1, 1); jb.advertisement = txtBody.Text; jb.advertiser = txtContact.Text; // Read docx of my CV try { jb.AppliedCVBinary = File.ReadAllBytes(txtCV.Text); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error is occured", MessageBoxButtons.OK); } jb.company = txtCompany.Text; jb.title = txtTitle.Text; jb.url = txtURL.Text; DataStoreLayer ds = new DataStoreLayer(); ds.InsertApplication(jb); MessageBox.Show("Record has been added successfully"); if (this.MdiParent.MdiChildren.Length > 0 && this.MdiParent.MdiChildren[0] is TreeViewForm) { ((TreeViewForm)this.MdiParent.MdiChildren[0]).drawTree(); } this.Close(); }
public JobActivityForm(jobApplication followUpApplication) { InitializeComponent(); txtRegarding.Text = followUpApplication.title; cmbType.SelectedItem = "Follow Up"; }