private void LoadData_FromDB()
        {
            Data.DsManagingDocumentsTableAdapters.QueriesTableAdapter qta1 =
                new Data.DsManagingDocumentsTableAdapters.QueriesTableAdapter();

            int?SelID = -1;

            qta1.Sp_Prepare_Sel_Documents(
                //ref SelID, -1, 99999, "%", "%", -100, 100);
                //ref SelID, -1, 99999, "%Image%", "%", -100, 100);
                //ref SelID, -1, 99999, "%", @"%E:\HthmWork\Papers%", -100, 100);
                ref SelID,

                0,
                //99999,
                150,

                string.Format("%{0}%",
                              txtDocFileName.Text),

                string.Format("%{0}%",
                              txtDocFolderPath.Text),

                -100,
                100);


            dsViewingDocs.DocumentComments.Clear();

            dsViewingDocs.Vw_SimpleDocumentsView.Clear();

            dsViewingDocs.ImportanceDegrees.Clear();


            m_adpt_ImportanceDegrees.Fill(
                dsViewingDocs.ImportanceDegrees);

            m_adpt_Vw_SimpleDocumentsView.Fill(
                dsViewingDocs.Vw_SimpleDocumentsView, SelID.Value);

            m_adpt_DocumentComments.Fill(
                dsViewingDocs.DocumentComments, SelID.Value);


            //dsViewingDocs.AcceptChanges();

            BindData_ToUI();
        }
Ejemplo n.º 2
0
        private void LoadData_FromDB()
        {
            Data.DsManagingDocumentsTableAdapters.QueriesTableAdapter qta1 =
                new Data.DsManagingDocumentsTableAdapters.QueriesTableAdapter();

            Document_DB_Selector dds1 = new Document_DB_Selector();

            string sTmp;

            sTmp = txtDocNum.Text.Trim();
            if (!string.IsNullOrEmpty(sTmp))
            {
                dds1.AddCondition(
                    string.Format(
                        " CoreFiles.CoreFile_ID = {0} ", sTmp));
            }


            sTmp = txtDocTitle.Text.Trim();
            if (!string.IsNullOrEmpty(sTmp))
            {
                dds1.AddCondition(
                    string.Format(
                        " Documents.Title LIKE '%{0}%' ", sTmp));
            }

            sTmp = txtDocFolderPath.Text.Trim();
            if (!string.IsNullOrEmpty(sTmp))
            {
                dds1.AddCondition(
                    string.Format(
                        " FileAdding_Folders.FullName LIKE '%{0}%' ", sTmp));
            }

            sTmp = txtDocFileName.Text.Trim();
            if (!string.IsNullOrEmpty(sTmp))
            {
                dds1.AddCondition(
                    string.Format(
                        " FileAdding_CompleteFiles.Name LIKE '%{0}%' ", sTmp));
            }

            sTmp = txtNofPages1.Text.Trim();
            if (!string.IsNullOrEmpty(sTmp))
            {
                dds1.AddCondition(
                    string.Format(
                        " Documents.NofPages >= {0} ", sTmp));
            }

            sTmp = txtNofPages2.Text.Trim();
            if (!string.IsNullOrEmpty(sTmp))
            {
                dds1.AddCondition(
                    string.Format(
                        " Documents.NofPages <= {0} ", sTmp));
            }


            if (chkIncludeNotCorrupted.IsChecked.Value &&
                !chkIncludeCorrupted.IsChecked.Value)
            {
                dds1.AddCondition(
                    string.Format(
                        " Documents.IsCorrupted = 0 "));
            }
            else if (!chkIncludeNotCorrupted.IsChecked.Value &&
                     chkIncludeCorrupted.IsChecked.Value)
            {
                dds1.AddCondition(
                    string.Format(
                        " Documents.IsCorrupted = 1 "));
            }
            //else if (chkIncludeNotCorrupted.IsChecked.Value &&
            //chkIncludeCorrupted.IsChecked.Value)
            {
            }



            if (chkIncludeNotMissing.IsChecked.Value &&
                !chkIncludeMissing.IsChecked.Value)
            {
                dds1.AddCondition(
                    string.Format(
                        " CoreFiles.IsMissing = 0 "));
            }
            else if (!chkIncludeNotMissing.IsChecked.Value &&
                     chkIncludeMissing.IsChecked.Value)
            {
                dds1.AddCondition(
                    string.Format(
                        " CoreFiles.IsMissing = 1 "));
            }



            dds1.Proceed();

            //int? SelID = -1;
            int?SelID = 1;

            //qta1.Sp_Prepare_Sel_Documents(
            //    //ref SelID, -1, 99999, "%", "%", -100, 100);
            //    //ref SelID, -1, 99999, "%Image%", "%", -100, 100);
            //    //ref SelID, -1, 99999, "%", @"%E:\HthmWork\Papers%", -100, 100);
            //    ref SelID,

            //    0,
            //    //99999,
            //    150,

            //    string.Format( "%{0}%",
            //        txtDocFileName.Text ),

            //    string.Format( "%{0}%",
            //        txtDocFolderPath.Text ),

            //    -100,
            //    100);


            dsViewingDocs.DocumentComments.Clear();

            dsViewingDocs.Vw_SimpleDocumentsView.Clear();

            dsViewingDocs.ImportanceDegrees.Clear();


            m_adpt_ImportanceDegrees.Fill(
                dsViewingDocs.ImportanceDegrees);

            m_adpt_Vw_SimpleDocumentsView.Fill(
                dsViewingDocs.Vw_SimpleDocumentsView, SelID.Value);

            m_adpt_DocumentComments.Fill(
                dsViewingDocs.DocumentComments, SelID.Value);


            //dsViewingDocs.AcceptChanges();

            BindData_ToUI();
        }