private void CreateShortcutXRefButton(appDB.EFileSearchRow efr, int count) { CreateCheckbox(efr.xrefId, count, false); LinkLabel lnkLabel = CreateXrefLinkLabel(efr.xrefId, count, false); Janus.Windows.Common.SuperTipSettings jstSettings = new Janus.Windows.Common.SuperTipSettings(); jstSettings.Text = String.Format(LawMate.Properties.Resources.FileName0FileNumber1, efr.Name, efr.FullFileNumber); jstSettings.HeaderText = efr.XRefName; switch (efr.LinkType) { case (int)atriumBE.FXLinkType.Shortcut: lnkLabel.ImageKey = "fileShortcut.png"; Size sz = System.Windows.Forms.TextRenderer.MeasureText(efr.XRefName, lnkLabel.Font); lnkLabel.Width = sz.Width + 32; lnkLabel.Text = efr.XRefName; jstSettings.HeaderImageKey = "fileShortcut.png"; break; case (int)atriumBE.FXLinkType.XRef: lnkLabel.ImageKey = "XRefFile.gif"; string linkText = String.Format("{0} ({1})", efr.Name, efr.FullFileNumber); Size sz2 = System.Windows.Forms.TextRenderer.MeasureText(linkText, lnkLabel.Font); lnkLabel.Width = sz2.Width + 32; lnkLabel.Text = String.Format("{0} ({1})", efr.Name, efr.FullFileNumber); jstSettings.HeaderImageKey = "XRefFile.gif"; break; } janusSuperTip1.SetSuperTip(lnkLabel, jstSettings); lnkLabel.Tag = efr; pnlXRefsContainer.Controls.Add(lnkLabel); }
public void FindFile(int fileid) { appDB.EFileSearchRow esr = myAtmng.FileSearchByFileId(fileid)[0]; if (ucBrowse1.myFTV.FindNode(esr) == null) { MessageBox.Show("could not find file"); } }
public void FindFile(int fileId) { appDB.EFileSearchRow esr = myAtmng.FileSearchByFileId(fileId)[0]; findingFile = true; ucBrowse1.myFTV.FindNode(esr); findingFile = false; LoadDocs(); }
//private void tvMyFiles_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) //{ // try // { // if (!lookupsLoaded) // LoadLookups(); // Search srch = new Search(Atmng, eFileBindingSource); // switch (e.Node.Name) // { // case "ndToday": // srch.DoSearch(Atmng.WorkingAsOfficer.UserName, DateTime.Today, atDates.StandardDate.Tomorrow.BeginDate); // break; // case "ndYesterday": // srch.DoSearch(Atmng.WorkingAsOfficer.UserName, atDates.StandardDate.Yesterday.BeginDate, DateTime.Today); // break; // case "ndLastWeek": // srch.DoSearch(Atmng.WorkingAsOfficer.UserName,atDates.StandardDate.LastWeek.BeginDate, atDates.StandardDate.LastWeek.EndDate); // break; // case "ndThisWeek": // srch.DoSearch(Atmng.WorkingAsOfficer.UserName, atDates.StandardDate.ThisWeek.BeginDate, atDates.StandardDate.ThisWeek.EndDate); // break; // case "ndCustom": // fCustomDateRange fDateRangeFiles = new fCustomDateRange(); // if (fDateRangeFiles.ShowDialog() == DialogResult.OK) // srch.DoSearch(Atmng.WorkingAsOfficer.UserName,(DateTime)fDateRangeFiles.BeginDate, (DateTime)fDateRangeFiles.EndDate); // break; // case "ndAssFiles": // srch.DoSearch(Atmng.WorkingAsOfficer.ContactId, Atmng.WorkingAsOfficer.PositionCode); // break; // case "ndContactFiles": // srch.DoSearch(Atmng.WorkingAsOfficer.ContactId, null); // break; // default: // return; // } // eFileGridEX.RootTable.Columns["FullFileNumber"].Visible = true; // eFileGridEX.RootTable.Columns["SIN"].Visible = false; // eFileGridEX.Focus(); // } // catch (Exception x) // { // UIHelper.HandleUIException(x); // } //} private void btnCancel_Click(object sender, EventArgs e) { try { selectedFile = null; this.Close(); } catch (Exception x) { UIHelper.HandleUIException(x); } }
public void FindFile(int fileId) { appDB.EFileSearchRow esr = myFTV.myAtmng.FileSearchByFileId(fileId)[0]; TreeNode tn = myFTV.FindNode(esr); if (tn != null) { tn.TreeView.Focus(); } else { MessageBox.Show("The file could not be located."); } }
private void SetSelectedFile(BindingSource bs) { if (bs.Current != null) { selectedFile = (appDB.EFileSearchRow)((DataRowView)bs.Current).Row; buttonOK.Enabled = true; lblCurrentFile.Text = selectedFile.Name + " (" + selectedFile.FullFileNumber + ")"; } else { selectedFile = null; buttonOK.Enabled = false; lblCurrentFile.Text = ""; } }
private void SetSelectedFile(UserControls.ucBrowse ucb) { if (ucb.SelectedFile != null) { selectedFile = ucb.SelectedFile; selectedFileId = (int)selectedFile["FileId"]; buttonOK.Enabled = true; lblCurrentFile.Text = selectedFile.Name + " (" + selectedFile.FullFileNumber + ")"; } else { selectedFile = null; buttonOK.Enabled = false; lblCurrentFile.Text = ""; } }
private void FilterApplied() { Cursor.Current = Cursors.WaitCursor; tvFiles.Visible = false; appDB.EFileSearchRow efsr = myFTV.SelectedFile; ReloadRoot(); myFTV.FindNode(efsr); tvFiles.BeginUpdate(); //resort tree myFTV.Resort(tvFiles.Nodes); tvFiles.EndUpdate(); //tvFiles.Sort(); if (tvFiles.Nodes.Find(efsr.FileId.ToString(), true).Length > 0) { tvFiles.SelectedNode = tvFiles.Nodes.Find(efsr.FileId.ToString(), true)[0]; } Cursor.Current = Cursors.Default; tvFiles.Visible = true; tvFiles.ExpandAll(); }
private void SetMenuClickedEventArgs(FileContextMenuItem MenuItem, ActivityConfig.ACSeriesRow acs) { appDB.EFileSearchRow efilerow = null; docDB.DocXRefRow docxrefrow = null; TreeNode nd = null; try { nd = (TreeNode)uiCommandManager1.Tag; if (nd.Tag.GetType() == typeof(appDB.EFileSearchRow)) { efilerow = (appDB.EFileSearchRow)nd.Tag; } else if (nd.Tag.GetType() == typeof(docDB.DocXRefRow)) { docxrefrow = (docDB.DocXRefRow)nd.Tag; } //efilerow = (appDB.EFileSearchRow)nd.Tag; } catch (Exception x) { efilerow = (appDB.EFileSearchRow)uiCommandManager1.Tag; } if (ContextMenuClicked != null) { FileContextEventArgs fe = new FileContextEventArgs(); fe.MenuItem = MenuItem; fe.SelectedFile = efilerow; fe.ACSeries = acs; fe.Node = nd; ContextMenuClicked(this, fe); } }
public DataTable Codes(string codeName, object vWhere, bool noCache) { string sListname = codeName + this.AppMan.Language; DataTable olist = new DataTable(codeName); WhereClause wc = new WhereClause(); if (!noCache) { if (this.MyColCodes.ContainsKey(sListname)) { return((DataTable)this.MyColCodes[sListname]); } } switch (codeName.ToUpper()) { case "VOUTCOME": case "OUTCOME": if (vWhere == null) { int decID = 1; if (GetSSTMng().DB.SSTCase.Count > 0 && !GetSSTMng().DB.SSTCase[0].IsDecisionTypeNull()) { decID = GetSSTMng().DB.SSTCase[0].DecisionType; } if (GetSSTMng().DB.SSTDecision.Count > 0) { SST.SSTDecisionRow[] sdrs = (SST.SSTDecisionRow[])GetSSTMng().GetSSTDecision().GetCurrentRow(); if (sdrs.Length == 1) { decID = sdrs[0].DecisionType; } } wc.Add("DecisionType", "=", decID); wc.Add("Obsolete", "=", 0); olist = this.AtMng.GetGeneralRec("select * from vOutcomeList " + wc.Clause() + " order by sortkey"); noCache = true; } else { wc = (WhereClause)vWhere; wc.Add("Obsolete", "=", 0); olist = this.AtMng.GetGeneralRec("select * from vOutcomeList " + wc.Clause() + " order by sortkey"); } break; case "SSTPARTYTYPE": int prgId = 0; if (GetSSTMng().DB.SSTCase.Rows.Count > 0) { prgId = GetSSTMng().GetSSTCase().EffectiveProgram(GetSSTMng().DB.SSTCase[0]); } wc.Add("ProgramId", "=", prgId); wc.Add("Obsolete", "=", 0); olist = this.AtMng.GetGeneralRec("vSSTContactTypeList", wc); noCache = true; break; case "CHILDFILETYPE": appDB.EFileSearchRow pfr = this.EFile.GetEfileParentRow(this.CurrentFile); if (pfr != null) { string ft = pfr.FileType; wc.Add("ParentFileType", "=", ft); sListname += ft; } else { string ft = this.CurrentFile.FileType; wc.Add("ParentFileType", "=", ft); sListname += ft; } if (this.MyColCodes.ContainsKey(sListname)) { return((DataTable)this.MyColCodes[sListname]); } olist = this.AtMng.GetGeneralRec("vFileTypeList", wc); break; case "CHILDMETATYPE": appDB.EFileSearchRow pfr1 = this.EFile.GetEfileParentRow(this.CurrentFile); if (pfr1 != null) { string mt = pfr1.MetaType; wc.Add("ParentMetaType", "=", mt); sListname += mt; } else { string mt = this.CurrentFile.MetaType; wc.Add("ParentMetaType", "=", mt); sListname += mt; } if (this.MyColCodes.ContainsKey(sListname)) { return((DataTable)this.MyColCodes[sListname]); } olist = this.AtMng.GetGeneralRec("vMetaTypeList", wc); break; case "PROVINCE": if (vWhere != null) { wc = (WhereClause)vWhere; } wc.Add("Obsolete", "=", 0); olist = this.AtMng.GetGeneralRec(codeName, wc); if (1 == 1) { DataColumn[] keys = new DataColumn[1]; keys[0] = olist.Columns["ProvinceCode"]; olist.PrimaryKey = keys; } break; case "VOFFICECLIENTLIST": olist = this.AtMng.GetGeneralRec("vOfficeClientList", wc); olist.PrimaryKey = new DataColumn[] { olist.Columns["OfficeID"] }; break; case "VOFFICELIST": case "OFFICELIST": case "AGENTLIST": olist = this.AtMng.GetGeneralRec("vOfficeList", wc); olist.PrimaryKey = new DataColumn[] { olist.Columns["OfficeID"] }; break; case "AGENTLISTSPECIAL": olist = this.AtMng.GetGeneralRec("Select * from Office as a inner join address as ad on a.addressid=ad.addressid"); break; case "VOFFICERLIST": case "OFFICERLIST": if (vWhere == null) { olist = this.AtMng.GetGeneralRec("vOfficerList", wc); } else if (vWhere.GetType() == typeof(WhereClause)) { olist = this.AtMng.GetGeneralRec("vOfficerList", (WhereClause)vWhere); } else if ((bool)vWhere == true) { wc.Add("CurrentEmployee", "=", 1); olist = this.AtMng.GetGeneralRec("vOfficerList", wc); } olist.PrimaryKey = new DataColumn[] { olist.Columns["OfficerID"] }; break; case "LAWYERLIST": wc.Add("CurrentEmployee", "=", 1); olist = AtMng.GetGeneralRec("vLawyerList", wc); olist.PrimaryKey = new DataColumn[] { olist.Columns["OfficerID"] }; break; case "OWNERLIST": olist = this.OfficerByOffice(this.CurrentFile.OwnerOfficeId, true, true); break; case "AGENTLOGGEDONOFFLIST": olist = this.OfficerByOffice(this.AtMng.OfficeLoggedOn.OfficeId, true, true); break; case "OFFICERACCESSLIST": wc.Add("FileId", "=", this.CurrentFile.FileId); wc.Add("CurrentEmployee", "=", 1); olist = this.AtMng.GetGeneralRec("vOfficerAccessList", wc); olist.PrimaryKey = new DataColumn[] { olist.Columns["OfficerID"] }; break; case "LEADLIST": case "AGENTOFFLIST": olist = this.OfficerByOffice(this.CurrentFile.LeadOfficeId, true, true); break; default: if (vWhere == null) { return(AtMng.GetddLookup().Codes(codeName, this)); } else { olist = this.AtMng.GetGeneralRec(codeName, (WhereClause)vWhere); } break; } switch (codeName.ToUpper()) { case "SELJUDGMENT": break; case "SELWRIT": break; default: if (!noCache) { this.MyColCodes.Add(sListname, olist); } break; } if (olist.PrimaryKey.Length == 0) { olist.PrimaryKey = new DataColumn[] { olist.Columns[0] }; } return(olist); }
private void setFilePropertiesFromXML(FileManager fm, XmlDocument efileXml, string fileMetaType, string foldername) { appDB.EFileSearchRow efs = fm.EFile.GetEfileParentRow(fm.CurrentFile); FileManager fmParent = AtMng.GetFile(efs.FileId); atriumDB.EFileRow pFile = fmParent.CurrentFile; if (pFile.NameE == "[NameNotSet]") { //set name properly string filenum = getNodeValue(efileXml, "FileNo2"); string fileopened = getNodeValue(efileXml, "FileOpenDate"); string fileclosed = getNodeValue(efileXml, "FileCloseDate"); if (!string.IsNullOrEmpty(fileopened)) { DateTime fileOpenedDate = DateTime.ParseExact(fileopened, "dd/MM/yyyy hh:mm:ss tt", provider); pFile.OpenedDate = fileOpenedDate; } if (!string.IsNullOrEmpty(fileclosed)) { DateTime fileClosedDate = DateTime.ParseExact(fileclosed, "dd/MM/yyyy hh:mm:ss tt", provider); pFile.ClosedDate = fileClosedDate; pFile.CloseCode = "800"; } pFile.StatusCode = (getNodeValue(efileXml, "Status") == "Open") ? "O" : "C"; string fileDesc = getNodeValue(efileXml, "FileDescription"); if (fileDesc.Length > 0) { pFile.DescriptionE = fileDesc; } if (filenum.IndexOf(" ") == -1) { pFile.FileNumber = filenum; } else { pFile.FileNumber = filenum.Substring(0, filenum.IndexOf(" ")); } pFile.NameE = getNodeValue(efileXml, "Subject"); pFile.NameF = pFile.NameE; pFile.FileType = "F"; if (!string.IsNullOrEmpty(fileMetaType)) { pFile.MetaType = fileMetaType; } //fileAKA string FileNo = getNodeValue(efileXml, "FileNo"); if (!string.IsNullOrEmpty(FileNo) || FileNo != "-") { //create new AKA record using FileNo } atLogic.BusinessProcess bp = fmParent.GetBP(); bp.AddForUpdate(fmParent.EFile); bp.AddForUpdate(fmParent.GetFileXRef()); bp.AddForUpdate(fmParent.GetFileOffice()); bp.Update(); } //TODO: Identify other properties and decide how to handle ones that don't have a home (e.g. new entity? store in xml file like extract from lotus?) }
public override void ApplySecurity(DataRow dr) { if (FileForm() != null && FileForm().ReadOnly) { return; } atriumDB.EFileRow cbr = (atriumDB.EFileRow)dr; if (FM.CurrentFile.RowState != DataRowState.Deleted) { int perm = (int)FM.AtMng.SecurityManager.CanUpdate(FM.CurrentFile.FileId, atSecurity.SecurityManager.Features.EfileScreen); bool ok = perm > 0 & perm < 10 & FM.EFile.CanEdit(FM.CurrentFile); if (ok) { tsDump.Visible = Janus.Windows.UI.InheritableBoolean.True; cmdFileAccess.Visible = Janus.Windows.UI.InheritableBoolean.True; } else { tsDump.Visible = Janus.Windows.UI.InheritableBoolean.False; cmdFileAccess.Visible = Janus.Windows.UI.InheritableBoolean.False; } if (FM.AtMng.SecurityManager.CanOverride(FM.CurrentFileId, atSecurity.SecurityManager.Features.secFileRule) == atSecurity.SecurityManager.ExPermissions.Yes) { tsSecurity.Visible = Janus.Windows.UI.InheritableBoolean.True; } else { tsSecurity.Visible = Janus.Windows.UI.InheritableBoolean.False; } UIHelper.EnableControls(eFileBindingSource, ok); UIHelper.EnableControls(archiveBatchBindingSource, ok); appDB.EFileSearchRow pdr = FM.EFile.GetEfileParentRow(cbr); bool auto = false;// FM.DB.FileMetaType.FindByMetaTypeCode(pdr.MetaType).SubFileAutoNumber; if (pdr != null & ok) { auto = FM.DB.FileMetaType.FindByMetaTypeCode(pdr.MetaType).SubFileAutoNumber; fileNumberEditBox.ReadOnly = auto; } //disable period fields where children are not auto-numbered if (!auto) { mccPeriod.Enabled = false; calPeriodStartDate.Enabled = false; } perm = (int)FM.AtMng.SecurityManager.CanDelete(FM.CurrentFile.FileId, atSecurity.SecurityManager.Features.EfileScreen); ok = perm > 0 & perm < 10 & FM.EFile.CanDelete(FM.CurrentFile); UIHelper.EnableCommandBarCommand(tsDelete, ok); //jll 2015-10-02: what the hell is this?!? if (!descriptionEEditBox.Enabled) { descriptionEEditBox.ReadOnly = true; descriptionEEditBox.Enabled = true; } } }
private void DoMove() { fWait fProgress = new fWait(); try { if (fileBrowser == null) { fileBrowser = new fBrowse(myFM.AtMng, 0, false, false, false, true); } fileBrowser.FindFile(myFM.CurrentFileId); if (fileBrowser.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Cursor.Current = Cursors.WaitCursor; //make dict of rows Dictionary <int, appDB.EFileSearchRow> FilesToMove = new Dictionary <int, appDB.EFileSearchRow>(); foreach (Janus.Windows.GridEX.GridEXSelectedItem gsi in eFileSearchGridEX.SelectedItems) { appDB.EFileSearchRow efsr1 = (appDB.EFileSearchRow)((DataRowView)gsi.GetRow().DataRow).Row; FilesToMove.Add(efsr1.FileId, efsr1); } try { foreach (appDB.EFileSearchRow efsr in FilesToMove.Values) { fProgress.setMessageText("Moving: " + efsr.Name); fProgress.Show(); fProgress.Refresh(); FileManager filetomove1 = myFM.AtMng.GetFile(efsr.FileId); //filetomove1.EFile.Move(filetomove1.CurrentFile, f.SelectedFile.FileId, true); UIHelper.MoveFile(filetomove1, fileBrowser.SelectedFile.FileId); atLogic.BusinessProcess bp = myFM.AtMng.GetBP(); bp.AddForUpdate(filetomove1.GetFileXRef()); bp.AddForUpdate(filetomove1.EFile); bp.Update(); } } catch (Exception x) { myFM.DB.FileXRef.RejectChanges(); myFM.DB.EFile.RejectChanges(); Cursor.Current = Cursors.Default; fProgress.Close(); UIHelper.HandleUIException(x); } Cursor.Current = Cursors.Default; fProgress.Close(); } LoadChildren(myFM); } catch (Exception x1) { fProgress.Close(); throw x1; } }