Inheritance: MonoBehaviour
    private void LoadGeneralInfo()
    {
        string resumeid = Request.QueryString["resumeid"];
        var resume = new Resume(resumeid);
        resume.SetFullResumeInfo();
        lbEmailContact.Text = resume.ContactEmail;
        lbCatelory.Text = resume.JobIndustries.JobIndustriesName;
        lbCertificates.Text = resume.Certificate.CertificateName;
        lbExperienceLevel.Text = resume.ExperienceLevel.LevelOfEcperience;
        lbJobPosition.Text = resume.JobPosition.Position;
        lbLangSkill.Text = resume.LangSkill.SkillName;
        lbLocation.Text = resume.Province.NameProvince;
        lbSalaryLevel.Text = resume.JobSalaryLevel.SalaryLevel;
        lbrHocVan.Text = resume.Reference;
        lbrKiNang.Text = resume.Skill;
        lbrThongTin.Text = resume.Literacy;
        lbrWorkExperience.Text = resume.WorkExperience;
        ltrMucTieu.Text = resume.Achievement;
        ltrNoiBat.Text = resume.CareerGoal;

        if (!String.IsNullOrEmpty(resume.Atachment))
        {
            LinkCv = "<a class='btn btn-default' style='position: absolute;right: 20%;top: 75px;'";
            LinkCv += "href='" + resume.Atachment + "'>DownLoad CV<i class='glyphicon glyphicon-download-alt'></i></a>";
        }
    }
Exemplo n.º 2
0
 protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
 {
     Resume r = new Resume();
     r.City = txtCity.Text;
     r.CountryID = int.Parse(ddlCountry.SelectedValue);
     r.CoveringLetterText = txtCoveringLetter.Text;
     r.EducationLevelID = int.Parse(ddlEduLevel.SelectedValue);
     r.ExperienceLevelID = int.Parse(ddlExpLevel.SelectedValue);
     r.JobTitle = txtJobTitle.Text;
     r.JobTypeID = int.Parse(ddlJobType.SelectedValue);
     r.RelocationCountryID = int.Parse(ddlRelocationCountry.SelectedValue);
     r.ResumeText = txtResume.Text;
     r.StateID = int.Parse(ddlState.SelectedValue);
     r.UserName = Profile.UserName;
     r.PostedDate = DateTime.Now;
     if (Profile.JobSeeker.ResumeID != -1)
     {
         r.ResumeID = Profile.JobSeeker.ResumeID;
         Resume.Update(r);
     }
     else
     {
         int retval = Resume.Insert(r);
         Profile.JobSeeker.ResumeID = retval;
     }
     lblMsg.Text = "Your resume is successfully updated!";
 }
Exemplo n.º 3
0
 public ActionResult Detail()
 {
     if (Request["id"] != null)
     {
         ViewData["model"] = new Resume().Find(int.Parse(Request["id"].ToString()));
     }
     return View();
 }
 private int Comparison(Resume rs1, Resume rs2)
 {
     if (rs2 != null && (rs1 != null && rs1.Rank > rs2.Rank))
         return -1;
     if (rs1 != null && (rs2 != null && rs2.Rank > rs1.Rank))
         return 1;//Nhở hơn
     return 0;//Bằng nhau
 }
Exemplo n.º 5
0
 public JsonResult Delete(string models)
 {
     List<sd_resume> resumlelist = new List<sd_resume>();
     if (models != null)
     {
         resumlelist = JsonConvert.DeserializeObject<List<sd_resume>>(models);
         var t = new Resume().Delete(resumlelist);
         return Json(t);
     }
     return Json(false);
 }
Exemplo n.º 6
0
 public ActionResult Add(string models)
 {
     JsonResult result = new JsonResult();
     if (models != null)
     {
         var model = JsonConvert.DeserializeObject<sd_resume>(models);
         var t = new Resume().Add(model);
         try
         {
             result.Data = true;
         }
         catch (Exception ex)
         {
             throw ex;
         }
     }
     return result;
 }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            Document[] documents = new Document[2];

            documents[0] = new Resume();
            documents[1] = new Report();

            //Display document pages
            foreach (Document document in documents)
            {
                Console.WriteLine("\n" + document.GetType().Name + "--");
                foreach (Page page in document.Pages)
                {
                    Console.WriteLine(" " + page.GetType().Name);
                }
            }

            Console.ReadKey();
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            Resume a = new Resume("小明");
            a.SetPersonalInfo("男","23");
            a.SetWorkExperience("2010-2015","XXX公司");
            //a.DisPlay();

            Resume b = (Resume)a.Clone();
            b.SetWorkExperience("1998-2008","YYY企业");

            Resume c = (Resume)a.Clone();
            c.SetPersonalInfo("男", "25");

            a.DisPlay();
            b.DisPlay();
            c.DisPlay();

            Console.ReadKey();
        }
Exemplo n.º 9
0
    // Entry point into console application.
    static void Main()
    {
        // Note: constructors call Factory Method
        Document[] documents = new Document[2];

        documents[0] = new Resume();
        documents[1] = new Report();

        // Display document pages
        foreach (Document document in documents)
        {
            Console.WriteLine("\n" + document.GetType().Name + "--");
            foreach (Page page in document.Pages)
            {
                Console.WriteLine(" " + page.GetType().Name);
            }
        }

        // Wait for user
        Console.ReadKey();
    }
    public string BuidRecomendJobs()
    {
        if (String.IsNullOrEmpty(_resumeId))
        {
            return "Bạn cần đăng hồ sơ để hệ thống có thể tự động tìm những công việc phù hợp với hồ sơ của bạn.";
        }
        else
        {
            var buider = new StringBuilder();

            var resume = new Resume(_resumeId);
            resume.SetFullResumeInfo();
            var list = resume.JobRanking(Convert.ToInt32(User3.UserId));
            list.Sort(Comparison);
            foreach (Jobs jobs in list.Take(3))
            {
                buider.AppendLine("<li>");
                buider.AppendLine("<h4><a href='");
                buider.AppendLine(jobs.RewriteUrl);
                buider.AppendLine("?jobid=");
                buider.AppendLine(jobs.JobId);
                buider.AppendLine("'>");
                buider.AppendLine(jobs.JobTitle);
                buider.AppendLine("</a></h4>");
                buider.AppendLine(" <p class='time'>");
                buider.AppendLine(String.Format("{0:dd/MM/yyyy}", DateTime.Parse(jobs.ExpiredDate.ToString())));
                buider.AppendLine("|");
                buider.AppendLine(jobs.Province.NameProvince);
                buider.AppendLine("</p>");
                buider.AppendLine(" <p class='name'>");
                buider.AppendLine(jobs.Recruitor.CompanyFullname);
                buider.AppendLine("</p>");
                buider.AppendLine(" <p class='add'>");
                buider.AppendLine(jobs.Recruitor.Address);
                buider.AppendLine("</p><hr/></li>");
            }
            return buider.ToString();
        }
    }
Exemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Roles.IsUserInRole(ConfigurationManager.AppSettings["jobseekerrolename"]))
        {
            Response.Redirect("~/customerrorpages/NotAuthorized.aspx");
        }

        if (!Page.IsPostBack)
        {
            if (Profile.JobSeeker.ResumeID != -1)
            {
                r = Resume.GetResume(Profile.UserName);
                txtJobTitle.Text = r.JobTitle;
                txtCity.Text = r.City;
                txtResume.Text = r.ResumeText;
                txtCoveringLetter.Text = r.CoveringLetterText;
            }
            FillCountries();
            FillEduLevels();
            FillExpLevels();
            FillJobTypes();
            FillStates();
        }
    }
