private void AddNewAppointment(int NawACSeriesId) { try { fACWizard facwr; //Launch AcWizard Constructor to Add Appointment if (!IsOfficerCal) { this.FileForm().ReadOnly = true; facwr = new fACWizard(FM, ACEngine.Step.ACInfo, NawACSeriesId); this.FileForm().HookupWizClose(facwr); facwr.Show(); } else { atriumBE.FileManager fmCurrent = FM.AtMng.GetFile(FM.AtMng.WorkingAsOfficer.MyFileId); facwr = new fACWizard(fmCurrent, ACEngine.Step.ACInfo, NawACSeriesId); facwr.ShowDialog(); facwr.Close(); } } catch (Exception x) { if (this.FileForm() != null) { this.FileForm().ReadOnly = false; } UIHelper.HandleUIException(x); } }
private void Save(atriumBE.FileManager contextFM) { //atriumBE.FileManager contextFM = FM.AtMng.GetFile(CurrentRow().FileId); if (contextFM.DB.Appointment.HasErrors) { UIHelper.TableHasErrorsOnSaveMessBox(contextFM.DB); } else { try { this.AppointmentBindingSource.EndEdit(); contextFM.SaveAll(); ApplyBR(true); if (!isOfficerCal) { fFile f = (fFile)this.ParentForm; f.fileToc.LoadTOC(); } } catch (Exception x) { throw x; } } CreateAddNewAppointMenu(); }
public void Init(atriumBE.FileManager fm, fFile parentFile) { fmCurrent = fm; Atmng = fm.AtMng; ParentFile = parentFile; fileId = fm.CurrentFile.FileId; if (UIHelper.getScalingFactor() > 1) { tvContents.ItemHeight = tvContents.ItemHeight + 2; } //JLL 2015-08-30 higher dpi setting handling //defaultTopHeight = UIHelper.AdjustHeightInt(this, defaultTopHeight); //defaultRowHeight = UIHelper.AdjustHeightInt(this, defaultRowHeight); //END JLL 2015-08-30 // WI 75873 if (fm.GetSSTMng() != null && !fm.CurrentFile.IsDim2IdNull()) { programId = fm.CurrentFile.Dim2Id; } // -- end // WI 75873 fm.EFile.OnUpdate += new atLogic.UpdateEventHandler(EFile_OnUpdate); fm.GetFileXRef().OnUpdate += new atLogic.UpdateEventHandler(ucToC_OnUpdate); LoadTOC(); }
private void eFileGridEX_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) //display context menu { try { //TODO:create context menu control //raise event if (CurrentRow() != null && eFileGridEX.HitTest() == Janus.Windows.GridEX.GridArea.Cell) { Application.UseWaitCursor = true; atriumBE.FileManager fm = Atmng.GetFile(CurrentRow().FileId); FileTreeView.BuildMenu(fm, ucFileContextMenu1.uiCommandManager1.Commands["cmdFNew"], FileTreeView.dmFILENEW); FileTreeView.BuidAKA(fm, ucFileContextMenu1.uiCommandManager1.Commands["cmdFileAKA"]); ucFileContextMenu1.uiContextMenu7.CommandManager.Tag = CurrentRow(); ucFileContextMenu1.uiContextMenu7.Show(); Application.UseWaitCursor = false; } } catch (Exception x) { Application.UseWaitCursor = false; UIHelper.HandleUIException(x); } } }
private void EditReschedule(int NawACSeriesId) { try { //check to see if appt has a hearing if (CurrentRow() != null) { atriumBE.FileManager contextFM = FM.AtMng.GetFile(CurrentRow().FileId); atriumDB.FileContactRow FCR = contextFM.GetFileContact().GetByRole("FTM"); bool isTM = false; if (FCR != null) { isTM = (FCR.ContactId == FM.AtMng.WorkingAsOfficer.ContactId); } if (ApptIsHearing() && isTM) { UIHelper.CannotEditAppointment(); } else { //Create Step to handle editing Appointment fACWizard facwr; //Launch AcWizard Constructor to Edit Appointment if (!IsOfficerCal) { this.FileForm().ReadOnly = true; GetOriginalRecurrenceAppointment(FM); facwr = new fACWizard(FM, NawACSeriesId, CurrentRow().ApptId); this.FileForm().HookupWizClose(facwr); facwr.Show(); } else { atriumBE.FileManager fmCurrent = FM.AtMng.GetFile(CurrentRow().FileId); GetOriginalRecurrenceAppointment(fmCurrent); facwr = new fACWizard(fmCurrent, NawACSeriesId, CurrentRow().ApptId); facwr.ShowDialog(); facwr.Close(); } } } else { AddNewAppointment(NawACSeriesId); } } catch (Exception x) { if (this.FileForm() != null) { this.FileForm().ReadOnly = false; } UIHelper.HandleUIException(x); } }
private void timFMHeartbeat_Tick(object sender, EventArgs e) { try { atriumBE.FileManager fm = AtMng.GetFile(myfmAB.CurrentFile.FileId); } catch (Exception x) { UIHelper.HandleUIException(x); } }
public fBrowseIssues(atriumManager atmng, bool allowContainerSelection, int programid) { InitializeComponent(); ucBrowseIssues1.LoadRoot(atmng, programid); Atmng = atmng; AllowContainerSelection = allowContainerSelection; issueBindingSource.DataMember = Atmng.DB.Issue.TableName; issueBindingSource.DataSource = Atmng.DB; ucIssueSelectBox1.AtMng = Atmng; myFM = Atmng.GetFile(); }
public fAddressBook(Form f, atriumBE.FileManager fmAB) : base(f) { InitializeComponent(); myfmAB = fmAB; timFMHeartbeat.Start(); // myfmAB.KeepAlive = true; //myfmAB.GetFileContact().LoadByFileId(myfmAB.CurrentFileId); fileContactBindingSource.DataSource = myfmAB.DB.FileContact; fileContactGridEX.DropDowns["ddOfficeCode"].SetDataBinding(myfmAB.Codes("vOfficeList"), ""); fileContactGridEX.DropDowns["ddOfficeName"].SetDataBinding(myfmAB.Codes("vOfficeList"), ""); myfmAB.DB.FileContact.ColumnChanged += new DataColumnChangeEventHandler(FileContact_ColumnChanged); }
public static string Translate(this System.Data.DataRow dr, string column, atriumBE.FileManager fm) { string colnm = fm.AtMng.Translate(column); if (dr.IsNull(colnm)) { return(""); } else { return(dr[colnm].ToString()); } }
private void lnkJumpToOwnerFile_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { LinkLabel lnk = (LinkLabel)sender; int FileId = (int)lnk.Tag; atriumBE.FileManager fmLink = Atmng.GetFile(FileId); ParentFile.MainForm.OpenFile(fmLink.CurrentFile.FileId); } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void lnk_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { LinkLabel lnk = (LinkLabel)sender; string fileNumber = (string)lnk.Tag; atriumBE.FileManager fmLink = Atmng.GetFile(fileNumber); ParentFile.MainForm.OpenFile(fmLink.CurrentFile.FileId); } catch (Exception x) { UIHelper.HandleUIException(x); } }
public fBrowseOffices(atriumManager atmng) { InitializeComponent(); Atmng = atmng; Atmng.OfficeMng.GetOffice().Load(); officeBindingSource.DataSource = atmng.OfficeMng.DB; officeBindingSource.DataMember = atmng.OfficeMng.DB.Office.TableName; atriumBE.FileManager FMCodes = atmng.GetFile(); UIHelper.ComboBoxInit("OfficeType", officeGridEX.DropDowns["ddOfficeType"], FMCodes); UIHelper.ComboBoxInit("Department", officeGridEX.DropDowns["ddDepartment"], FMCodes); lblCurrentFile.Text = ""; }
private bool ApptIsHearing() { if (CurrentRow() == null) { return(false); } atriumBE.FileManager contextFM = FM.AtMng.GetFile(CurrentRow().FileId); DataRow[] drs = contextFM.GetSSTMng().DB.Hearing.Select("ApptId=" + CurrentRow().ApptId.ToString()); if (drs.Length > 0) { return(true); } return(false); }
public fMassActivity(Form f, Object bs) : base(f) { InitializeComponent(); appDB.EFileSearchDataTable efsdt = (appDB.EFileSearchDataTable)bs; searchResultBindingSource.DataSource = efsdt; foreach (appDB.EFileSearchRow efs in efsdt) { efs.SetMessageNull(); efs.SetResultNull(); } fmCurrent = this.AtMng.GetFile(); DataView dv = new DataView(fmCurrent.Codes("vACMenu"), "Menu='MassActivity'", "StepCode", DataViewRowState.CurrentRows); UIHelper.ComboBoxInit(dv, ucActivity, fmCurrent); UIHelper.ComboBoxInit("vTemplateList1", uiTemplate, fmCurrent); gridFileList.LoadingRow += new Janus.Windows.GridEX.RowLoadEventHandler(gridFileList_LoadingRow); }
public static IHtmlString LabelForStatusCode(this System.Web.Mvc.HtmlHelper helper, string statusCode, atriumBE.FileManager fm) { string label = "<span class=\"label{1}\" >{0}</span>"; string color = ""; switch (statusCode) { case "A": color = " label-default statusA"; break; case "C": color = " label-default statusC"; break; case "P": color = " label-default statusP"; break; case "O": color = " label-default statusO"; break; case "M": color = " label-default statusM"; break; default: color = ""; break; } return(new HtmlString(String.Format(label, ResolveLookup(helper, statusCode, "Status", fm, null), color))); }
public static string ResolveLookup(this System.Web.Mvc.HtmlHelper helper, object id, string list, atriumBE.FileManager fm, string description) { System.Data.DataTable dt = fm.Codes(list); string result = id.ToString(); System.Data.DataRow dr = dt.Rows.Find(id); if (dr == null) { return(result); } else if (description == null) { string col = dt.Columns[1].ColumnName; return(dr.Translate(col, fm)); } else { return(dr.Translate(description, fm)); } }
/// <summary> /// Moves a process to another file /// </summary> /// <param name="pr">process to move</param> /// <param name="toFile">Target file</param> private void Move(atriumDB.ProcessRow pr, int toFileId, atriumDB.ActivityRow splitOn) { FileManager toFM = myA.AtMng.GetFile(toFileId); //need to check permissions on target file if (!toFM.GetProcess().CanAdd(toFM.CurrentFile)) { throw new AtriumException(Properties.Resources.YouNeedAddProcessPermissionOnTheDestinationFile); } CheckMove(pr); //this needs to be here myA.GetActivity().LoadByProcessId(pr.ProcessId); //sort activities by thread atriumDB.ActivityRow[] ars = (atriumDB.ActivityRow[])myA.DB.Activity.Select("processid=" + pr.ProcessId.ToString(), "ConversationIndex"); atriumDB.ProcessRow newPr = null; int oldFileid = pr.FileId; bool moveProc = false; if (splitOn != null && ars.Length > 1 && ars[0].ActivityId != splitOn.ActivityId) { //create new process for split thread newPr = (atriumDB.ProcessRow)Add(myA.CurrentFile); newPr.Active = pr.Active; //newPr.CurrentStep = pr.CurrentStep; newPr.NameE = pr.NameE; newPr.NameF = pr.NameF; newPr.SeriesId = pr.SeriesId; //newPr.Thread = pr.Thread; } else { pr.FileId = toFileId; pr.Thread = pr.ProcessId.ToString(); moveProc = true; foreach (atriumDB.ProcessContextRow pcr in pr.GetProcessContextRows()) { pcr.FileId = toFileId; } } //move all activties on process foreach (atriumDB.ActivityRow par in pr.GetActivityRows()) { if (splitOn == null || par.ConversationIndex.CompareTo(splitOn.ConversationIndex) >= 0) { myA.GetActivity()._Move(par, toFileId); if (newPr != null) { par.ProcessId = newPr.ProcessId; } } } if (moveProc) { FileManager fmOld = myA.AtMng.GetFile(oldFileid); atriumDB.ProcessRow prOld = fmOld.DB.Process.FindByProcessId(pr.ProcessId); if (prOld != null) { prOld.Delete(); prOld.AcceptChanges(); } } }
public override void Delete() { if (schedule1.CurrentAppointment != null) { atriumBE.FileManager contextFM = FM.AtMng.GetFile(CurrentRow().FileId); DataRow[] drAppt = contextFM.DB.Appointment.Select("ApptId=" + CurrentRow().ApptId.ToString()); atriumDB.AppointmentRow apptRow; //= (atriumDB.AppointmentRow)drAppt[0]; if (drAppt.Length > 0) { apptRow = (atriumDB.AppointmentRow)drAppt[0]; } else { apptRow = contextFM.GetAppointment().Load(CurrentRow().ApptId); } if (apptRow.IsApptRecurrenceIdNull()) { if (UIHelper.ConfirmDelete()) { atriumDB.AttendeeRow[] atrs = (atriumDB.AttendeeRow[])contextFM.DB.Attendee.Select("ApptID=" + apptRow.ApptId.ToString()); foreach (atriumDB.AttendeeRow atr in atrs) { atr.Delete(); } apptRow.Delete(); Save(contextFM); UpdateReminders(); } } else { if (UIHelper.ConfirmDelete(Properties.Resources.UIDeleteAllRecurringAppointments + " " + Properties.Resources.UIConfirmDelete, "Deleting Multiple Appointments")) //Properties.Resources.ConfirmDeleteAppRecurrence)) { if (apptRow.ApptRecurrenceRow == null) { DataRow[] drRecurr = contextFM.DB.ApptRecurrence.Select("ApptRecurrenceId=" + apptRow.ApptRecurrenceId.ToString()); if (drRecurr.Length > 0) { apptRow.ApptRecurrenceRow = (atriumDB.ApptRecurrenceRow)drRecurr[0]; } else { apptRow.ApptRecurrenceRow = contextFM.GetApptRecurrence().Load(apptRow.ApptRecurrenceId); } } atriumDB.AppointmentRow[] appdt = apptRow.ApptRecurrenceRow.GetAppointmentRows(); atriumDB.ApptRecurrenceRow apptrecRow = apptRow.ApptRecurrenceRow; foreach (atriumDB.AppointmentRow ar in appdt) { atriumDB.AttendeeRow[] attRows = ar.GetAttendeeRows(); foreach (atriumDB.AttendeeRow attRow in attRows) { attRow.Delete(); } ar.Delete(); } apptrecRow.Delete(); Save(contextFM); UpdateReminders(); } } //AddRecurrenceSymbol(); } }
public DataTable Codes(string name, FileManager fm) { if (myddLookupDT.Count == 0) { Load(); } appDB.ddLookupRow[] dlrs = (appDB.ddLookupRow[])myddLookupDT.Select("LookupName='" + name + "'"); if (dlrs.Length == 1) { DataTable dtList; appDB.ddLookupRow dlr = dlrs[0]; string sListname = name + myA.AppMan.Language; if (dlr.Cache && myA.myColCodes.ContainsKey(sListname)) { return((DataTable)myA.myColCodes[sListname]); } WhereClause wc = new WhereClause(); if (dlr.UseFileContext && fm != null && !fm.IsVirtualFM) { wc.Add("Fileid", "=", fm.CurrentFileId); } if (!dlr.IncludeObsolete) { wc.Add("Obsolete", "=", 0); } if (!dlr.IsWhereClauseNull()) { wc.And(dlr.WhereClause); } switch (dlr.LookupType) { case "SP": if (dlr.UseFileContext && fm != null && !fm.IsVirtualFM) { dtList = myA.AppMan.ExecuteDataset(dlr.Source, fm.CurrentFileId).Tables[0]; } else { dtList = myA.AppMan.ExecuteDataset(dlr.Source, System.DBNull.Value).Tables[0]; } break; case "SQL": dtList = myA.GetGeneralRec(dlr.Source); break; case "VIEW": case "TABLE": dtList = myA.GetGeneralRec(dlr.Source, wc); break; case "GEN": default: wc.Add("LookupId", "=", dlr.LookupId); DataView dv = new DataView(myA.DB.ddGeneric, wc.Filter(), "", DataViewRowState.CurrentRows); dtList = dv.ToTable(); dtList.Columns.Remove("LookupId"); dtList.Columns.Remove("ParentId"); dtList.PrimaryKey = new DataColumn[] { dtList.Columns["GenericId"] }; //dtList = myA.GetGeneralRec("vddGenericList",wc); break; } string sort = ""; if (!dlr.IsSortcolumnsNull()) { sort = dlr.Sortcolumns; } else { sort = dtList.Columns[0].ColumnName; } DataView dv1 = new DataView(dtList, "", sort, DataViewRowState.CurrentRows); dtList = dv1.ToTable(); if (dtList.PrimaryKey.Length == 0) { if (!dlr.IsPKNameNull()) { dtList.PrimaryKey = new DataColumn[] { dtList.Columns[dlr.PKName] }; } else { dtList.PrimaryKey = new DataColumn[] { dtList.Columns[0] }; } } if (dlr.Cache) { myA.myColCodes.Add(sListname, dtList); } return(dtList); } else { throw new AtriumException(name + " is not a valid lookup table"); } }