private void exportToExcelItem_Click(object sender, RoutedEventArgs e)
        {
            DataTable dt = GlobalFunctions.ToDataTable <Candidate>((ObservableCollection <Candidate>)MainView.ItemsSource);

            GlobalFunctions.ExportToExcel(dt);
        }
        private void searchButton_Click(object sender, RoutedEventArgs e)
        {
            string area = "|";

            foreach (Area item in AreaCombo.Items)
            {
                if (item.IsChecked)
                {
                    area += item.Id + "|";
                }
            }
            if (area == "|")
            {
                area = null;
            }


            string status = "|";

            foreach (Status item in StatusCombo.Items)
            {
                if (item.IsChecked)
                {
                    status += item.ID + "|";
                }
            }
            if (status == "|")
            {
                status = null;
            }



            string group = "|";

            foreach (Group item in GroupList.Items)
            {
                if (item.IsChecked)
                {
                    group += item.id + "|";
                }
            }
            if (group == "|")
            {
                group = null;
            }

            string project = "|";

            foreach (Project item in ProjectList.Items)
            {
                if (item.IsChecked)
                {
                    project += item.ID + "|";
                }
            }
            if (project == "|")
            {
                project = null;
            }

            string lastName  = LastNametxt.Text;
            string firstName = FirstNametxt.Text;
            string position  = Positiontxt.Text;

            bool?CvReceived = null;

            if (CVrEceivedYes.IsChecked == true)
            {
                CvReceived = true;
            }
            else if (CVrEceivedNo.IsChecked == true)
            {
                CvReceived = false;
            }

            bool?CvUploaded = null;

            if (CvUploadedYes.IsChecked == true)
            {
                CvUploaded = true;
            }
            else if (CvUploadedNo.IsChecked == true)
            {
                CvUploaded = false;
            }

            CandidatesDT = GlobalFunctions.GetTableFromServerArgs("SEARCH_CANDIDATE", "@FIRST_NAME" + "-" + firstName, "@LAST_NAME" + "-" + lastName,
                                                                  "@POSITION" + "-" + position, "@PROJECT" + "-" + project, "@AREA" + "-" + area, "@GROUP" + "-" + group, "@STATUS" + "-" + status
                                                                  , "@CVRECEIVED" + "-" + CvReceived, "@CV_UPLOADED" + "-" + CvUploaded);

            CandidatesCollection = Candidate.CreateCandidatesCollection(CandidatesDT);

            MainView.ItemsSource = CandidatesCollection;
        }