Exemplo n.º 12
0
        /// <summary>
        /// 透過既有的套印檔匯出 Word 文件 (以「編輯書籤內容」方式套印)
        /// </summary>
        /// <param name="result">回傳: 執行結果</param>
        /// <param name="msg">回傳: 訊息</param>
        /// <returns>串流資訊</returns>
        public byte[] ExportResumeByDocx_Bookmark(out bool result, out string msg)
        {
            result = true;
            msg    = "";
            MemoryStream ms = new MemoryStream();

            try
            {
                Spire.Doc.Document document = new Spire.Doc.Document();

                //載入套印檔
                //注意: 實際運作時,若同一時間有兩位以上使用者同時進行套印,會產生「無法開啟已開啟檔案」的錯誤
                //建議實作時,一個使用者執行匯出動作時先複製一個套印檔,完成套印後再將複製的檔案刪除,即可避開錯誤
                document.LoadFromFile(HttpContext.Current.Server.MapPath("~/App_Data/MyResumeSample_Bookmark.docx"));

                #region 定義樣式

                //定義樣式 BasicStyle: 一般段落文字
                ParagraphStyle style = new ParagraphStyle(document)
                {
                    Name = "Basic"
                };
                //style.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.Justify;
                style.CharacterFormat.FontName = "標楷體";
                style.CharacterFormat.FontSize = 12;
                document.Styles.Add(style);

                #endregion

                //取得要套印的內容
                Resume model = new Resume();

                #region 套印內容

                BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);

                Spire.Doc.Bookmark bookmark = document.Bookmarks.FindByName("NAME");
                if (bookmark != null)
                {
                    bookmarkNavigator.MoveToBookmark("NAME");
                    bookmarkNavigator.ReplaceBookmarkContent(string.IsNullOrEmpty(model.Name) ? "" : model.Name, false);
                }
                bookmark = document.Bookmarks.FindByName("GENDER");
                if (bookmark != null)
                {
                    bookmarkNavigator.MoveToBookmark("GENDER");
                    bookmarkNavigator.ReplaceBookmarkContent(string.IsNullOrEmpty(model.Gender) ? "" : model.Gender, false);
                }
                bookmark = document.Bookmarks.FindByName("EMAIL");
                if (bookmark != null)
                {
                    bookmarkNavigator.MoveToBookmark("EMAIL");
                    bookmarkNavigator.ReplaceBookmarkContent(string.IsNullOrEmpty(model.Email) ? "" : model.Email, false);
                }
                bookmark = document.Bookmarks.FindByName("ADDRESS");
                if (bookmark != null)
                {
                    bookmarkNavigator.MoveToBookmark("ADDRESS");
                    bookmarkNavigator.ReplaceBookmarkContent(string.IsNullOrEmpty(model.Address) ? "" : model.Address, false);
                }
                bookmark = document.Bookmarks.FindByName("PHONE");
                if (bookmark != null)
                {
                    bookmarkNavigator.MoveToBookmark("PHONE");
                    bookmarkNavigator.ReplaceBookmarkContent(string.IsNullOrEmpty(model.Phone) ? "" : model.Phone, false);
                }
                bookmark = document.Bookmarks.FindByName("MOBILE");
                if (bookmark != null)
                {
                    bookmarkNavigator.MoveToBookmark("MOBILE");
                    bookmarkNavigator.ReplaceBookmarkContent(string.IsNullOrEmpty(model.Mobile) ? "" : model.Mobile, false);
                }



                Spire.Doc.Section tempSection = document.AddSection();
                string            html;
                ParagraphBase     replacementFirstItem;
                ParagraphBase     replacementLastItem;
                TextBodySelection selection;
                TextBodyPart      part;

                //HTML Contents: Desciprion1
                bookmark = document.Bookmarks.FindByName("DESCRIPTION1");
                if (bookmark != null)
                {
                    html = string.IsNullOrEmpty(model.Description1) ? "" : HttpUtility.HtmlDecode(model.Description1);
                    tempSection.AddParagraph().AppendHTML(html);
                    replacementFirstItem = tempSection.Paragraphs[0].Items.FirstItem as ParagraphBase;
                    replacementLastItem  = tempSection.Paragraphs[tempSection.Paragraphs.Count - 1].Items.LastItem as ParagraphBase;
                    selection            = new TextBodySelection(replacementFirstItem, replacementLastItem);
                    //將內容各段落套用指定的樣式
                    for (int i = 0; i < tempSection.Paragraphs.Count; i++)
                    {
                        tempSection.Paragraphs[i].ApplyStyle("Basic");
                    }
                    part = new TextBodyPart(selection);

                    // locate the bookmark
                    bookmarkNavigator.MoveToBookmark("DESCRIPTION1");
                    //replace the content of bookmark
                    bookmarkNavigator.ReplaceBookmarkContent(part);
                    //remove temp section
                    document.Sections.Remove(tempSection);
                }

                //HTML Contents: Desciprion2
                bookmark = document.Bookmarks.FindByName("DESCRIPTION2");
                if (bookmark != null)
                {
                    tempSection = document.AddSection();
                    html        = string.IsNullOrEmpty(model.Description2) ? "" : HttpUtility.HtmlDecode(model.Description2);
                    tempSection.AddParagraph().AppendHTML(html);
                    replacementFirstItem = tempSection.Paragraphs[0].Items.FirstItem as ParagraphBase;
                    replacementLastItem  = tempSection.Paragraphs[tempSection.Paragraphs.Count - 1].Items.LastItem as ParagraphBase;
                    selection            = new TextBodySelection(replacementFirstItem, replacementLastItem);
                    part = new TextBodyPart(selection);

                    bookmarkNavigator.MoveToBookmark("DESCRIPTION2");
                    bookmarkNavigator.ReplaceBookmarkContent(part);
                    document.Sections.Remove(tempSection);
                }

                //圖片
                bookmark = document.Bookmarks.FindByName("IMG");
                if (bookmark != null)
                {
                    bookmarkNavigator.MoveToBookmark("IMG");
                    Spire.Doc.Section             section_img   = document.AddSection();
                    Spire.Doc.Documents.Paragraph paragraph_img = section_img.AddParagraph();
                    Image      img     = Image.FromFile(HttpContext.Current.Server.MapPath("~/App_Data/Penguins.jpg"));
                    DocPicture picture = paragraph_img.AppendPicture(img);

                    bookmarkNavigator.InsertParagraph(paragraph_img);
                    document.Sections.Remove(section_img);
                }
                #endregion

                #region 動態新增表格

                if (model.JobHistory.Count > 0)
                {
                    Spire.Doc.Section s      = document.AddSection();
                    Spire.Doc.Table   table  = s.AddTable(true);
                    string[]          Header = { "序號", "任職公司", "職稱", "開始時間", "結束時間" };

                    //Add Cells
                    table.ResetCells(model.JobHistory.Count + 1, Header.Length);

                    //Header Row
                    TableRow FRow = table.Rows[0];
                    FRow.IsHeader = true;
                    for (int i = 0; i < Header.Length; i++)
                    {
                        Spire.Doc.Documents.Paragraph p = FRow.Cells[i].AddParagraph();
                        FRow.Cells[i].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
                        p.Format.HorizontalAlignment = HorizontalAlignment.Center;

                        TextRange TR = p.AppendText(Header[i]);
                        TR.CharacterFormat.Bold = true;
                    }

                    //Data Row
                    model.JobHistory = model.JobHistory.OrderBy(x => x.StartDT).ToList();
                    for (int r = 0; r < model.JobHistory.Count; r++)
                    {
                        TableRow DataRow = table.Rows[r + 1];
                        string[] data    = new string[] { (r + 1).ToString(), model.JobHistory[r].CompanyName, model.JobHistory[r].JobTitle, (model.JobHistory[r].StartDT.HasValue ? model.JobHistory[r].StartDT.Value.ToShortDateString() : ""), (model.JobHistory[r].EndDT.HasValue ? model.JobHistory[r].EndDT.Value.ToShortDateString() : "") };

                        //Columns.
                        for (int c = 0; c < data.Length; c++)
                        {
                            //Cell Alignment
                            DataRow.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;

                            //Fill Data in Rows
                            Spire.Doc.Documents.Paragraph p2 = DataRow.Cells[c].AddParagraph();
                            TextRange TR2 = p2.AppendText(data[c]);

                            //Format Cells
                            p2.Format.HorizontalAlignment = HorizontalAlignment.Center;
                        }
                    }

                    bookmarkNavigator.MoveToBookmark("TABLE");
                    bookmarkNavigator.InsertTable(table);
                }

                #endregion

                #region 套用樣式

                //套用文章段落樣式
                for (int s = 0; s < document.Sections.Count; s++)
                {
                    Spire.Doc.Section sections = document.Sections[s];
                    //套用文章段落樣式
                    for (int p = 0; p < sections.Paragraphs.Count; p++)
                    {
                        Spire.Doc.Documents.Paragraph pgh = sections.Paragraphs[p];
                        pgh.ApplyStyle("Basic");
                        pgh.Format.BeforeSpacing = 12;
                    }

                    //套用表格樣式
                    for (int t = 0; t < document.Sections[s].Tables.Count; t++)
                    {
                        Spire.Doc.Table table = (Spire.Doc.Table)document.Sections[s].Tables[t];
                        table.PreferredWidth            = new PreferredWidth(WidthType.Percentage, 100);
                        table.TableFormat.IsAutoResized = true;

                        //set table border
                        //table.TableFormat.Borders.Right.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Left.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Top.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Bottom.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Horizontal.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Vertical.BorderType = Spire.Doc.Documents.BorderStyle.Thick;

                        for (int tr = 0; tr < table.Rows.Count; tr++)
                        {
                            for (int td = 0; td < table.Rows[tr].Cells.Count; td++)
                            {
                                for (int t_ph = 0; t_ph < table.Rows[tr].Cells[td].Paragraphs.Count; t_ph++)
                                {
                                    table.Rows[tr].Cells[td].Paragraphs[t_ph].ApplyStyle("Basic");
                                }
                            }
                        }
                    }
                }

                #endregion

                //匯出
                document.SaveToStream(ms, FileFormat.Docx);
            }
            catch (Exception ex)
            {
                result = false;
                msg    = ex.Message;
            }

            if (result)
            {
                return(ms.ToArray());
            }
            else
            {
                return(null);
            }
        }
        protected override void Execute(Component component)
        {
            LocateJoystick();

            if (!isEnabled || destinationAddress == null)
                return;

            // request control and update the GUI to denote this
            if (!hasControl)
            {
                RequestControl requestControl = new RequestControl();
                requestControl.SetDestination(destinationAddress);
                requestControl.SetSource(component.JausAddress);
                Transport.SendMessage(requestControl);

                // update the connection icon for the correct component to orange
                if (destinationAddress.getComponent() == 1)
                    connectionDetails.direct = ConnectionOption.REQUESTING_CONTROL;
                if (destinationAddress.getComponent() == 2)
                    connectionDetails.remote = ConnectionOption.REQUESTING_CONTROL;
                if (destinationAddress.getComponent() == 3)
                    connectionDetails.ai = ConnectionOption.REQUESTING_CONTROL;
                _eventAggregator.GetEvent<ConnectionDetailsEvent>().Publish(connectionDetails);

                return;
            }

            // shut down all components, then resume the one that should be active (i.e. jank hax)
            if (!isReady)
            {
                // shut down all active components
                Shutdown shutdown = new Shutdown();
                int subsys = CurrentDestinationAddress.SubsystemID;
                int node = CurrentDestinationAddress.getNode();
                JausAddress newAddress = new JausAddress(subsys, node, 1);
                QueryStatus queryStatus = new QueryStatus();

                if (componentOneActive)
                {
                    shutdown.SetDestination(newAddress);
                    Transport.SendMessage(shutdown);

                    queryStatus.SetDestination(newAddress);
                    queryStatus.SetSource(component.JausAddress);
                    Transport.SendMessage(queryStatus);
                }
                if (componentTwoActive)
                {
                    newAddress.setComponent(2);
                    shutdown.SetDestination(newAddress);
                    Transport.SendMessage(shutdown);

                    queryStatus.SetDestination(newAddress);
                    queryStatus.SetSource(component.JausAddress);
                    Transport.SendMessage(queryStatus);
                }
                if (componentThreeActive)
                {
                    newAddress.setComponent(3);
                    shutdown.SetDestination(newAddress);
                    Transport.SendMessage(shutdown);

                    queryStatus = new QueryStatus();
                    queryStatus.SetDestination(newAddress);
                    queryStatus.SetSource(component.JausAddress);
                    Transport.SendMessage(queryStatus);
                }

                // force component to boot
                Resume resume = new Resume();
                resume.SetDestination(destinationAddress);
                resume.SetSource(component.JausAddress);
                Transport.SendMessage(resume);

                // see if the component is ready
                queryStatus = new QueryStatus();
                queryStatus.SetDestination(destinationAddress);
                queryStatus.SetSource(component.JausAddress);
                Transport.SendMessage(queryStatus);

                return;
            }

            // send a drive message
            SetLocalVector msg = new SetLocalVector();
            msg.SetDestination(destinationAddress);
            msg.SetSource(component.JausAddress);

            // convert joystick degrees into radians
            // TODO: THIS IS INCORRECT
            msg.SetHeading(joystickQueryThread.XVelocity * (Math.PI / 180));

            //adding 100 to fit into defined setLocalVector MAX_SPEED & MIN_SPEED
            msg.SetSpeed(joystickQueryThread.YVelocity + 100);

            Transport.SendMessage(msg);
        }
        public void Convert()
        {
            Environment.CurrentDirectory = DataFolder;

            Resume           resume  = null;
            CICMMetadataType sidecar = null;

            var     filtersList = new FiltersList();
            IFilter inputFilter = filtersList.GetFilter(InputPath);

            Assert.IsNotNull(inputFilter, "Cannot open specified file.");

            string outputPath = Path.Combine(Path.GetTempPath(), SuggestedOutputFilename);

            Assert.IsFalse(File.Exists(outputPath), "Output file already exists, not continuing.");

            IMediaImage inputFormat = ImageFormat.Detect(inputFilter);

            Assert.IsNotNull(inputFormat, "Input image format not identified, not proceeding with conversion.");

            Assert.IsTrue(inputFormat.Open(inputFilter), "Unable to open image format");

            Assert.IsTrue(OutputFormat.SupportedMediaTypes.Contains(inputFormat.Info.MediaType),
                          "Output format does not support media type, cannot continue...");

            if (inputFormat.Info.ReadableSectorTags.Count == 0)
            {
                Assert.IsFalse(UseLong, "Input image does not support long sectors.");
            }

            var inputOptical  = inputFormat as IOpticalMediaImage;
            var outputOptical = OutputFormat as IWritableOpticalImage;

            Assert.IsNotNull(inputOptical, "Could not treat existing image as optical disc.");
            Assert.IsNotNull(outputOptical, "Could not treat new image as optical disc.");
            Assert.IsNotNull(inputOptical.Tracks, "Existing image contains no tracks.");

            Assert.IsTrue(outputOptical.Create(outputPath, inputFormat.Info.MediaType, ParsedOptions, inputFormat.Info.Sectors, inputFormat.Info.SectorSize),
                          $"Error {outputOptical.ErrorMessage} creating output image.");

            var metadata = new ImageInfo
            {
                Application           = "Aaru",
                ApplicationVersion    = Version.GetVersion(),
                Comments              = inputFormat.Info.Comments,
                Creator               = inputFormat.Info.Creator,
                DriveFirmwareRevision = inputFormat.Info.DriveFirmwareRevision,
                DriveManufacturer     = inputFormat.Info.DriveManufacturer,
                DriveModel            = inputFormat.Info.DriveModel,
                DriveSerialNumber     = inputFormat.Info.DriveSerialNumber,
                LastMediaSequence     = inputFormat.Info.LastMediaSequence,
                MediaBarcode          = inputFormat.Info.MediaBarcode,
                MediaManufacturer     = inputFormat.Info.MediaManufacturer,
                MediaModel            = inputFormat.Info.MediaModel,
                MediaPartNumber       = inputFormat.Info.MediaPartNumber,
                MediaSequence         = inputFormat.Info.MediaSequence,
                MediaSerialNumber     = inputFormat.Info.MediaSerialNumber,
                MediaTitle            = inputFormat.Info.MediaTitle
            };

            Assert.IsTrue(outputOptical.SetMetadata(metadata),
                          $"Error {outputOptical.ErrorMessage} setting metadata, ");

            CICMMetadataType        cicmMetadata = inputFormat.CicmMetadata;
            List <DumpHardwareType> dumpHardware = inputFormat.DumpHardware;

            foreach (MediaTagType mediaTag in inputFormat.Info.ReadableMediaTags.Where(mediaTag =>
                                                                                       outputOptical.SupportedMediaTags.Contains(mediaTag)))
            {
                AaruConsole.WriteLine("Converting media tag {0}", mediaTag);
                byte[] tag = inputFormat.ReadDiskTag(mediaTag);

                Assert.IsTrue(outputOptical.WriteMediaTag(tag, mediaTag));
            }

            AaruConsole.WriteLine("{0} sectors to convert", inputFormat.Info.Sectors);
            ulong doneSectors;

            Assert.IsTrue(outputOptical.SetTracks(inputOptical.Tracks),
                          $"Error {outputOptical.ErrorMessage} sending tracks list to output image.");

            foreach (Track track in inputOptical.Tracks)
            {
                doneSectors = 0;
                ulong trackSectors = track.TrackEndSector - track.TrackStartSector + 1;

                while (doneSectors < trackSectors)
                {
                    byte[] sector;

                    uint sectorsToDo;

                    if (trackSectors - doneSectors >= SECTORS_TO_READ)
                    {
                        sectorsToDo = SECTORS_TO_READ;
                    }
                    else
                    {
                        sectorsToDo = (uint)(trackSectors - doneSectors);
                    }

                    bool useNotLong = false;
                    bool result     = false;

                    if (UseLong)
                    {
                        if (sectorsToDo == 1)
                        {
                            sector = inputFormat.ReadSectorLong(doneSectors + track.TrackStartSector);
                            result = outputOptical.WriteSectorLong(sector, doneSectors + track.TrackStartSector);
                        }
                        else
                        {
                            sector = inputFormat.ReadSectorsLong(doneSectors + track.TrackStartSector, sectorsToDo);

                            result = outputOptical.WriteSectorsLong(sector, doneSectors + track.TrackStartSector,
                                                                    sectorsToDo);
                        }

                        if (!result &&
                            sector.Length % 2352 != 0)
                        {
                            useNotLong = true;
                        }
                    }

                    if (!UseLong || useNotLong)
                    {
                        if (sectorsToDo == 1)
                        {
                            sector = inputFormat.ReadSector(doneSectors + track.TrackStartSector);
                            result = outputOptical.WriteSector(sector, doneSectors + track.TrackStartSector);
                        }
                        else
                        {
                            sector = inputFormat.ReadSectors(doneSectors + track.TrackStartSector, sectorsToDo);

                            result = outputOptical.WriteSectors(sector, doneSectors + track.TrackStartSector,
                                                                sectorsToDo);
                        }
                    }

                    Assert.IsTrue(result,
                                  $"Error {outputOptical.ErrorMessage} writing sector {doneSectors + track.TrackStartSector}, not continuing...");

                    doneSectors += sectorsToDo;
                }
            }

            Dictionary <byte, string> isrcs                  = new Dictionary <byte, string>();
            Dictionary <byte, byte>   trackFlags             = new Dictionary <byte, byte>();
            string                 mcn                       = null;
            HashSet <int>          subchannelExtents         = new HashSet <int>();
            Dictionary <byte, int> smallestPregapLbaPerTrack = new Dictionary <byte, int>();

            Track[] tracks = new Track[inputOptical.Tracks.Count];

            for (int i = 0; i < tracks.Length; i++)
            {
                tracks[i] = new Track
                {
                    Indexes                = new Dictionary <ushort, int>(),
                    TrackDescription       = inputOptical.Tracks[i].TrackDescription,
                    TrackEndSector         = inputOptical.Tracks[i].TrackEndSector,
                    TrackStartSector       = inputOptical.Tracks[i].TrackStartSector,
                    TrackPregap            = inputOptical.Tracks[i].TrackPregap,
                    TrackSequence          = inputOptical.Tracks[i].TrackSequence,
                    TrackSession           = inputOptical.Tracks[i].TrackSession,
                    TrackBytesPerSector    = inputOptical.Tracks[i].TrackBytesPerSector,
                    TrackRawBytesPerSector = inputOptical.Tracks[i].TrackRawBytesPerSector,
                    TrackType              = inputOptical.Tracks[i].TrackType,
                    TrackSubchannelType    = inputOptical.Tracks[i].TrackSubchannelType
                };

                foreach (KeyValuePair <ushort, int> idx in inputOptical.Tracks[i].Indexes)
                {
                    tracks[i].Indexes[idx.Key] = idx.Value;
                }
            }

            foreach (SectorTagType tag in inputFormat.Info.ReadableSectorTags.Where(t => t == SectorTagType.CdTrackIsrc).
                     OrderBy(t => t))
            {
                foreach (Track track in tracks)
                {
                    byte[] isrc = inputFormat.ReadSectorTag(track.TrackSequence, tag);

                    if (isrc is null)
                    {
                        continue;
                    }

                    isrcs[(byte)track.TrackSequence] = Encoding.UTF8.GetString(isrc);
                }
            }

            foreach (SectorTagType tag in inputFormat.Info.ReadableSectorTags.
                     Where(t => t == SectorTagType.CdTrackFlags).OrderBy(t => t))
            {
                foreach (Track track in tracks)
                {
                    byte[] flags = inputFormat.ReadSectorTag(track.TrackSequence, tag);

                    if (flags is null)
                    {
                        continue;
                    }

                    trackFlags[(byte)track.TrackSequence] = flags[0];
                }
            }

            for (ulong s = 0; s < inputFormat.Info.Sectors; s++)
            {
                if (s > int.MaxValue)
                {
                    break;
                }

                subchannelExtents.Add((int)s);
            }

            foreach (SectorTagType tag in inputFormat.Info.ReadableSectorTags.OrderBy(t => t).TakeWhile(tag => UseLong))
            {
                switch (tag)
                {
                case SectorTagType.AppleSectorTag:
                case SectorTagType.CdSectorSync:
                case SectorTagType.CdSectorHeader:
                case SectorTagType.CdSectorSubHeader:
                case SectorTagType.CdSectorEdc:
                case SectorTagType.CdSectorEccP:
                case SectorTagType.CdSectorEccQ:
                case SectorTagType.CdSectorEcc:
                    // This tags are inline in long sector
                    continue;
                }

                if (!outputOptical.SupportedSectorTags.Contains(tag))
                {
                    continue;
                }

                foreach (Track track in inputOptical.Tracks)
                {
                    doneSectors = 0;
                    ulong  trackSectors = track.TrackEndSector - track.TrackStartSector + 1;
                    byte[] sector;
                    bool   result;

                    switch (tag)
                    {
                    case SectorTagType.CdTrackFlags:
                    case SectorTagType.CdTrackIsrc:
                        sector = inputFormat.ReadSectorTag(track.TrackSequence, tag);
                        result = outputOptical.WriteSectorTag(sector, track.TrackSequence, tag);

                        Assert.IsTrue(result, $"Error {outputOptical.ErrorMessage} writing tag, not continuing...");

                        continue;
                    }

                    while (doneSectors < trackSectors)
                    {
                        uint sectorsToDo;

                        if (trackSectors - doneSectors >= SECTORS_TO_READ)
                        {
                            sectorsToDo = SECTORS_TO_READ;
                        }
                        else
                        {
                            sectorsToDo = (uint)(trackSectors - doneSectors);
                        }

                        if (sectorsToDo == 1)
                        {
                            sector = inputFormat.ReadSectorTag(doneSectors + track.TrackStartSector, tag);

                            if (tag == SectorTagType.CdSectorSubchannel)
                            {
                                bool indexesChanged = CompactDisc.WriteSubchannelToImage(MmcSubchannel.Raw,
                                                                                         MmcSubchannel.Raw, sector, doneSectors + track.TrackStartSector, 1, null,
                                                                                         isrcs, (byte)track.TrackSequence, ref mcn, tracks, subchannelExtents, true,
                                                                                         outputOptical, true, true, null, null, smallestPregapLbaPerTrack, false);

                                if (indexesChanged)
                                {
                                    outputOptical.SetTracks(tracks.ToList());
                                }

                                result = true;
                            }
                            else
                            {
                                result = outputOptical.WriteSectorTag(sector, doneSectors + track.TrackStartSector,
                                                                      tag);
                            }
                        }
                        else
                        {
                            sector = inputFormat.ReadSectorsTag(doneSectors + track.TrackStartSector, sectorsToDo, tag);

                            if (tag == SectorTagType.CdSectorSubchannel)
                            {
                                bool indexesChanged = CompactDisc.WriteSubchannelToImage(MmcSubchannel.Raw,
                                                                                         MmcSubchannel.Raw, sector, doneSectors + track.TrackStartSector, sectorsToDo,
                                                                                         null, isrcs, (byte)track.TrackSequence, ref mcn, tracks, subchannelExtents,
                                                                                         true, outputOptical, true, true, null, null, smallestPregapLbaPerTrack, false);

                                if (indexesChanged)
                                {
                                    outputOptical.SetTracks(tracks.ToList());
                                }

                                result = true;
                            }
                            else
                            {
                                result = outputOptical.WriteSectorsTag(sector, doneSectors + track.TrackStartSector,
                                                                       sectorsToDo, tag);
                            }
                        }

                        Assert.IsTrue(result,
                                      $"Error {outputOptical.ErrorMessage} writing tag for sector {doneSectors + track.TrackStartSector}, not continuing...");

                        doneSectors += sectorsToDo;
                    }
                }
            }

            if (isrcs.Count > 0)
            {
                foreach (KeyValuePair <byte, string> isrc in isrcs)
                {
                    outputOptical.WriteSectorTag(Encoding.UTF8.GetBytes(isrc.Value), isrc.Key,
                                                 SectorTagType.CdTrackIsrc);
                }
            }

            if (trackFlags.Count > 0)
            {
                foreach ((byte track, byte flags) in trackFlags)
                {
                    outputOptical.WriteSectorTag(new[]
                    {
                        flags
                    }, track, SectorTagType.CdTrackFlags);
                }
            }

            if (mcn != null)
            {
                outputOptical.WriteMediaTag(Encoding.UTF8.GetBytes(mcn), MediaTagType.CD_MCN);
            }

            if (resume != null ||
                dumpHardware != null)
            {
                if (resume != null)
                {
                    outputOptical.SetDumpHardware(resume.Tries);
                }
                else if (dumpHardware != null)
                {
                    outputOptical.SetDumpHardware(dumpHardware);
                }
            }

            if (sidecar != null ||
                cicmMetadata != null)
            {
                if (sidecar != null)
                {
                    outputOptical.SetCicmMetadata(sidecar);
                }
                else if (cicmMetadata != null)
                {
                    outputOptical.SetCicmMetadata(cicmMetadata);
                }
            }

            Assert.True(outputOptical.Close(),
                        $"Error {outputOptical.ErrorMessage} closing output image... Contents are not correct.");

            // Some images will never generate the same
            if (Md5 != null)
            {
                string md5 = Md5Context.File(outputPath, out _);

                Assert.AreEqual(Md5, md5, "Hashes are different");
            }

            File.Delete(outputPath);
        }
