예제 #1
0
        public void SaveResumeInResumes(Resume.Resume cv)
        {
            var temp = FindResume(cv.Name);

            if (temp != null)
            {
                Resumes.Remove(temp);
                Resumes.Insert(0, cv);
            }
            else
            {
                Resumes.Insert(0, cv);
            }
        }
예제 #2
0
        public async Task <HttpResponseMessage> CreateAccount([FromBody] Person person)
        {
            if (person == null)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
            BsonDocument document = new BsonDocument();
            Resumes      resumes  = new Resumes();

            if (await resumes.accountExist(person.Account))
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
            document["Account"]  = person.Account;
            document["Name"]     = person.Name;
            document["Email"]    = person.Email;
            document["Password"] = person.Password;
            ObjectId Id = await resumes.Insert(document);

            return(Request.CreateResponse(HttpStatusCode.Created, Id));
        }
예제 #3
0
        private async void Open_Import(object sender, RoutedEventArgs e)
        {
            FileOpenPicker openPicker = new FileOpenPicker()
            {
                ViewMode = PickerViewMode.Thumbnail,
                SuggestedStartLocation = PickerLocationId.DocumentsLibrary
            };

            openPicker.FileTypeFilter.Add(".cv");
            var ImportCV = await openPicker.PickSingleFileAsync();

            if (ImportCV != null)
            {
                StorageFolder folder = await FileManagement.GetLocalResumeFolder();

                await ImportCV.CopyAsync(folder, ImportCV.Name, NameCollisionOption.ReplaceExisting);

                var cv = await FileManagement.Read_file(Path.GetFileNameWithoutExtension(ImportCV.Name), folder);

                bool exist = false;
                foreach (Resume.Resume r in Resumes)
                {
                    if (r.Name == cv.Name)
                    {
                        Resumes.Remove(r);
                        Resumes.Insert(0, cv);
                        exist = true;
                        break;
                    }
                }
                if (!exist)
                {
                    Resumes.Add(cv);
                }
            }
            Window.Current.Content = new StartPage();
        }