public void Init(atSecurity.SecurityManager sm, lmDatasets.officeDB.OfficerRow or) { mySM = sm; myOr = or; secUserBindingSource.DataSource = mySM.DB; secUserBindingSource.DataMember = "secUser";; if (!or.IsUserNameNull()) { sur = mySM.GetsecUser().Load(or.UserName); } else { sur = null; } if (sur == null) { isNew = true; sur = mySM.DB.secUser.NewsecUserRow(); if (!or.IsUserNameNull()) { sur.UserName = or.UserName; } mySM.DB.secUser.AddsecUserRow(sur); //mySM.GetsecMembership().Add(sur); btnDeleteOfficerAccount.Enabled = false; } else { bool NotEnabled = true; if (sur.AuthType == 0) { bool SQLAccountExists = mySM.GetsecUser().DoesSQLUserExist(sur.UserName); if (!SQLAccountExists) { secUserExistsWithoutSQLAccount = true; NotEnabled = false; } } if (NotEnabled) { isNew = false; userNameEditBox.Enabled = false; uiRadioButton1.Enabled = false; uiRadioButton2.Enabled = false; } else { //handle out of sync issue with atrium and sql accounts MessageBox.Show("We're sorry, but something's gone wrong. It seems this user has an Atrium security account, but does not have a SQL account. Please rectify this immediately."); } } mySM.GetsecGroup().Load(); mySM.GetsecMembership().LoadByUserId(sur.UserId); secMembershipGridEX.DropDowns["ddGroup"].SetDataBinding(mySM.DB.secGroup, ""); secUserBindingSource.Filter = "UserId=" + sur.UserId; }
public void LoadTOC() { pnlDockTop.Height = defaultTopHeight; if (fmCurrent.DB.FileXRef.Select("LinkType=0 and fileid=" + fmCurrent.CurrentFileId.ToString()).Length > 0) { pnlBrowseFiles.Enabled = true; } else { pnlBrowseFiles.Enabled = false; } if (fmCurrent.DB.FileXRef.Select("LinkType=1").Length > 0 || fmCurrent.DB.FileXRef.Select("LinkType=2 and fileid=" + fmCurrent.CurrentFileId).Length > 0) { pnlXRefs.Enabled = true; } else { pnlXRefs.Enabled = false; } SetTooltipsForLinks(); SetFileStatusColor(fmCurrent.CurrentFile.StatusCode); officeDB.OfficeRow orOwnerOffice = null; try { orOwnerOffice = fmCurrent.AtMng.GetOffice(fmCurrent.CurrentFile.OwnerOfficeId).CurrentOffice; lnkJumpToOwnerFile.Tag = orOwnerOffice.OfficeFileId; lnkJumpToOwnerFile.Enabled = (orOwnerOffice.OfficeFileId != fileId); } catch (Exception xoo) { lnkJumpToOwnerFile.Enabled = false; } officeDB.OfficeRow orLeadOffice = null; if (!fmCurrent.CurrentFile.IsLeadOfficeIdNull()) { try { orLeadOffice = fmCurrent.AtMng.GetOffice(fmCurrent.CurrentFile.LeadOfficeId).CurrentOffice; lnkJumpToLeadFile.Visible = true; lnkJumpToLeadFile.Tag = orLeadOffice.OfficeFileId; lnkJumpToLeadFile.Enabled = (orLeadOffice.OfficeFileId != fileId); } catch (Exception xlo) { lnkJumpToLeadFile.Enabled = false; } } else { lnkJumpToLeadFile.Visible = false; } if (!fmCurrent.CurrentFile.IsFullFileNumberNull()) { lblFullNumberValue.Text = fmCurrent.CurrentFile.FullFileNumber; } else { lblFullNumberValue.Text = ""; } lblFilenameValue.Text = fmCurrent.CurrentFile.Name; atriumDB.ActivityRow ar = fmCurrent.GetActivity().GetCurrentCaseStatus(DateTime.Today.AddDays(100)); int csId = 0; if (ar != null) { csId = ar.CaseStatusId; lblStatusDateValue.Text = ar.ActivityDate.ToString("yyyy/MM/dd"); } else { lblStatusDateValue.Text = "N/A"; } // WI 75873 DataRow drProgram = null; if (programId > 0) { DataTable dt = Atmng.GetFile().Codes("Dim2"); DataRow[] dr = dt.Select("ProgramId = " + programId.ToString()); drProgram = dr[0]; appDB.ddLookupRow dlr = (appDB.ddLookupRow)Atmng.DB.ddLookup.Select("LookupName='Dim2'")[0]; lblProgram.Text = dlr["Description" + Atmng.AppMan.Language].ToString(); } else { lblProgram.Visible = false; lblProgramValue.Visible = false; pnlDockTop.Height -= defaultRowHeight; } // -- End // WI 75873 //Shared Folder START lblSharedFolder.Visible = false; lnkSharedFolder.Visible = false; string sharedPath = string.Empty; if (programId == 3) { sharedPath = Atmng.GetSetting(AppStringSetting.DataExchangeNetworkPath) + fmCurrent.CurrentFile.FullFileNumber.Replace("-", @"\"); } else if (programId == 2) { sharedPath = Atmng.GetSetting(AppStringSetting.ISDataExchangeNetworkPath) + fmCurrent.CurrentFile.FullFileNumber.Replace("-", @"\"); } if (sharedPath != string.Empty && System.IO.Directory.Exists(sharedPath)) { lnkSharedFolder.Text = sharedPath; lblSharedFolder.Visible = true; lnkSharedFolder.Visible = true; } else { pnlDockTop.Height -= defaultRowHeight; } //Shared Folder END lblTypeValue.Text = fmCurrent.AtMng.CodeDB.FileType.FindByFileTypeCode(fmCurrent.CurrentFile.FileType)["FileTypeDesc" + Atmng.AppMan.languageCamel].ToString(); lblStatusValue.Text = fmCurrent.AtMng.CodeDB.Status.FindByStatusCode(fmCurrent.CurrentFile.StatusCode)["StatusDesc" + Atmng.AppMan.languageCamel].ToString(); lblCaseStatusValue.Text = fmCurrent.AtMng.CodeDB.CaseStatus.FindByCaseStatusId(csId)["CaseStatusDesc" + Atmng.AppMan.languageCamel].ToString(); if (drProgram != null) { lblProgramValue.Text = (string)drProgram["ProgramDescription" + Atmng.AppMan.languageCamel].ToString(); } if (orOwnerOffice != null) { setOfficeTooltip(lnkJumpToOwnerFile, orOwnerOffice); } if (orLeadOffice != null) { setOfficeTooltip(lnkJumpToLeadFile, orLeadOffice); } //CLAS if (fmCurrent.GetCLASMng() != null && !fmCurrent.CurrentFile.IsOpponentIDNull()) { lmDatasets.CLAS.DebtorRow orDB = fmCurrent.GetCLASMng().GetDebtor().FindLoad(fmCurrent.CurrentFile.OpponentID); if (!orDB.IsNull("SIN")) { lblSINValue.Text = atriumBE.DebtorBE.FormattedSIN(orDB.SIN); } else { lblSINValue.Text = ""; } lnkSINLabel.Visible = true; lblSINValue.Visible = true; if (!fmCurrent.CurrentFile.IsLeadParalegalIDNull()) { lmDatasets.officeDB.OfficerRow orPL = fmCurrent.AtMng.GetOffice(fmCurrent.CurrentFile.OwnerOfficeId).GetOfficer().FindLoad(fmCurrent.CurrentFile.LeadParalegalID); lblParaLegalValue.Text = orPL.LastName + ", " + orPL.FirstName + " (" + orPL.OfficerCode + ")"; lblParalegal.Visible = true; lblParaLegalValue.Visible = true; } else { lblParaLegalValue.Text = ""; lblParalegal.Visible = false; lblParaLegalValue.Visible = false; } } else { //no CLAS; hide row lnkSINLabel.Visible = false; lblSINValue.Visible = false; lblParalegal.Visible = false; lblParaLegalValue.Visible = false; pnlDockTop.Height -= defaultRowHeight; } ParentFile.uiPanel0.Text = fmCurrent.CurrentFile.Name; ucBrowse1.FileContextMenu.UsedInTreeView = false; if (fmCurrent.CurrentFile.FileStructXml != null) { tvContents.Nodes.Clear(); System.Xml.XmlDocument xdToc = new System.Xml.XmlDocument(); xdToc.InnerXml = fmCurrent.CurrentFile.FileStructXml; LoadTOCNode(tvContents.Nodes, xdToc.DocumentElement); tvContents.ExpandAll(); tvContents.Nodes[0].EnsureVisible(); } }