Exemplo n.º 15
0
 private Work Path(Resume resume) => resume.Work.FirstOrDefault();
Exemplo n.º 16
0
    private void FillStates()
    {
        r = Resume.GetResume(Profile.UserName);

        ddlState.DataSource = State.GetStates(int.Parse(ddlCountry.SelectedValue));
        ddlState.DataTextField = "StateName";
        ddlState.DataValueField = "StateID";
        ddlState.DataBind();

        if (Profile.JobSeeker.ResumeID != -1)
        {
            ListItem li;
            li = ddlState.Items.FindByValue(r.StateID.ToString());
            if (li != null)
            {
                ddlState.ClearSelection();
                li.Selected = true;
            }
        }
    }
Exemplo n.º 17
0
 public void TestEquals()
 {
     var e1 = new Resume { Basics = new Basics { Name = "Alois" } };
     var e2 = new Resume { Basics = new Basics { Name = "Alois" } };
     Assert.AreEqual(e1, e2);
 }
Exemplo n.º 18
0
        protected void CreateMember(TestResume testResume, out Member member, out Candidate candidate, out Resume resume)
        {
            // Member.

            member = CreateMember();

            // Candidate.

            candidate = _candidatesQuery.GetCandidate(member.Id);
            candidate.DesiredJobTitle = DesiredJobTitle;
            candidate.DesiredJobTypes = JobTypes.FullTime | JobTypes.JobShare;
            candidate.DesiredSalary   = new Salary {
                LowerBound = SalaryLowerBound, Rate = SalaryRate.Year, Currency = Currency.AUD
            };
            candidate.HighestEducationLevel = EducationLevel.Postgraduate;
            var industries = _industriesQuery.GetIndustries();

            candidate.Industries = new List <Industry> {
                industries[1], industries[2]
            };
            candidate.RecentProfession     = Profession.Science;
            candidate.RecentSeniority      = Seniority.MidSenior;
            candidate.RelocationPreference = RelocationPreference.Yes;
            var country = _locationQuery.GetCountry(Country);

            candidate.RelocationLocations = new List <LocationReference> {
                _locationQuery.ResolveLocation(country, RelocationLocation)
            };
            candidate.Status     = CandidateStatus.AvailableNow;
            candidate.VisaStatus = VisaStatus.RestrictedWorkVisa;

            _candidatesCommand.UpdateCandidate(candidate);

            // Resume.

            resume = testResume.GetParsedResume().Resume;
            _candidateResumesCommand.CreateResume(candidate, resume);
        }
