public docDB.DocXRefDataTable Load() { this.sqlDa.SelectCommand = sqlSelectAll; docDB.DocXRefDataTable dt = new docDB.DocXRefDataTable(); Fill(dt); return(dt); }
internal DocXRefBE(DocManager pBEMng) : base(pBEMng, pBEMng.DB.DocXRef) { myA = pBEMng; myDocXRefDT = (docDB.DocXRefDataTable)myDT; if (!myA.AtMng.AppMan.UseService && myODAL == null) { myODAL = myA.AtMng.DALMngr.GetDocXRef(); } }
public docDB.DocXRefDataTable LoadByFileId(int FileId) { this.sqlDa.SelectCommand = sqlSelect; this.sqlSelect.Parameters.Clear(); this.sqlSelect.CommandText = "[DocXRefSelectByFileId]"; 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("@FileId", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(10)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); this.sqlSelect.Parameters["@FileId"].Value = FileId; docDB.DocXRefDataTable dt = new docDB.DocXRefDataTable(); Fill(dt); return(dt); }
public void SetShortcutsXrefs() { bool hasControls = false; if (Atmng != null && fmCurrent != null) { appDB.EFileSearchDataTable dt = Atmng.FileSearchByParentFileId(fmCurrent.CurrentFileId); docDB.DocXRefDataTable dtDocShortcuts = Atmng.DocShortcuts(fmCurrent.CurrentFileId); int x = 1; string thisParent; if (fmCurrent.CurrentFile.FullFileNumber.LastIndexOf("-") < 0) { thisParent = fmCurrent.CurrentFile.FullFileNumber; } else { thisParent = fmCurrent.CurrentFile.FullFileNumber.Substring(0, fmCurrent.CurrentFile.FullFileNumber.LastIndexOf("-")); }; while (pnlXRefsContainer.Controls.Count > 1) { pnlXRefsContainer.Controls.RemoveAt(0); //pnlXRefsContainer.Controls.Count - 1 } Label lblDocShortcut = CreateXrefGroupLabel(LawMate.Properties.Resources.DocumentShortcuts, x); x++; int count = 0; foreach (docDB.DocXRefRow docxref in dtDocShortcuts) { CreateShortcutXRefButton(docxref, x); x++; count++; } lblDocShortcut.Text += " (" + count + ")"; if (count > 0) { hasControls = true; } Label lblShortcut = CreateXrefGroupLabel(LawMate.Properties.Resources.FileShortcuts, x); x++; count = 0; foreach (appDB.EFileSearchRow efr in dt.Select(" LinkType=2", "XRefName")) { CreateShortcutXRefButton(efr, x); x++; count++; } lblShortcut.Text += " (" + count + ")"; if (count > 0) { hasControls = true; } Label lblContainer = CreateXrefGroupLabel(LawMate.Properties.Resources.ContainerCrossReferences, x); x++; count = 0; foreach (appDB.EFileSearchRow efr in dt.Select("LinkType=1 ", UIHelper.Translate(fmCurrent, "NameE"))) { if (fmCurrent.DB.FileMetaType.FindByMetaTypeCode(efr.MetaType).IsContainer) { CreateShortcutXRefButton(efr, x); x++; count++; } } lblContainer.Text += " (" + count + ")"; if (count > 0) { hasControls = true; } Label lblLeafOther = CreateXrefGroupLabel(LawMate.Properties.Resources.LeafCrossReferencesInOtherContainers, x); x++; count = 0; foreach (appDB.EFileSearchRow efr in dt.Select("LinkType=1 ", UIHelper.Translate(fmCurrent, "NameE"))) { if (!fmCurrent.DB.FileMetaType.FindByMetaTypeCode(efr.MetaType).IsContainer) { string trgParent = efr.FullFileNumber.Substring(0, efr.FullFileNumber.LastIndexOf("-")); if (trgParent != thisParent) { CreateShortcutXRefButton(efr, x); x++; count++; } } } lblLeafOther.Text += " (" + count + ")"; if (count > 0) { hasControls = true; } Label lblLeafSame = CreateXrefGroupLabel(LawMate.Properties.Resources.LeafCrossReferencesInSameContainer, x); x++; count = 0; foreach (appDB.EFileSearchRow efr in dt.Select("LinkType=1 ", UIHelper.Translate(fmCurrent, "NameE"))) { if (!fmCurrent.DB.FileMetaType.FindByMetaTypeCode(efr.MetaType).IsContainer) { string trgParent = efr.FullFileNumber.Substring(0, efr.FullFileNumber.LastIndexOf("-")); if (trgParent == thisParent) { CreateShortcutXRefButton(efr, x); x++; count++; } } } lblLeafSame.Text += " (" + count + ")"; //if (count > 0) // hasControls = true; //pnlXRefs.Enabled = hasControls; } }