Beispiel #1
0
        public byte[] Search(string filter, bool includeXrefs)
        {
            DataSet ds = new docDB();// this.DAL.ExecuteDataset("DocumentSearch", filter, includeXrefs);

            ds.RemotingFormat = SerializationFormat.Binary;
            //ds.Tables[0].RemotingFormat = this.DAL.RemotingFormat ;
            //appDB.EFileSearchDataTable dt = new appDB.EFileSearchDataTable();
            //dt.Merge(ds.Tables[0]);
            //dt.RemotingFormat = this.RemotingFormat;

            sqlSelect.CommandTimeout = 60;

            this.sqlDa.SelectCommand = sqlSelect;
            this.sqlSelect.Parameters.Clear();
            this.sqlSelect.CommandText = "[DocumentSearch]";
            this.sqlSelect.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(10)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
            this.sqlSelect.Parameters.Add(new System.Data.SqlClient.SqlParameter("@where", System.Data.SqlDbType.NVarChar, 500)); //, System.Data.ParameterDirection.Input, false, ((System.Byte)(10)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
            this.sqlSelect.Parameters["@where"].Value = filter;
            this.sqlSelect.Parameters.Add(new System.Data.SqlClient.SqlParameter("@includeXrefs", System.Data.SqlDbType.Bit, 1)); //, System.Data.ParameterDirection.Input, false, ((System.Byte)(10)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
            this.sqlSelect.Parameters["@includeXrefs"].Value = includeXrefs;

            //DataTable dt = new DataTable();
            Fill(ds);

            //ds.Tables[0].TableName = "Document";
            //ds.Tables[1].TableName = "Recipient";

            sqlSelect.CommandTimeout = 30;

            return(atriumDALManager.CompressData(ds));
        }
Beispiel #2
0
        private void autoSaveBindingSource_CurrentChanged(object sender, EventArgs e)
        {
            try
            {
                if (CurrentRow() != null)
                {
                    ACEState aces = ACEStateDictionnary[CurrentRow().ActivityId];
                    atriumDB dsA  = new atriumDB();
                    dsA.Merge(ACEState.GetDSFromACE(aces, myFM.GetBEMngrForTable("EFile").MyDS.DataSetName));

                    docDB dsD = new docDB();
                    dsD.Merge(ACEState.GetDSFromACE(aces, myFM.GetBEMngrForTable("Document").MyDS.DataSetName));
                    SetRowChangeUI(false);

                    if (dsA.Activity.FindByActivityId(aces.ActivityId).IsDocIdNull())
                    {
                        ucDocView1.NoAssociatedDocument(LawMate.Properties.Resources.NoDocument);
                        //ucDoc1.NoAssociatedDocument(LawMate.Properties.Resources.NoDocument);
                    }
                    else
                    {
                        myFM.GetDocMng().isMerging = true;
                        myFM.GetDocMng().DB.Merge(dsD);
                        myFM.GetDocMng().isMerging = false;
                        docDB.DocumentRow dr       = myFM.GetDocMng().DB.Document.FindByDocId(dsA.Activity.FindByActivityId(aces.ActivityId).DocId);

                        DataView dvDoc = new DataView(dr.Table, "DocId=" + dr.DocId.ToString(), "", DataViewRowState.CurrentRows);

                        //ucDoc1.Datasource = dvDoc;
                        //ucDoc1.PreviewAsync();

                        ucDocView1.Datasource = dvDoc;
                        ucDocView1.PreviewAsync();

                        if (CurrentRow().RowError.Length > 0)
                        {
                            pnlCannotResume.DockStyle = Janus.Windows.UI.Dock.PanelDockStyle.Top;
                            pnlCannotResume.Closed    = false;
                            cmdResume.Enabled         = Janus.Windows.UI.InheritableBoolean.False;
                            pnlAutoSave.DockStyle     = Janus.Windows.UI.Dock.PanelDockStyle.Top;
                            label1.Text = CurrentRow().RowError;
                        }
                        else
                        {
                            pnlCannotResume.Closed    = true;
                            pnlCannotResume.DockStyle = Janus.Windows.UI.Dock.PanelDockStyle.Fill;
                            label1.Text = "";
                        }
                    }
                }
                else
                {
                    SetRowChangeUI(true);
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }
Beispiel #3
0
        private void Init(FileManager fm)
        {
            //cc = fm.cc;
            // myDALClient = fm.AtMng.myDALClient;
            base.DAL    = fm.DALMngr;
            myFM        = fm;
            RuleHandler = fm.RuleHandler;
            myatMng     = fm.AtMng;
            //myUser = myatMng.myUser;

            MyDS = new docDB();
            //GetObjectBE(fm.DALMngr.GetFileFormat(), DB.FileFormat).Load();
            DB.FileFormat.Merge(myatMng.CodeDB.FileFormat);

            DB.EnforceConstraints = false;
        }
Beispiel #4
0
        private bool DocumentIsLatest(ACEState aceState, appDB.AutoSaveRow autoSaveRow)
        {
            atriumDB dsA = new atriumDB();

            dsA.Merge(ACEState.GetDSFromACE(aceState, myFM.GetBEMngrForTable("EFile").MyDS.DataSetName));
            docDB dsD = new docDB();

            dsD.Merge(ACEState.GetDSFromACE(aceState, myFM.GetBEMngrForTable("Document").MyDS.DataSetName));
            int docid = dsA.Activity.FindByActivityId(aceState.ActivityId).DocId;

            if (!myFM.GetDocMng().GetDocContent().IsLatest(dsD.DocContent.FindByDocId(docid)))
            {
                autoSaveRow.RowError = LawMate.Properties.Resources.DocumentPartOfSuspendedActivityHasBeenModified;
                return(false);
            }
            return(true);
        }