Exemplo n.º 19
0
 public void Parse(Section section, Resume resume)
 {
     resume.Courses = section.Content;
 }
Exemplo n.º 20
0
        public ActionResult Clear()
        {
            List <Resume> allJobs = Resume.DelAll();

            return(View("Clear"));
        }
Exemplo n.º 21
0
        public ActionResult Index()
        {
            List <Resume> allJobs = Resume.GetAll();

            return(View(allJobs));
        }
Exemplo n.º 22
0
 public IHttpActionResult ResumeData(Resume _resumeData)
 {
     return(Ok());
 }
Exemplo n.º 23
0
 public void UpdateResume(Resume resume)
 {
     _db.Resume.Update(resume);
 }
Exemplo n.º 24
0
 private Basics Path(Resume resume) => resume.Basics;
Exemplo n.º 25
0
        /// <summary>
        /// 透過既有的套印檔匯出 Word 文件 (以「取代文字」方式套印)
        /// </summary>
        /// <param name="result">回傳: 執行結果</param>
        /// <param name="msg">回傳: 訊息</param>
        /// <returns>串流資訊</returns>
        public byte[] ExportResumeByDocx_ReplaceText(out bool result, out string msg)
        {
            result = true;
            msg    = "";
            MemoryStream ms = new MemoryStream();

            try
            {
                Spire.Doc.Document document = new Spire.Doc.Document();

                //載入套印檔
                //注意: 實際運作時,若同一時間有兩位以上使用者同時進行套印,會產生「無法開啟已開啟檔案」的錯誤
                //建議實作時,一個使用者執行匯出動作時先複製一個套印檔,完成套印後再將複製的檔案刪除,即可避開錯誤
                document.LoadFromFile(HttpContext.Current.Server.MapPath("~/App_Data/MyResumeSample.docx"));

                #region 定義樣式

                //定義樣式 BasicStyle: 一般段落文字
                ParagraphStyle style = new ParagraphStyle(document)
                {
                    Name = "Basic"
                };
                //style.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.Justify;
                style.CharacterFormat.FontName = "標楷體";
                style.CharacterFormat.FontSize = 12;
                document.Styles.Add(style);

                #endregion

                //取得要套印的內容
                Resume model = new Resume();

                #region 套印內容

                document.Replace("{$Name$}", string.IsNullOrEmpty(model.Name) ? "" : model.Name, false, true);
                document.Replace("{$Gender$}", string.IsNullOrEmpty(model.Gender) ? "" : model.Gender, false, true);
                document.Replace("{$Email$}", string.IsNullOrEmpty(model.Email) ? "" : model.Email, false, true);
                document.Replace("{$Address$}", string.IsNullOrEmpty(model.Address) ? "" : model.Address, false, true);
                document.Replace("{$Phone$}", string.IsNullOrEmpty(model.Phone) ? "" : model.Phone, false, true);
                document.Replace("{$Mobile$}", string.IsNullOrEmpty(model.Mobile) ? "" : model.Mobile, false, true);

                //包含 HTML 字串需放置在 paragraph 內,
                //因此套印檔中的 {$Description1$} 及 {$Description2$} 需透過「以 paragraph 取代文字」方式替代
                //Replace {$Description1$} with paragraph
                TextSelection selection = document.FindString("{$Description1$}", false, true);
                TextRange     range     = selection.GetAsOneRange();
                Spire.Doc.Documents.Paragraph paragraph = range.OwnerParagraph;
                paragraph.ApplyStyle("Basic");
                paragraph.Replace("{$Description1$}", "", false, false);
                paragraph.AppendHTML(string.IsNullOrEmpty(model.Description1) ? "" : HttpUtility.HtmlDecode(model.Description1));

                //Replace {$Description2$} with paragraph
                selection = document.FindString("{$Description2$}", false, true);
                range     = selection.GetAsOneRange();
                paragraph = range.OwnerParagraph;
                paragraph.ApplyStyle("Basic");
                paragraph.Replace("{$Description2$}", "", false, false);
                paragraph.AppendHTML(string.IsNullOrEmpty(model.Description2) ? "" : HttpUtility.HtmlDecode(model.Description2));

                //Replace {$Img$} with Image
                DocPicture pic = new DocPicture(document);
                pic.LoadImage(Image.FromFile(HttpContext.Current.Server.MapPath("~/App_Data/Penguins.jpg")));

                selection = document.FindString("{$Img$}", false, true);
                range     = selection.GetAsOneRange();
                range.OwnerParagraph.ChildObjects.Insert(0, pic);
                range.OwnerParagraph.ChildObjects.Remove(range);

                #endregion

                #region 動態新增表格

                if (model.JobHistory.Count > 0)
                {
                    Spire.Doc.Section s      = document.AddSection();
                    Spire.Doc.Table   table  = s.AddTable(true);
                    string[]          Header = { "序號", "任職公司", "職稱", "開始時間", "結束時間" };

                    //Add Cells
                    table.ResetCells(model.JobHistory.Count + 1, Header.Length);

                    //Header Row
                    TableRow FRow = table.Rows[0];
                    FRow.IsHeader = true;
                    for (int i = 0; i < Header.Length; i++)
                    {
                        Spire.Doc.Documents.Paragraph p = FRow.Cells[i].AddParagraph();
                        FRow.Cells[i].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
                        p.Format.HorizontalAlignment = HorizontalAlignment.Center;

                        TextRange TR = p.AppendText(Header[i]);
                        TR.CharacterFormat.Bold = true;
                    }

                    //Data Row
                    model.JobHistory = model.JobHistory.OrderBy(x => x.StartDT).ToList();
                    for (int r = 0; r < model.JobHistory.Count; r++)
                    {
                        TableRow DataRow = table.Rows[r + 1];
                        string[] data    = new string[] { (r + 1).ToString(), model.JobHistory[r].CompanyName, model.JobHistory[r].JobTitle, (model.JobHistory[r].StartDT.HasValue ? model.JobHistory[r].StartDT.Value.ToShortDateString() : ""), (model.JobHistory[r].EndDT.HasValue ? model.JobHistory[r].EndDT.Value.ToShortDateString() : "") };

                        //Columns.
                        for (int c = 0; c < data.Length; c++)
                        {
                            //Cell Alignment
                            DataRow.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;

                            //Fill Data in Rows
                            Spire.Doc.Documents.Paragraph p2 = DataRow.Cells[c].AddParagraph();
                            TextRange TR2 = p2.AppendText(data[c]);

                            //Format Cells
                            p2.Format.HorizontalAlignment = HorizontalAlignment.Center;
                        }
                    }

                    //Replace text with Table
                    TextSelection selectionTable = document.FindString("{$JobHistory$}", true, true);
                    TextRange     rangeTable     = selectionTable.GetAsOneRange();
                    Spire.Doc.Documents.Paragraph paragraphTable = rangeTable.OwnerParagraph;
                    Body body  = paragraphTable.OwnerTextBody;
                    int  index = body.ChildObjects.IndexOf(paragraphTable);
                    body.ChildObjects.Remove(paragraphTable);
                    body.ChildObjects.Insert(index, table);
                }

                #endregion

                #region 套用樣式

                //套用文章段落樣式
                for (int s = 0; s < document.Sections.Count; s++)
                {
                    Spire.Doc.Section section = document.Sections[s];
                    //套用文章段落樣式
                    for (int p = 0; p < section.Paragraphs.Count; p++)
                    {
                        Spire.Doc.Documents.Paragraph pgh = section.Paragraphs[p];
                        pgh.ApplyStyle("Basic");
                        pgh.Format.BeforeSpacing = 12;
                    }

                    //套用表格樣式
                    for (int t = 0; t < document.Sections[s].Tables.Count; t++)
                    {
                        Spire.Doc.Table table = (Spire.Doc.Table)document.Sections[s].Tables[t];
                        table.PreferredWidth            = new PreferredWidth(WidthType.Percentage, 100);
                        table.TableFormat.IsAutoResized = true;

                        //set table border
                        //table.TableFormat.Borders.Right.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Left.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Top.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Bottom.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Horizontal.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Vertical.BorderType = Spire.Doc.Documents.BorderStyle.Thick;

                        for (int tr = 0; tr < table.Rows.Count; tr++)
                        {
                            for (int td = 0; td < table.Rows[tr].Cells.Count; td++)
                            {
                                for (int t_ph = 0; t_ph < table.Rows[tr].Cells[td].Paragraphs.Count; t_ph++)
                                {
                                    table.Rows[tr].Cells[td].Paragraphs[t_ph].ApplyStyle("Basic");
                                }
                            }
                        }
                    }
                }

                #endregion

                //匯出
                document.SaveToStream(ms, FileFormat.Docx);
            }
            catch (Exception ex)
            {
                result = false;
                msg    = ex.Message;
            }

            if (result)
            {
                return(ms.ToArray());
            }
            else
            {
                return(null);
            }
        }
		private TableCell BuildContactCell(Resume.Models.Resume resume, MainDocumentPart main)
		{
			var cells = (from c in resume.Contact
						 select CreateContactItem(c, main)).ToArray();

			var paragraph = new Paragraph(new ParagraphProperties(AlignParagraph(JustificationValues.Left)));

			for (int index = 0; index < cells.Length; index++)
			{
				if (index != 0)
					paragraph.Append(new Break());

				paragraph.Append(cells[index]);
			}

			return new TableCell(
				CreateCellProperties(TableWidthUnitValues.Pct, "33"),
				paragraph);
		}
Exemplo n.º 27
0
 public void UpdateResume(Resume newResume)
 {
 }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            DataTable data = GetAllMyResumes(Convert.ToInt32(User1.UserId));
            if (data.Rows.Count >= 3)
            {
                JavaScriptAleart("Bạn đã tạo tối đa 3 hồ sơ. Vui lòng kiểm tra lại");
                return;
            }
            var resumeTitle = txtResumeName.Text;
            var user = new User(User1.Email, User1.UserId);
            var certificate = new Certificate(ddlDegrees.SelectedValue, ddlDegrees.SelectedItem.Text);
            var salary = new JobSalaryLevel(ddlExpectedSalary.SelectedValue, ddlExpectedSalary.SelectedItem.Text);
            var langSkill = new LangSkill(ddlLangSkill.SelectedValue, ddlLangSkill.SelectedItem.Text, txtDescription.Text);
            var location = new Province(ddlRegions.SelectedValue, ddlRegions.SelectedItem.Text);
            var category = new JobIndustries(ddlCategories.SelectedValue, ddlCategories.SelectedItem.Text);
            //var curentPostion = new JobPosition(ddlCurrentPosition.SelectedValue, ddlCurrentPosition.SelectedItem.Text);
            var expectedPosition = new JobPosition(ddlExpectedPosition.SelectedValue,
                ddlExpectedPosition.SelectedItem.Text);
            var jobExperienceLevel = new ExperienceLevel(ddlExp.SelectedValue,
                ddlExp.SelectedItem.Text);
            var worktype = new WorkType(ddlworktype.SelectedValue, ddlworktype.SelectedItem.Text);
            var jobAchievement = ta1.Value;
            var careerGoal = ta2.Value;
            var experience = ta3.Value;
            var literacy = ta6.Value;
            var skill = ta5.Value;
            var reference = ta4.Value;
            var contactmail = txtContactMail.Text;
            var attachmentPath = "";
            if (this.fuResume.HasFile)
            {
                string imgThumb = "E:\\DOCUMENTS\\School\\ASP.NETWorkSpaces\\WebFindingJobsMVCmodel\\FileSticky\\" + this.fuResume.FileName;
                this.fuResume.SaveAs(imgThumb);
                attachmentPath = "/FileSticky/" + this.fuResume.FileName;
            }
            Resume1 = new Resume();

            var returnValue = false;
            var query = Request.QueryString["resumeId"];
            if (query != null)
            {
                returnValue = Resume1.SetFullResumeInfoUpdate(resumeTitle, certificate, salary, langSkill, location,
                    category, expectedPosition, jobExperienceLevel, worktype,
                    jobAchievement, careerGoal, experience, literacy, skill, reference, user, contactmail, query, attachmentPath);
            }
            else
            {
                returnValue = Resume1.SetFullResumeInfo(resumeTitle, certificate, salary, langSkill, location, category, expectedPosition, jobExperienceLevel, worktype,
               jobAchievement, careerGoal, experience, literacy, skill, reference, user, contactmail, attachmentPath);
            }
            if (returnValue)
            {
                JavaScriptAleart("Thực hiện thành công");
            }
            else
            {
                JavaScriptAleart("Thực hiện không thành công. Vui lòng load lại trang và thử lại");
            }
        }
        catch (Exception exception)
        {

            JavaScriptAleart(exception.Message);

        }
    }
Exemplo n.º 29
0
 protected override void TestErrors(Guid instanceId, Member member, Candidate candidate, Resume resume)
 {
 }
Exemplo n.º 30
0
 protected override void Update(Member member, Candidate candidate, Resume resume, ref bool sendSuggestedJobs, ref int?referralSourceId, bool resumeUploaded)
 {
     Assert.IsNull(referralSourceId);
     referralSourceId = NewSourceId1;
 }
Exemplo n.º 31
0
 public ActionResult CreateResume(Resume resume)
 {
     _context.Resumes.Add(resume);
     _context.SaveChanges();
     return(RedirectToAction("Resume", "Home"));
 }
Exemplo n.º 32
0
        public void DeepNullsTest([Values] bool throwOnError, [Values] bool errorOnUnknownMember)
        {
            var fromJson   = Resume.FromJson(files["deepNulls"], throwOnError, errorOnUnknownMember);
            var stringList = new List <string>()
            {
                null, null
            };

            var constructed = new Resume()
            {
                Basics = new Basics()
                {
                    Location = new Location(),
                    Profiles = new List <Profile>()
                    {
                        new Profile(), new Profile()
                    },
                },
                Work = new List <Work>()
                {
                    new Work()
                    {
                        Highlights = stringList
                    }, new Work()
                    {
                        Highlights = stringList
                    }
                },
                Volunteer = new List <Volunteer>()
                {
                    new Volunteer()
                    {
                        Highlights = stringList
                    }, new Volunteer()
                    {
                        Highlights = stringList
                    }
                },
                Education = new List <Education>()
                {
                    new Education()
                    {
                        Courses = stringList
                    }, new Education()
                    {
                        Courses = stringList
                    }
                },
                Awards = new List <Award>()
                {
                    new Award(), new Award()
                },
                Certificates = new List <Certificate>()
                {
                    new Certificate(), new Certificate()
                },
                Publications = new List <Publication>()
                {
                    new Publication(), new Publication()
                },
                Skills = new List <Skill>()
                {
                    new Skill()
                    {
                        Keywords = stringList
                    }, new Skill()
                    {
                        Keywords = stringList
                    }
                },
                Languages = new List <LanguageInfo>()
                {
                    new LanguageInfo(), new LanguageInfo()
                },
                Interests = new List <Interest>()
                {
                    new Interest()
                    {
                        Keywords = stringList
                    }, new Interest()
                    {
                        Keywords = stringList
                    }
                },
                References = new List <ReferenceInfo>()
                {
                    new ReferenceInfo(), new ReferenceInfo()
                },
                Projects = new List <Project>()
                {
                    new Project()
                    {
                        Highlights = stringList, Keywords = stringList, Roles = stringList
                    }, new Project()
                    {
                        Highlights = stringList, Keywords = stringList, Roles = stringList
                    }
                },
                Meta = new Meta()
            };

            Utils.ValidateResume(fromJson, constructed);
        }
Exemplo n.º 33
0
 protected override void TestErrors(Guid instanceId, Member member, Candidate candidate, Resume resume)
 {
     member.DateOfBirth = null;
     TestErrors(instanceId, member, candidate, resume, "The date of birth is required.");
 }
Exemplo n.º 34
0
        private XmlResource CreateUpdatedResource(Enums.ResourceType resourceType, string id,
                                                  string fieldAlias, string fieldValue)
        {
            XmlResource result = null;

            switch (resourceType)
            {
            case Enums.ResourceType.Client:
                result = new Client()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Activity:
                result = new Activity()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Sales:
                result = new Sales()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Contract:
                result = new Contract()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Process:
                result = new Process()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Job:
                result = new Job()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Recruiter:
                result = new Recruiter()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Resume:
                result = new Resume()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Candidate:
                result = new Candidate()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;
            }
            return(result);
        }
Exemplo n.º 35
0
 public void AddResume(Resume resume)
 {
     db.Resumes.Create(resume);
     db.Save();
 }
        public void OnActivate(object arg)
        {
            JausAddress targetAddress = GenerateCurrentAddress();

            if (targetAddress == null)
                return;

            Resume resume = new Resume();
            resume.SetSource(badgerControlSubsystem.LocalAddress);
            resume.SetDestination(targetAddress);

            Transport.SendMessage(resume);
        }
Exemplo n.º 37
0
 public void EditResume(Resume resume)
 {
     db.Resumes.Update(resume);
     db.Save();
 }
Exemplo n.º 38
0
        /// <summary>
        /// 透過 HTML Tag 匯出 Word 文件
        /// </summary>
        /// <param name="result">回傳: 執行結果</param>
        /// <param name="msg">回傳: 訊息</param>
        /// <returns>串流資訊</returns>
        public byte[] ExportResumeByHtml(out bool result, out string msg)
        {
            result = true;
            msg    = "";
            MemoryStream ms = new MemoryStream();

            try
            {
                Spire.Doc.Document document = new Spire.Doc.Document();

                #region 文件內容

                //建立/取得要匯出的內容
                Resume        model = new Resume();
                StringBuilder html  = new StringBuilder();
                html.Append("Name: " + model.Name + "<br />");
                html.Append("Gender: " + model.Gender + "<br />");
                html.Append("Email: " + model.Email + "<br />");
                html.Append("Address: " + model.Address + "<br />");
                html.Append("Phone: " + model.Phone + "<br />");
                html.Append("Mobile: " + model.Mobile + "<br />");
                html.Append("Description1:<br />" + HttpUtility.HtmlDecode(model.Description1) + "<br /></p>");
                html.Append("Description2:<br />" + HttpUtility.HtmlDecode(model.Description2) + "<br /></p>");

                if (model.JobHistory.Count > 0)
                {
                    int i = 1;
                    model.JobHistory = model.JobHistory.OrderBy(x => x.StartDT).ToList();
                    html.Append("<p>簡歷</p>");
                    html.Append("<table><tr><th>項目</th><th>任職</th><th>職稱</th><th>開始時間</th><th>結束時間</th></tr>");
                    foreach (var h in model.JobHistory)
                    {
                        html.Append("<tr>");
                        html.Append("<td>" + i.ToString() + "</td>");
                        html.Append("<td>" + h.CompanyName + "</td>");
                        html.Append("<td>" + h.JobTitle + "</td>");
                        html.Append("<td>" + (h.StartDT.HasValue ? h.StartDT.Value.ToShortDateString() : "") + "</td>");
                        html.Append("<td>" + (h.EndDT.HasValue ? h.EndDT.Value.ToShortDateString() : "") + "</td>");
                        html.Append("</tr>");
                        i++;
                    }
                    html.Append("</table>");
                }

                #endregion

                //將 HTML 載入至 Document
                document.LoadHTML(new StringReader(html.ToString()), XHTMLValidationType.None);

                #region 設定樣式

                //一般段落文字
                ParagraphStyle style = new ParagraphStyle(document)
                {
                    Name = "BasicStyle"
                };
                //style.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.Justify;
                style.CharacterFormat.FontName = "標楷體";
                style.CharacterFormat.FontSize = 12;
                document.Styles.Add(style);

                #endregion

                #region 套用樣式

                for (int s = 0; s < document.Sections.Count; s++)
                {
                    Spire.Doc.Section section = document.Sections[s];
                    //套用文章段落樣式
                    for (int p = 0; p < section.Paragraphs.Count; p++)
                    {
                        Spire.Doc.Documents.Paragraph pgh = section.Paragraphs[p];
                        pgh.ApplyStyle("BasicStyle");
                        pgh.Format.BeforeSpacing = 10;
                    }

                    //套用表格樣式
                    for (int t = 0; t < document.Sections[s].Tables.Count; t++)
                    {
                        Spire.Doc.Table table = (Spire.Doc.Table)document.Sections[s].Tables[t];
                        table.PreferredWidth            = new PreferredWidth(WidthType.Percentage, 100);
                        table.TableFormat.IsAutoResized = true;

                        //set table border
                        table.TableFormat.Borders.Right.BorderType      = Spire.Doc.Documents.BorderStyle.Thick;
                        table.TableFormat.Borders.Left.BorderType       = Spire.Doc.Documents.BorderStyle.Thick;
                        table.TableFormat.Borders.Top.BorderType        = Spire.Doc.Documents.BorderStyle.Thick;
                        table.TableFormat.Borders.Bottom.BorderType     = Spire.Doc.Documents.BorderStyle.Thick;
                        table.TableFormat.Borders.Horizontal.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        table.TableFormat.Borders.Vertical.BorderType   = Spire.Doc.Documents.BorderStyle.Thick;

                        for (int tr = 0; tr < table.Rows.Count; tr++)
                        {
                            for (int td = 0; td < table.Rows[tr].Cells.Count; td++)
                            {
                                for (int t_ph = 0; t_ph < table.Rows[tr].Cells[td].Paragraphs.Count; t_ph++)
                                {
                                    table.Rows[tr].Cells[td].Paragraphs[t_ph].ApplyStyle("BasicStyle");
                                }
                            }
                        }
                    }
                }

                #endregion

                //匯出
                document.SaveToStream(ms, FileFormat.Docx);
            }
            catch (Exception ex)
            {
                msg    = ex.Message;
                result = false;
            }

            if (result)
            {
                return(ms.ToArray());
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 39
0
 public void Parse(Section section, Resume resume)
 {
     resume.SummaryDescription = string.Join("; ", section.Content);
 }
Exemplo n.º 40
0
  public static void Main( string[] args )
  {
    Document[] docs = new Document[ 2 ];

    // Note: constructors call Factory Method
    docs[0] = new Resume();
    docs[1] = new Report();

    // Display document pages
    foreach( Document document in docs )
    {
      Console.WriteLine( "\n" + document + " ------- " );
      foreach( Page page in document.Pages )
        Console.WriteLine( " " + page );
    }

    Console.Read();
  }
		private void BuildHeader(Resume.Models.Resume resume, WordprocessingDocument document)
		{
			var body = document.MainDocumentPart.Document.Body;

			var table = body.AppendChild(new Table());
			table.AppendChild(HideBorders());

			var row = table.AppendChild(new TableRow());

			var cell1 = BuildContactCell(resume, document.MainDocumentPart);

			var cell2 = new TableCell(
				CreateCellProperties(TableWidthUnitValues.Pct, "33"),
				new Paragraph(
					new ParagraphProperties(AlignParagraph(JustificationValues.Center)),
					new Run(new Text(resume.Developer.Name)),
					new Break(),
					new Run(new Text(string.Format("{0}, {1}", resume.Developer.City, resume.Developer.State)))));

			var cell3 = BuildLinksCell(resume, document.MainDocumentPart);

			row.Append(cell1, cell2, cell3);
		}
Exemplo n.º 42
0
        public Resume GetResume(int id)
        {
            Resume resume = this.service.getResume(id);

            return(resume);
        }
Exemplo n.º 43
0
        public override void UpdateDatabaseAfterUpdateSchema()
        {
            base.UpdateDatabaseAfterUpdateSchema();
            UpdateAnalysisCriteriaColumn();

            // PermissionPolicyRole defaultRole = CreateDefaultRole();

            UpdateStatus("CreateContacts", "", "Creating contacts, departments and positions in the database...");
            Position developerPosition = ObjectSpace.FindObject <Position>(CriteriaOperator.Parse("Title == 'Developer'"));

            if (developerPosition == null)
            {
                developerPosition       = ObjectSpace.CreateObject <Position>();
                developerPosition.Title = "Developer";
            }
            Position managerPosition = ObjectSpace.FindObject <Position>(CriteriaOperator.Parse("Title == 'Manager'"));

            if (managerPosition == null)
            {
                managerPosition       = ObjectSpace.CreateObject <Position>();
                managerPosition.Title = "Manager";
            }

            Department devDepartment = ObjectSpace.FindObject <Department>(CriteriaOperator.Parse("Title == 'Development Department'"));

            if (devDepartment == null)
            {
                devDepartment        = ObjectSpace.CreateObject <Department>();
                devDepartment.Title  = "Development Department";
                devDepartment.Office = "205";
                devDepartment.Positions.Add(developerPosition);
                devDepartment.Positions.Add(managerPosition);
            }
            Department seoDepartment = ObjectSpace.FindObject <Department>(CriteriaOperator.Parse("Title == 'SEO'"));

            if (seoDepartment == null)
            {
                seoDepartment        = ObjectSpace.CreateObject <Department>();
                seoDepartment.Title  = "SEO";
                seoDepartment.Office = "703";
                seoDepartment.Positions.Add(developerPosition);
                seoDepartment.Positions.Add(managerPosition);
            }
            ObjectSpace.CommitChanges();

            try {
                DataTable employeesTable = GetEmployeesDataTable();
                foreach (DataRow employee in employeesTable.Rows)
                {
                    string  email   = Convert.ToString(employee["EmailAddress"]);
                    Contact contact = ObjectSpace.FindObject <Contact>(CriteriaOperator.Parse("Email=?", email));
                    if (contact == null)
                    {
                        contact           = ObjectSpace.CreateObject <Contact>();
                        contact.Email     = email;
                        contact.FirstName = Convert.ToString(employee["FirstName"]);
                        contact.LastName  = Convert.ToString(employee["LastName"]);
                        contact.BirthDate = Convert.ToDateTime(employee["BirthDate"]);
                        contact.Photo     = Convert.FromBase64String(Convert.ToString(employee["ImageData"]));
                        string titleOfCourtesyText = Convert.ToString(employee["Title"]).ToLower();
                        if (!string.IsNullOrEmpty(titleOfCourtesyText))
                        {
                            titleOfCourtesyText = titleOfCourtesyText.Replace(".", "");
                            TitleOfCourtesy titleOfCourtesy;
                            if (Enum.TryParse <TitleOfCourtesy>(titleOfCourtesyText, true, out titleOfCourtesy))
                            {
                                contact.TitleOfCourtesy = titleOfCourtesy;
                            }
                        }
                        PhoneNumber phoneNumber = ObjectSpace.CreateObject <PhoneNumber>();
                        phoneNumber.Party     = contact;
                        phoneNumber.Number    = Convert.ToString(employee["Phone"]);
                        phoneNumber.PhoneType = "Work";

                        Address address = ObjectSpace.CreateObject <Address>();
                        contact.Address1      = address;
                        address.ZipPostal     = Convert.ToString(employee["PostalCode"]);
                        address.Street        = Convert.ToString(employee["AddressLine1"]);
                        address.City          = Convert.ToString(employee["City"]);
                        address.StateProvince = Convert.ToString(employee["StateProvinceName"]);
                        string  countryName = Convert.ToString(employee["CountryRegionName"]);
                        Country country     = ObjectSpace.FindObject <Country>(CriteriaOperator.Parse("Name=?", countryName), true);
                        if (country == null)
                        {
                            country      = ObjectSpace.CreateObject <Country>();
                            country.Name = countryName;
                        }
                        address.Country = country;

                        string     departmentTitle = Convert.ToString(employee["GroupName"]);
                        Department department      = ObjectSpace.FindObject <Department>(CriteriaOperator.Parse("Title=?", departmentTitle), true);
                        if (department == null)
                        {
                            department       = ObjectSpace.CreateObject <Department>();
                            department.Title = departmentTitle;
                            Random rnd = new Random();
                            department.Office = string.Format("{0}0{0}", rnd.Next(1, 7), rnd.Next(9));
                        }
                        contact.Department = department;

                        string   positionTitle = Convert.ToString(employee["JobTitle"]);
                        Position position      = ObjectSpace.FindObject <Position>(CriteriaOperator.Parse("Title=?", positionTitle), true);
                        if (position == null)
                        {
                            position       = ObjectSpace.CreateObject <Position>();
                            position.Title = positionTitle;
                            position.Departments.Add(department);
                        }
                        contact.Position = position;
                    }
                }
                ObjectSpace.CommitChanges();
            }
            catch (Exception e) {
                Tracing.Tracer.LogText("Cannot initialize contacts, departments and positions from the XML file.");
                Tracing.Tracer.LogError(e);
            }


            Contact contactMary = ObjectSpace.FindObject <Contact>(CriteriaOperator.Parse("FirstName == 'Mary' && LastName == 'Tellitson'"));

            if (contactMary != null && LocationIsEmpty(contactMary))
            {
                if (contactMary.Location == null)
                {
                    contactMary.Location = ObjectSpace.CreateObject <Location>();
                }

                contactMary.Location.Contact   = contactMary;
                contactMary.Location.Latitude  = 40.620610;
                contactMary.Location.Longitude = -73.935242;
            }

            Contact contactJohn = ObjectSpace.FindObject <Contact>(CriteriaOperator.Parse("FirstName == 'John' && LastName == 'Nilsen'"));

            if (contactJohn != null && LocationIsEmpty(contactJohn))
            {
                if (contactJohn.Location == null)
                {
                    contactJohn.Location = ObjectSpace.CreateObject <Location>();
                }

                contactJohn.Location.Contact   = contactJohn;
                contactJohn.Location.Latitude  = 40.711510;
                contactJohn.Location.Longitude = -73.845252;
            }

            Contact contactJanete = ObjectSpace.FindObject <Contact>(CriteriaOperator.Parse("FirstName == 'Janete' && LastName == 'Limeira'"));

            if (contactJanete != null && LocationIsEmpty(contactJanete))
            {
                if (contactJanete.Location == null)
                {
                    contactJanete.Location = ObjectSpace.CreateObject <Location>();
                }

                contactJanete.Location.Contact   = contactJanete;
                contactJanete.Location.Latitude  = 40.710410;
                contactJanete.Location.Longitude = -73.963262;
            }

            Contact contactKarl = ObjectSpace.FindObject <Contact>(CriteriaOperator.Parse("FirstName == 'Karl' && LastName == 'Jablonski'"));

            if (contactKarl != null && LocationIsEmpty(contactKarl))
            {
                if (contactKarl.Manager == null)
                {
                    contactKarl.Manager = contactJanete;
                }
                if (contactKarl.Location == null)
                {
                    contactKarl.Location = ObjectSpace.CreateObject <Location>();
                }

                contactKarl.Location.Contact   = contactKarl;
                contactKarl.Location.Latitude  = 40.792613;
                contactKarl.Location.Longitude = -73.925142;
            }


            ObjectSpace.CommitChanges();


            UpdateStatus("CreatePayments", "", "Creating payments, resumes and scheduler events in the database...");
            IList <Contact> topTenContacts = ObjectSpace.GetObjects <Contact>();

            ObjectSpace.SetCollectionSorting(topTenContacts, new SortProperty[] { new SortProperty("LastName", DevExpress.Xpo.DB.SortingDirection.Ascending) });
            ObjectSpace.SetTopReturnedObjectsCount(topTenContacts, 10);
            string[] notes =
            {
                "works with customers until their problems are resolved and often goes an extra step to help upset customers be completely surprised by how far we will go to satisfy customers",
                "is very good at making team members feel included. The inclusion has improved the team's productivity dramatically",
                "is very good at sharing knowledge and information during a problem to increase the chance it will be resolved quickly",
                "actively elicits feedback from customers and works to resolve their problems",
                "creates an inclusive work environment where everyone feels they are a part of the team",
                "consistently keeps up on new trends in the industry and applies these new practices to every day work",
                "is clearly not a short term thinker - the ability to set short and long term business goals is a great asset to the company",
                "seems to want to achieve all of the goals in the last few weeks before annual performance review time, but does not consistently work towards the goals throughout the year",
                "does not yet delegate effectively and has a tendency to be overloaded with tasks which should be handed off to subordinates",
                "to be discussed with the top management..."
            };
            for (int i = 0; i < topTenContacts.Count; i++)
            {
                Contact contact = topTenContacts[i];
                Payment payment = ObjectSpace.FindObject <Payment>(CriteriaOperator.Parse("Contact=?", contact));
                if (payment == null)
                {
                    payment         = ObjectSpace.CreateObject <Payment>();
                    payment.Contact = contact;
                    payment.Hours   = new Random().Next(10, 40);
                    payment.Rate    = new Random().Next(30, 50) + new Random().Next(5, 20);
                }
                Resume resume = ObjectSpace.FindObject <Resume>(CriteriaOperator.Parse("Contact=?", contact));
                if (resume == null)
                {
                    resume = ObjectSpace.CreateObject <Resume>();
                    FileData file = ObjectSpace.CreateObject <FileData>();
                    try {
                        file.LoadFromStream(string.Format("{0}_Photo.png", contact.FullName), new MemoryStream(contact.Photo));
                    }
                    catch (Exception e) {
                        Tracing.Tracer.LogText("Cannot initialize FileData for the contact {0}.", contact.FullName);
                        Tracing.Tracer.LogError(e);
                    }
                    resume.File    = file;
                    resume.Contact = contact;
                }
                Contact reviewerContact = i < 5 ? contactMary : contactJanete;
                Note    note            = ObjectSpace.FindObject <Note>(CriteriaOperator.Parse("Contains(Text, ?)", contact.FullName));
                if (note == null)
                {
                    note          = ObjectSpace.CreateObject <Note>();
                    note.Author   = reviewerContact.FullName;
                    note.Text     = string.Format("<span style='color:#000000;font-family:Tahoma;font-size:8pt;'><b>{0}</b> \r\n{1}</span>", contact.FullName, notes[i]);
                    note.DateTime = DateTime.Now.AddDays(i * (-1));
                }
#if !EASYTEST
                Event appointment = ObjectSpace.FindObject <Event>(CriteriaOperator.Parse("Contains(Subject, ?)", contact.FullName));
                if (appointment == null)
                {
                    appointment             = ObjectSpace.CreateObject <Event>();
                    appointment.Subject     = string.Format("{0} - performance review", contact.FullName);
                    appointment.Description = string.Format("{0} \r\n{1}", contact.FullName, notes[i]);
                    appointment.StartOn     = note.DateTime.AddDays(5).AddHours(12);
                    appointment.EndOn       = appointment.StartOn.AddHours(2);
                    appointment.Location    = "101";
                    appointment.AllDay      = false;
                    appointment.Status      = 0;
                    appointment.Label       = i % 2 == 0 ? 2 : 5;
                    Resource reviewerContactResource = ObjectSpace.FindObject <Resource>(CriteriaOperator.Parse("Contains(Caption, ?)", reviewerContact.FullName));
                    if (reviewerContactResource == null)
                    {
                        reviewerContactResource         = ObjectSpace.CreateObject <Resource>();
                        reviewerContactResource.Caption = reviewerContact.FullName;
                        reviewerContactResource.Color   = reviewerContact == contactMary ? Color.AliceBlue : Color.LightCoral;
                    }
                    appointment.Resources.Add(reviewerContactResource);
                }
#endif
            }

            ObjectSpace.CommitChanges();

            UpdateStatus("CreateTasks", "", "Creating demo tasks in the database...");

#if EASYTEST
            if (ObjectSpace.FindObject <DemoTask>(CriteriaOperator.Parse("Subject == 'Review reports'")) == null)
            {
                DemoTask task = ObjectSpace.CreateObject <DemoTask>();
                task.Subject            = "Review reports";
                task.AssignedTo         = contactJohn;
                task.StartDate          = DateTime.Parse("May 03, 2008");
                task.DueDate            = DateTime.Parse("September 06, 2008");
                task.Status             = DevExpress.Persistent.Base.General.TaskStatus.InProgress;
                task.Priority           = Priority.High;
                task.EstimatedWorkHours = 60;
                task.Description        = "Analyse the reports and assign new tasks to employees.";
            }

            if (ObjectSpace.FindObject <DemoTask>(CriteriaOperator.Parse("Subject == 'Fix breakfast'")) == null)
            {
                DemoTask task = ObjectSpace.CreateObject <DemoTask>();
                task.Subject            = "Fix breakfast";
                task.AssignedTo         = contactMary;
                task.StartDate          = DateTime.Parse("May 03, 2008");
                task.DueDate            = DateTime.Parse("May 04, 2008");
                task.Status             = DevExpress.Persistent.Base.General.TaskStatus.Completed;
                task.Priority           = Priority.Low;
                task.EstimatedWorkHours = 1;
                task.ActualWorkHours    = 3;
                task.Description        = "The Development Department - by 9 a.m.\r\nThe R&QA Department - by 10 a.m.";
            }
            if (ObjectSpace.FindObject <DemoTask>(CriteriaOperator.Parse("Subject == 'Task1'")) == null)
            {
                DemoTask task = ObjectSpace.CreateObject <DemoTask>();
                task.Subject            = "Task1";
                task.AssignedTo         = contactJohn;
                task.StartDate          = DateTime.Parse("June 03, 2008");
                task.DueDate            = DateTime.Parse("June 06, 2008");
                task.Status             = DevExpress.Persistent.Base.General.TaskStatus.Completed;
                task.Priority           = Priority.High;
                task.EstimatedWorkHours = 10;
                task.ActualWorkHours    = 15;
                task.Description        = "A task designed specially to demonstrate the PivotChart module. Switch to the Reports navigation group to view the generated analysis.";
            }
            if (ObjectSpace.FindObject <DemoTask>(CriteriaOperator.Parse("Subject == 'Task2'")) == null)
            {
                DemoTask task = ObjectSpace.CreateObject <DemoTask>();
                task.Subject            = "Task2";
                task.AssignedTo         = contactJohn;
                task.StartDate          = DateTime.Parse("July 03, 2008");
                task.DueDate            = DateTime.Parse("July 06, 2008");
                task.Status             = DevExpress.Persistent.Base.General.TaskStatus.Completed;
                task.Priority           = Priority.Low;
                task.EstimatedWorkHours = 8;
                task.ActualWorkHours    = 16;
                task.Description        = "A task designed specially to demonstrate the PivotChart module. Switch to the Reports navigation group to view the generated analysis.";
            }
#endif
#if !EASYTEST
            IList <DemoTask> taskList = GenerateTask(new Contact[] { contactMary, contactJohn, contactJanete, contactKarl });
            if (taskList.Count > 0)
            {
                IList <Contact> contacts     = ObjectSpace.GetObjects <Contact>();
                Random          rndGenerator = new Random();
                foreach (Contact contact in contacts)
                {
                    if (taskList.Count == 1)
                    {
                        contact.Tasks.Add(taskList[0]);
                    }
                    else if (taskList.Count == 2)
                    {
                        contact.Tasks.Add(taskList[0]);
                        contact.Tasks.Add(taskList[1]);
                    }
                    else
                    {
                        int index = rndGenerator.Next(1, taskList.Count - 2);
                        contact.Tasks.Add(taskList[index]);
                        contact.Tasks.Add(taskList[index - 1]);
                        contact.Tasks.Add(taskList[index + 1]);
                    }
                }
            }
#endif
            UpdateStatus("CreateAnalysis", "", "Creating analysis reports in the database...");
            CreateDataToBeAnalysed();
            UpdateStatus("CreateSecurityData", "", "Creating users and roles in the database...");
            #region Create a User for the Simple Security Strategy
            //// If a simple user named 'Sam' doesn't exist in the database, create this simple user
            //SecuritySimpleUser adminUser = ObjectSpace.FindObject<SecuritySimpleUser>(new BinaryOperator("UserName", "Sam"));
            //if(adminUser == null) {
            //    adminUser = ObjectSpace.CreateObject<SecuritySimpleUser>();
            //    adminUser.UserName = "******";
            //}
            //// Make the user an administrator
            //adminUser.IsAdministrator = true;
            //// Set a password if the standard authentication type is used
            //adminUser.SetPassword("");
            #endregion

            #region Create Users for the Complex Security Strategy
            PermissionPolicyUser user0 = ObjectSpace.FindObject <PermissionPolicyUser>(new BinaryOperator("UserName", "Jajcuś"));
            if (user0 == null)
            {
                user0          = ObjectSpace.CreateObject <PermissionPolicyUser>();
                user0.UserName = "******";
                // Set a password if the standard authentication type is used
                user0.SetPassword("");
            }
            // If a user named 'Sam' doesn't exist in the database, create this user
            PermissionPolicyUser user1 = ObjectSpace.FindObject <PermissionPolicyUser>(new BinaryOperator("UserName", "Sam"));
            if (user1 == null)
            {
                user1          = ObjectSpace.CreateObject <PermissionPolicyUser>();
                user1.UserName = "******";
                // Set a password if the standard authentication type is used
                user1.SetPassword("");
            }
            // If a user named 'John' doesn't exist in the database, create this user
            PermissionPolicyUser user2 = ObjectSpace.FindObject <PermissionPolicyUser>(new BinaryOperator("UserName", "John"));
            if (user2 == null)
            {
                user2          = ObjectSpace.CreateObject <PermissionPolicyUser>();
                user2.UserName = "******";
                // Set a password if the standard authentication type is used
                user2.SetPassword("");
            }
            // If a role with the Administrators name doesn't exist in the database, create this role
            PermissionPolicyRole adminRole = ObjectSpace.FindObject <PermissionPolicyRole>(new BinaryOperator("Name", "Administrators"));
            if (adminRole == null)
            {
                adminRole      = ObjectSpace.CreateObject <PermissionPolicyRole>();
                adminRole.Name = "Administrators";
            }
            adminRole.IsAdministrative = true;

            // If a role with the Users name doesn't exist in the database, create this role
            PermissionPolicyRole userRole = ObjectSpace.FindObject <PermissionPolicyRole>(new BinaryOperator("Name", "Users"));
            if (userRole == null)
            {
                userRole                  = ObjectSpace.CreateObject <PermissionPolicyRole>();
                userRole.Name             = "Users";
                userRole.PermissionPolicy = SecurityPermissionPolicy.AllowAllByDefault;
                userRole.AddNavigationPermission("Application/NavigationItems/Items/Default/Items/PermissionPolicyRole_ListView", SecurityPermissionState.Deny);
                userRole.AddNavigationPermission("Application/NavigationItems/Items/Default/Items/PermissionPolicyUser_ListView", SecurityPermissionState.Deny);
                userRole.AddTypePermission <PermissionPolicyRole>(SecurityOperations.FullAccess, SecurityPermissionState.Deny);
                userRole.AddTypePermission <PermissionPolicyUser>(SecurityOperations.FullAccess, SecurityPermissionState.Deny);
                userRole.AddObjectPermission <PermissionPolicyUser>(SecurityOperations.ReadOnlyAccess, "[Oid] = CurrentUserId()", SecurityPermissionState.Allow);
                userRole.AddMemberPermission <PermissionPolicyUser>(SecurityOperations.Write, "ChangePasswordOnFirstLogon", null, SecurityPermissionState.Allow);
                userRole.AddMemberPermission <PermissionPolicyUser>(SecurityOperations.Write, "StoredPassword", null, SecurityPermissionState.Allow);
                userRole.AddTypePermission <PermissionPolicyRole>(SecurityOperations.Read, SecurityPermissionState.Allow);
                userRole.AddTypePermission <PermissionPolicyTypePermissionObject>("Write;Delete;Create", SecurityPermissionState.Deny);
                userRole.AddTypePermission <PermissionPolicyMemberPermissionsObject>("Write;Delete;Create", SecurityPermissionState.Deny);
                userRole.AddTypePermission <PermissionPolicyObjectPermissionsObject>("Write;Delete;Create", SecurityPermissionState.Deny);
            }

            // Add the Administrators role to the user1

            user1.Roles.Add(adminRole);
            // Add the Users role to the user2
            user2.Roles.Add(userRole);
            user0.Roles.Add(userRole);
            #endregion

            ObjectSpace.CommitChanges();
        }
Exemplo n.º 44
0
 public ActionResult UpdateList(string models)
 {
     List<sd_resume> list = new List<sd_resume>();
     if (models != null)
     {
         list = JsonConvert.DeserializeObject<List<sd_resume>>(models);
         foreach (var item in list)
         {
             var t = new Resume().Update(item);
         }
     }
     return Json(list);
 }
 private decimal ScoreYearsExperience(Resume resume)
 {
     return(resume.Jobs.Sum(j => CalculateMonthsInJob(j) * 0.15m));
 }
    private void LoadResumeHaveBeenCreated(string resumeid)
    {
        var resume = new Resume(resumeid);
        resume.SetFullResumeInfo();
        BindDropDownList(ddlRegions, GetAllProvine(), "ProvinceName", "ProvinceID");
        ddlRegions.SelectedValue = resume.Province.Id;

        BindDropDownList(ddlExpectedSalary, GetAllSalaryLevel(), "SalaryLevel", "SalaryLevelID");
        ddlExpectedSalary.SelectedValue = resume.JobSalaryLevel.JobSalaryLevelId;

        BindDropDownList(ddlExpectedPosition, GetAllJobPosition(), "JobPositionName", "JobPositionID");
        ddlExpectedPosition.SelectedValue = resume.JobPosition.JobPositionId;

        BindDropDownList(ddlCategories, GetAllJobs(), "JobIndustryName", "JobIndustryID");
        ddlCategories.SelectedValue = resume.JobIndustries.JobIndutriesId;

        BindDropDownList(ddlDegrees, GetAllCertificates(), "CertificateName", "CertificateID");
        ddlDegrees.SelectedValue = resume.Certificate.CertificateId;

        BindDropDownList(ddlExp, GetAllExperienceLevel(), "ExperienceLevelName", "ExperienceLevelID");
        ddlExp.SelectedValue = resume.ExperienceLevel.ExperianceLevelId;

        BindDropDownList(ddlworktype, GetAllWorkTypes(), "WorkTypeName", "WorkTypeID");
        ddlworktype.SelectedValue = resume.WorkType.WorkTypeId;

        BindDropDownList(ddlLangSkill, GetAllLanguageSkill(), "SkillName", "SkillID");
        ddlLangSkill.SelectedValue = resume.LangSkill.SillId;
        txtDescription.Text = resume.LangSkill.Description;
        ta1.Value = resume.Achievement;
        ta2.Value = resume.CareerGoal;
        ta3.Value = resume.WorkExperience;
        ta6.Value = resume.Literacy;
        ta5.Value = resume.Skill;
        ta4.Value = resume.Reference;
        txtContactMail.Text = resume.ContactEmail;
        txtResumeName.Text = resume.ResumeName;
        LinkCv = resume.Atachment;
    }
Exemplo n.º 47
0
 public void CreateResume(Resume resume)
 {
     resume.DateCreated = DateTime.UtcNow;
     _dbContext.Resumes.Add(resume);
 }
Exemplo n.º 48
0
 /// <summary>
 /// Initializes the buttons.
 /// </summary>
 private void InitializeButtons()
 {
     newGame = new NewGame();
     activeComponents.AddFirst(newGame);
     highScore = new HighScoreButton();
     activeComponents.AddAfter(activeComponents.Find(newGame), highScore);
     quit = new Quit();
     activeComponents.AddLast(quit);
     resume = new Resume();
     upgrade = new UpgradeButton();
     menuButtonKlein = new MenuButtonKlein();
     resumeKlein = new ResumeKlein();
     mainMenu = new MainMenu();
     yesButton = new YesButton();
     noButton = new NoButton();
     upgradeEcoWall = new UpgradeEcoWall();
     upgradeEcoHelp = new UpgradeEcoHelp();
     upgradeOilWall = new UpgradeOilWall();
     upgradeOilHelp = new UpgradeOilHelp();
     upgradeWeaponMagnum = new UpgradeWeaponMagnum();
     upgradeWeaponRifle = new UpgradeWeaponRifle();
     upgradeWeaponShotgun = new UpgradeWeaponShotgun();
     submitHighscore = new SubmitHighscore();
     upgradeButtonIG = new UpgradeButtonInGame();
 }
Exemplo n.º 49
0
 public VolunteersController(ILogger <VolunteersController> logger,
                             Resume resume)
 {
     _logger = logger;
     _resume = resume;
 }
		private TableCell BuildLinksCell(Resume.Models.Resume resume, MainDocumentPart main)
		{
			var parts = (from l in resume.Links
						 select CreateHyperlink(l.Title, l.Href, main)).ToArray();

			var paragraph = new Paragraph(new ParagraphProperties(AlignParagraph(JustificationValues.Right)));

			for (int index = 0; index < parts.Length; index++)
			{
				if (index != 0)
					paragraph.Append(new Break());

				paragraph.Append(parts[index]);
			}

			return new TableCell(
				CreateCellProperties(TableWidthUnitValues.Pct, "33"),
				paragraph);
		}
Exemplo n.º 51
0
        public void UnknownMembersTest([Values] bool throwOnError, [Values] bool errorOnUnknownMember)
        {
            Resume fromJson;

            try
            {
                fromJson = Resume.FromJson(files["unknownMembers"], throwOnError, errorOnUnknownMember);
            }
            catch (JsonSerializationException)
            {
                Assert.IsTrue(errorOnUnknownMember, "ErrorOnUnknownMember = false, but JsonSerializationException thrown");
                Assert.IsTrue(throwOnError, "ThrowOnError = false, but JsonSerializationException thrown");
                return;
            }

            var constructed = new Resume()
            {
                Schema = new Uri("https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json"),
                Basics = new Basics()
                {
                    Location = new Location(),
                    Profiles = new List <Profile>()
                    {
                        new Profile()
                    }
                },
                Work = new List <Work>()
                {
                    new Work()
                },
                Volunteer = new List <Volunteer>()
                {
                    new Volunteer()
                },
                Education = new List <Education>()
                {
                    new Education()
                },
                Awards = new List <Award>()
                {
                    new Award()
                },
                Certificates = new List <Certificate>()
                {
                    new Certificate()
                },
                Publications = new List <Publication>()
                {
                    new Publication()
                },
                Skills = new List <Skill>()
                {
                    new Skill()
                },
                Languages = new List <LanguageInfo>()
                {
                    new LanguageInfo()
                },
                Interests = new List <Interest>()
                {
                    new Interest()
                },
                References = new List <ReferenceInfo>()
                {
                    new ReferenceInfo()
                },
                Projects = new List <Project>()
                {
                    new Project()
                },
                Meta = new Meta()
            };

            Utils.ValidateResume(fromJson, constructed, errorOnUnknownMember ? 15 : 0);
        }
Exemplo n.º 52
0
 public ResumeDTO(Resume resume)
 {
 }
Exemplo n.º 53
0
        public Resume Get(int id)
        {
            Resume resume = db.Resume.FirstOrDefault(x => x.Id == id);

            return(resume);
        }