private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "tsSave": Save(); break; case "tsAudit": fData fAudit = new fData(CurrentRow()); fAudit.Show(); break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { if (e.Command.Key == "cmdGetRecordingFile") { // lấy file ghi âm. lấy đường dẫn string filenameDB = ""; string filenameVoice = ""; gridBaoCaoBieuMau1.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection; if (gridBaoCaoBieuMau1.SelectedItems.Count > 0) { filenameDB = (gridBaoCaoBieuMau1.SelectedItems[0]).GetRow().Cells["fileVoicePath"].Text; filenameVoice = NgheLaiCuocGoi.GetFileNameCuocDiFromPBXIP(filenameDB); } //TEST // filenameVoice = @"\\192.168.1.8\Share Data\PPM\Congnt\Taxi.Data.dll"; if (filenameVoice.Length > 0) { // check file tồn tại if (File.Exists(filenameVoice)) { // bật cửa sổ lưu file string soDienThoai = (gridBaoCaoBieuMau1.SelectedItems[0]).GetRow().Cells["src"].Text; FileInfo fi = new FileInfo(filenameVoice); saveFileDialog2.FileName = string.Format("{0}_{1}", soDienThoai, fi.Name); if (saveFileDialog2.ShowDialog() == DialogResult.OK) { File.Copy(filenameVoice, saveFileDialog2.FileName); MessageBox.MessageBoxBA msb = new MessageBox.MessageBoxBA(); msb.Show(this, "Lưu file thành công.", "Thông báo", Taxi.MessageBox.MessageBoxButtonsBA.OK); } // } } } }
private void uiCommandBar1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdCancel": Cancel(); break; case "cmdDelete": Delete(); break; case "cmdNew": New(); break; case "cmdSave": Save(); break; case "cmdProjection": RunProjections(); break; case "cmdRunAll": RunJob(true); break; case "cmdSingleJob": RunJob(false); break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void cmdAdd_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { //cmdNew cmdEdit cmdDelete cmdExit cmdHelp if (e.Command.Key == "cmdNew") { //this.ThemNhanVien(); } else if (e.Command.Key == "cmdEdit") { //this.SuaNhanVien(); } else if (e.Command.Key == "cmdDelete") { this.XoaNhanVien(); } else if (e.Command.Key == "cmdExit") { this.Close(); this.Dispose(); } else if (e.Command.Key == "cmdTimKiem") { frmNhanVienTimKiem frm = new frmNhanVienTimKiem(); if (frm.ShowDialog(this) == DialogResult.OK) { if ((frm.GetResultListOfNhanVien() != null) && (frm.GetResultListOfNhanVien().Count > 0)) { grdNhanVien.DataSource = null; grdNhanVien.DataMember = "ListOfDoiTac"; grdNhanVien.SetDataBinding(frm.GetResultListOfNhanVien(), "ListOfNhanVien"); } else { new MessageBox.MessageBox().Show("Không tìm thấy kết quả nào"); return; } } } }
private void cmdAdd_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { //cmdNew cmdEdit cmdDelete cmdExit cmdHelp if (e.Command.Key == "cmdNew") { this.ThemDanhBaCongTy(); } else if (e.Command.Key == "cmdEdit") { this.SuaDanhBaCongTy(); } else if (e.Command.Key == "cmdDelete") { this.XoaDanhBaCongTy(); } else if (e.Command.Key == "cmdExit") { this.Close(); this.Dispose(); } else if (e.Command.Key == "cmdHelp") { frmDanhBaCongTyTimKiem frm = new frmDanhBaCongTyTimKiem(); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.GetResultListOfDanhBaCongTy().Count > 0) { gridDMDanhBaCongTy.DataSource = null; gridDMDanhBaCongTy.DataMember = "ListOfDanhBaCongTy"; gridDMDanhBaCongTy.SetDataBinding(frm.GetResultListOfDanhBaCongTy(), "ListOfDanhBaCongTy"); } else { new MessageBox.MessageBoxBA().Show("Không tìm thấy kết quả nào"); return; } } } }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdEditParty": DoEditParty(); break; case "cmdSave": Save(); break; case "cmdCancel": ApplyBR(true); UIHelper.Cancel(filePartyBindingSource); UIHelper.Cancel(partyBindingSource); UIHelper.Cancel(addressBindingSource); TogglePartyEditableMode(false); ApplySecurity(CurrentRow()); break; case "cmdDelete": Delete(); break; case "tsAudit": fData fAudit = new fData(CurrentRow()); fAudit.Show(); break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
void cmdPdf_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { if (this.grdData.CurrentRow != null && this.grdData.CurrentRow.RowType == Janus.Windows.GridEX.RowType.Record) { XVEquipmentReceiveInfo receiveInfo = this.grdData.CurrentRow.DataRow as XVEquipmentReceiveInfo; if (!this.m_PdfAttachBusiness.IsFileExist(receiveInfo.RID)) { XMessageBox.ShowError("未找到要打印的PDF文档,请确认是否已上传PDF报告!"); return; } string path = XCommon.TempPath; string tempFileName = Guid.NewGuid().ToString(); tempFileName = this.m_PdfAttachBusiness.DownLoadFile(receiveInfo.ID, path, tempFileName); if (tempFileName != string.Empty) { try { Process.Start(tempFileName); } catch (Exception ex) { XMessageBox.ShowError(ex.Message); XErrorLogTool.WriteLog(ex.ToString()); } } else { XMessageBox.ShowError("未找到要打印的PDF报告文档!"); this.Close(); } } }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdNewSQL": lmDatasets.appDB.BatchRow br = (lmDatasets.appDB.BatchRow)AtMng.GetBatch().Add(null); br.JobName = "RunSQL"; parametersEditBox.ReadOnly = false; break; case "cmdRun": AtMng.GetBatch().RunAllJobs(); break; case "cmdSave": Save(); parametersEditBox.ReadOnly = true; break; case "cmdCancel": Cancel(); parametersEditBox.ReadOnly = true; break; case "cmdDelete": Delete(); parametersEditBox.ReadOnly = true; break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
void cmdEditTask_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { TreeNode selectedNode = this.tvTask.SelectedNode; if (selectedNode != null) { XModelBase model = selectedNode.Tag as XModelBase; string status = this.m_TaskBusiness.GetTaskStatus(model.ID); if (status == "结束") { XMessageBox.ShowError("该任务已结束,不能修改!"); return; } frmTaskEdit frm = new frmTaskEdit(selectedNode, model); frm.ShowDialog(); } else { XMessageBox.ShowError("请选择要修改的任务!"); } }
void cmdNewChildTask_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { TreeNode selectedNode = this.tvTask.SelectedNode; if (selectedNode == null) { XMessageBox.ShowError("请选择要创建子任务的任务!"); } if (!(selectedNode.Tag is XTaskInfo)) { //如果选中的节点不是任务节点 XMessageBox.ShowError("该节点下不能添加子任务!"); return; } if (selectedNode.Parent != null) { XMessageBox.ShowError("该节点下不能添加子任务!"); return; } frmTaskEdit frm = new frmTaskEdit(selectedNode); frm.ShowDialog(); }
private void uiCommandManager2_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdLinkToDifferentDoc": HookupDocToTemplate(); break; case "cmdEditContents": EditDocContents(true); break; case "cmdVerifyDocTag": VerifyTemplateTags(); break; case "cmdInsertTag": string sc = ""; if (dtUsedInSteps.Select("Status<>'OBS' and Obsolete=0").Length > 0) { sc = dtUsedInSteps.Select("Status<>'OBS' and Obsolete=0", "ReferenceType,Status")[0][1].ToString(); } fTagPicker frmTagPicker = new fTagPicker(AtMng, sc, ucDoc1); frmTagPicker.Show(this); //frmTagPicker.ShowDialog(this); //if (frmTagPicker.DialogResult == DialogResult.OK) // ucDoc1.WriteContentToDoc(frmTagPicker.TagToInsert); break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
/// <summary> /// 下载附件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void cmdDownloadAttach_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { if (this.grdTaskAttach.CurrentRow != null && this.grdTaskAttach.CurrentRow.RowType != Janus.Windows.GridEX.RowType.Record) { XMessageBox.ShowError("请选择要下载附件的记录!"); return; } XTaskAttachmentInfo model = this.grdTaskAttach.CurrentRow.DataRow as XTaskAttachmentInfo; string mainId = model.RID; bool isExist = this.m_FileAttachBusiness.IsFileExist(mainId); if (!isExist) { XMessageBox.ShowError("未找到附件!"); return; } FolderBrowserDialog fbd = new FolderBrowserDialog(); if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string fileName = this.m_FileAttachBusiness.DownloadFile(mainId, fbd.SelectedPath); if (fileName != string.Empty) { XMessageBox.ShowRemindMessage("下载完成!"); } else { XMessageBox.ShowError("下载失败!"); } } }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdAddAttendee": AddAttendee(); break; case "cmdAddResource": AddResource(); break; case "cmdRemoveAttendee": RemoveAttendee(); break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdJumpToFile": fMain fmain = (fMain)System.Windows.Forms.Application.OpenForms["fMain"]; fmain.OpenFile(ucRecords1.FM.CurrentFileId); break; case "cmdPreviewDoc": ucRecords1.ShowDocument = cmdPreviewDoc.IsChecked; break; case "cmdToggleSubFiles": pnlChildren.Closed = !cmdToggleSubFiles.IsChecked; AtMng.OfficeMng.GetOfficerPrefs().SetPref(OfficerPrefsBE.LawMateExplorerShowSubFiles, cmdToggleSubFiles.IsChecked); //UIHelper.SaveSetting("ShowSubFilesInLawMateExplorer", cmdToggleSubFiles.IsChecked.ToString()); LoadSubFiles = cmdToggleSubFiles.IsChecked; if (LoadSubFiles && myDM != null) { ucSubFileList1.LoadChildren(myDM.FM); } else { ucSubFileList1.Clear(); } break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdDelete": DeleteVersion(); break; case "cmdRecover": RecoverVersion(); break; case "cmdPreview": PreviewVersion(); break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdLoadXrefData": DoLoadXrefData(); break; case "cmdSelectAll": foreach (Control ctl in pnlXRefsContainer.Controls) { if (ctl.Name.StartsWith("chkXref")) { ((CheckBox)ctl).Checked = true; } } break; case "cmdDeselectAll": foreach (Control ctl in pnlXRefsContainer.Controls) { if (ctl.Name.StartsWith("chkXref")) { ((CheckBox)ctl).Checked = false; } } break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
void cmdWord_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { this.Print(); }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdSave": this.saveFileDialog1.ShowDialog(); string file = this.saveFileDialog1.FileName; if (file == "") { return; } DataSet dt = (DataSet)bindingSource1.DataSource; dt.WriteXml(file, XmlWriteMode.WriteSchema); break; case "cmdExamine": if (MessageBox.Show("This will clear the current text in the Query text field. Are you sure you want to clear the text?", "Clear Current Text", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes) { ebSQL.Text = ""; DataSet dt2 = new DataSet(); this.openFileDialog1.ShowDialog(); string file2 = this.openFileDialog1.FileName; if (file2 == "") { return; } dt2.ReadXml(file2); bindingSource1.DataSource = dt2; gridEX1.DataSource = dt2; gridEX1.RetrieveStructure(true); } break; case "cmdExecute": try { ebMessage.Text = "Executing...Please Wait"; ebCount.Text = ""; string sSQL = ebSQL.Text; if (ebSQL.SelectedText.Length > 0) { sSQL = ebSQL.SelectedText; } if (sSQL == "") { ebMessage.Text = "No query to execute"; ebCount.Text = ""; return; } DataSet ds = AtMng.AppMan.ExecuteDatasetSQL(sSQL); bindingSource1.DataSource = ds; gridEX1.DataSource = ds; gridEX1.RetrieveStructure(true); foreach (Janus.Windows.GridEX.GridEXColumn gc in gridEX1.Tables[1].Columns) { gc.EditType = Janus.Windows.GridEX.EditType.NoEdit; if (gc.DataTypeCode == TypeCode.DateTime) { gc.FormatString = "g"; } } ebMessage.Text = "Done"; if (ds.Tables.Count > 0) { ebCount.Text = ds.Tables[0].Rows.Count.ToString(); gridEX1.ExpandRecords(); } } catch (Exception x) { ebMessage.Text = "Error: " + x.Message; ebCount.Text = ""; UIHelper.HandleUIException(x); } break; case "cmdSaveExcel": this.saveFileDialog1.ShowDialog(); string file3 = this.saveFileDialog1.FileName; if (file3 == "") { return; } Janus.Windows.GridEX.Export.GridEXExporter oExport = new Janus.Windows.GridEX.Export.GridEXExporter(); oExport.GridEX = gridEX1; oExport.ExportMode = Janus.Windows.GridEX.ExportMode.AllRows; oExport.IncludeChildTables = true; oExport.IncludeCollapsedRows = true; oExport.IncludeExcelProcessingInstruction = true; oExport.IncludeFormatStyle = true; oExport.IncludeHeaders = true; System.IO.FileStream LayoutStream = new System.IO.FileStream(file3, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite, System.IO.FileShare.ReadWrite); oExport.Export(LayoutStream); LayoutStream.Close(); break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void cmdAdd_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { //cmdNew cmdEdit cmdDelete cmdExit cmdHelp if (e.Command.Key == "cmdNew") { this.ThemDoiTac(); } else if (e.Command.Key == "cmdEdit") { this.SuaDoiTac(); } else if (e.Command.Key == "cmdDelete") { DeleteDoiTac(); } else if (e.Command.Key == "cmdActive") { this.ActiveDoiTac(true); } else if (e.Command.Key == "cmdUnActive") { this.ActiveDoiTac(false); } else if (e.Command.Key == "cmdExit") { this.Close(); this.Dispose(); } else if (e.Command.Key == "cmdHelp") { frmDoiTacTimKiem frm = new frmDoiTacTimKiem(); if (frm.ShowDialog(this) == DialogResult.OK) { ListDoiTac = frm.GetResultListOfDoiTac(); if (ListDoiTac.Count > 0) { grdDoiTac.DataSource = null; grdDoiTac.DataMember = "ListOfDoiTac"; grdDoiTac.SetDataBinding(ListDoiTac, "ListOfDoiTac"); gridExport.DataSource = null; gridExport.DataMember = "ListOfDoiTacEx"; gridExport.SetDataBinding(ListDoiTac, "ListOfDoiTacEx"); } else { new MessageBox.MessageBoxBA().Show("Không tìm thấy kết quả nào"); return; } } } else if (e.Command.Key == "cmdCapNhatMoiGioi") { frmCapNhatThongTinMoiGioi frm = new frmCapNhatThongTinMoiGioi(); frm.ShowDialog(); // // Create a background thread //bw = new BackgroundWorker(); // bw.DoWork += new DoWorkEventHandler(bw_DoWorkNew); // bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted); // // Create a progress form on the UI thread // m_fmProgress = null; // m_fmProgress = new fmProgress(); // // Kick off the Async thread // bw.RunWorkerAsync(); // // Lock up the UI with this modal progress form. // try // { // m_fmProgress.ShowDialog(this); // m_fmProgress = null; // } // catch (Exception ex) // { // } } else if (e.Command.Key == "cmdKiemTraTrung") { frmKiemTraTrungSoDoiTac frm = new frmKiemTraTrungSoDoiTac(); frm.Show(); } else if (e.Command.Key == "cmdExcel") { this.XuatExcel(); } }
/// <summary> /// 退出 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void cmdExit_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { this.Close(); }
void cmdRefreshTree_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { this.RefreshTreeData(); }
void cmEdit_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { this.Edit(); }
void cmdTreeAddNew_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { this.TreeAddNew(); }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdResetGrid": if (gridLayoutStream != null) { gridLayoutStream.Position = 0; // HookUpDataSource(); eFileGridEX.LoadLayoutFile(gridLayoutStream); // UIHelper.GridToggleSelectMode(activityBFGridEX); // HookUpGridExDropDowns(); // SetCommandsState(); // activityBFGridEX.Refetch(); } break; case "cmdPrintPreview": UIHelper.GridExPrintPreview(gridEXPrintDocument1); //gridEXPrintDocument1.PrepareDocument(); //gridEXPrintDocument1.PageFooterRight = DateTime.Today.ToLongDateString(); //PrintPreviewDialog ppDialog = new PrintPreviewDialog(); //ppDialog.Document = gridEXPrintDocument1; //ppDialog.Document.DefaultPageSettings.Landscape = true; //ppDialog.ShowDialog(); break; case "cmdPrintGrid": UIHelper.GridExPrintDocument(gridEXPrintDocument1); //gridEXPrintDocument1.PrepareDocument(); //gridEXPrintDocument1.PageFooterRight = DateTime.Today.ToLongDateString(); //PrintDialog printDialog = new PrintDialog(); //printDialog.Document = gridEXPrintDocument1; //printDialog.Document.DefaultPageSettings.Landscape = true; //printDialog.AllowCurrentPage = true; //printDialog.AllowPrintToFile = true; //printDialog.AllowSelection = true; //printDialog.AllowSomePages = true; //printDialog.ShowNetwork = true; //printDialog.ShowHelp = true; //printDialog.UseEXDialog = true; //if (printDialog.ShowDialog() == DialogResult.OK) // printDialog.Document.Print(); break; case "tsCloseResults": this.Close(); break; case "tsOpen": OpenFile(); this.Close(); break; case "tsOpenAndKeep": OpenFile(); break; case "tsReviseSearchCriteria": if (!myfAS.IsDisposed) { myfAS.Activate(); } else { MessageBox.Show(LawMate.Properties.Resources.TheAdvancedSearchScreenIsNoLongerAccessible, LawMate.Properties.Resources.AdvancedSearchScreenNotAccessible, MessageBoxButtons.OK, MessageBoxIcon.Information); tsReviseSearchCriteria.Enabled = Janus.Windows.UI.InheritableBoolean.False; } break; case "tsShowDetails": if (tsShowDetails.IsChecked) { pnlResultCriteria.Closed = false; } else { pnlResultCriteria.Closed = true; } break; case "cmdFilter": if (e.Command.IsChecked) { eFileGridEX.FilterMode = Janus.Windows.GridEX.FilterMode.Automatic; } else { eFileGridEX.FilterMode = Janus.Windows.GridEX.FilterMode.None; } break; case "cmdGroupBy": eFileGridEX.GroupByBoxVisible = e.Command.IsChecked; break; case "cmdFieldChooser": eFileGridEX.ShowFieldChooser(); break; case "cmdMassActivity": fMassActivity fMassAct = new fMassActivity(this.MainForm, eFileBindingSource.DataSource); fMassAct.Show(); break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
void cmDelete_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { this.Delete(); }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { Janus.Windows.UI.CommandBars.UICommandBar bar = uiCommandManager1.CommandBars["cbMergeToolbar"]; if (bar.Commands.Contains(e.Command.Key) && bar.Commands[e.Command.Key].Commands.Count > 0) { bar.Commands[e.Command.Key].Expand(); } switch (e.Command.Key) { case "tsProcessFirst": ProcessCashBlotter(); break; case "tsProcessSecond": ProcessCashBlotter(); break; case "tsSave": Save(); break; case "tsDelete": Delete(); break; case "cmdGoToActivity": FileForm().MainForm.OpenFile(CurrentDetailRow().FileID); break; case "cmdGoToCB": fFile f1 = FileForm().MainForm.OpenFile(CurrentDetailRow().FileID); f1.MoreInfo("cbdetail", CurrentDetailRow().CashBlotterDetailID); break; case "cmdGoToGeneralFile": FileForm().MainForm.OpenFile(CurrentDetailRow().FileID); break; case "tsAudit": fData fAudit = new fData(CurrentRow()); fAudit.Show(); break; case "tsPrintCB": ActivityConfig.ACSeriesRow acsr; if (CurrentRow().IsRemittedDateNull()) { acsr = FM.AtMng.acMng.DB.ACSeries.FindByACSeriesId(UIHelper.AtMng.GetSetting(atriumBE.AppIntSetting.CBPrintDraftAcId)); } else { acsr = FM.AtMng.acMng.DB.ACSeries.FindByACSeriesId(UIHelper.AtMng.GetSetting(atriumBE.AppIntSetting.CBPrintCopyAcId)); } this.FileForm().ReadOnly = true; fACWizard facwr = new fACWizard(FM, acsr.ACSeriesId, atriumBE.ACEngine.RevType.CashBlotter, CurrentRow().CashBlotterID, null); this.FileForm().HookupWizClose(facwr); facwr.Show(); break; } FileForm().HandleACSMenu(e, CurrentRow()); } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { Janus.Windows.UI.CommandBars.UICommandBar bar = uiCommandManager1.CommandBars[0]; if (bar.Commands.Contains(e.Command.Key) && bar.Commands[e.Command.Key].Commands.Count > 0) { bar.Commands[e.Command.Key].Expand(); } switch (e.Command.Key) { case "cmdChangeCode": if (MessageBox.Show("Do you want to update all occurences of this template code? Make sure you have saved any workflow changes first.", "TEMPLATES", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK) { AtMng.GetTemplate().ChangeTemplateCode(ebBaseTemplate.Text, editBox1.Text); } break; case "cmdSelectAllFlaggedDocs": SelectAllFlaggedTemplatesForExport(); break; case "cmdCancel": Cancel(); break; case "cmdDelete": Delete(); break; case "cmdNewRTFTemplate": New("RTF"); break; case "cmdNewHTMLTemplate": New("HTML"); break; case "cmdNewTextTemplate": New("TXT"); break; case "cmdSave": Save(); break; case "cmdExport": Export(); break; case "cmdImport": Import(); break; case "cmdClone": Clone(); break; case "cmdClearSelectedDocs": ClearSelectedDocs(); break; case "cmdPreviewDoc": ToggleDocPreview(cmdPreviewDoc.IsChecked); break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
//private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) //{ // if (CurrentRow().IssueId != 0) // { // if (fbr == null) // fbr = new fBrowse(Atmng, 0,false,false,false); // fbr.ShowDialog(this); // if (fbr.SelectedFile != null) // { // lmDatasets.appDB.IssueRow ir = CurrentRow(); // ir.FileId = fbr.SelectedFile.FileId; // if (ir.IssueNameEng == "[New Issue]") // { // ir.IssueNameEng = fbr.SelectedFile.NameE; // ir.IssueNameFre = fbr.SelectedFile.NameF; // } // setBindingSourcePosition(CurrentRow().IssueId); // } // } // else // { // MessageBox.Show("You cannot link a file to the root issue.", "Invalid Action", MessageBoxButtons.OK); // } //} private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdImport": openFileDialog1.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.*"; openFileDialog1.FileName = ""; if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { fBrowse fb = new fBrowse(AtMng, 0, false, false, false, true); if (fb.ShowDialog() == System.Windows.Forms.DialogResult.OK) { int fid = fb.SelectedFile.FileId; AtMng.GetIssue().Import(openFileDialog1.FileName, 0, 0, fid); } } break; case "cmdExport": saveFileDialog1.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.*"; saveFileDialog1.FileName = "issue" + DateTime.Today.ToString("yyyyMMdd") + ".xml"; if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { AtMng.GetIssue().Export(saveFileDialog1.FileName); } break; case "cmdCancel": Cancel(); break; case "cmdNew": New(); break; case "cmdSave": Save(); break; case "cmdDelete": Delete(); break; case "cmdToggle": if (cmdToggle.Checked != Janus.Windows.UI.InheritableBoolean.True) { treeView1.ExpandAll(); } else { treeView1.CollapseAll(); } break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { Janus.Windows.UI.CommandBars.UICommandBar bar = uiCommandManager1.CommandBars[1]; if (bar.Commands.Contains(e.Command.Key) && bar.Commands[e.Command.Key].Commands.Count > 0) { bar.Commands[e.Command.Key].Expand(); } switch (e.Command.Key) { case "cmdSetLayout": lmWinHelper.LoadGridLayout(timeSlipGridEX, "TimeslipGridExUser", LayoutVersionNumber); sRPGridEX.MoveFirst(); TimeslipReadOnly(!CurrentRowSRP().IsSRPSubmittedDateNull()); ToggleGridGroups(); if (timeSlipGridEX.FilterMode == Janus.Windows.GridEX.FilterMode.None) { cmdFilter.IsChecked = false; } else { cmdFilter.IsChecked = true; } break; case "cmdResetGridToAppLayout": if (gridLayoutStream != null) { gridLayoutStream.Position = 0; ClearData(); BindTimeSlipData(FM.DB.SRP); timeSlipGridEX.LoadLayoutFile(gridLayoutStream); UIHelper.ComboBoxInit("vOfficerList", timeSlipGridEX.DropDowns["ddOfficer"], FM); cmdFilter.IsChecked = false; timeSlipGridEX.Refetch(); sRPGridEX.MoveFirst(); TimeslipReadOnly(!CurrentRowSRP().IsSRPSubmittedDateNull()); ToggleGridGroups(); } break; case "cmdStoreLayout": lmWinHelper.UpdateLayout(timeSlipGridEX); lmWinHelper.SaveGridLayout(timeSlipGridEX, "TimeslipGridExUser", FM.AtMng, LayoutVersionNumber); break; case "cmdCloseTimeSlip": if (MessageBox.Show(LawMate.Properties.Resources.AreYouSureYouWantToCloseTimekeeping, LawMate.Properties.Resources.TimekeepingPeriodClosure, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { int selectedSRPid = CurrentRowSRP().SRPID; FM.GetSRP().CloseActivityTimePeriod(CurrentRowSRP().SRPID); foreach (appDB.TimeSlipRow tsdr in TSdt.Select("SRPID is null and StartTime >= '" + CurrentRowSRP().SRPDate + "' and StartTime <= '" + CurrentRowSRP().SRPDate.AddMonths(1).AddMinutes(-1) + "'", "FileId")) { if (!FileIDsInSRP.Contains(tsdr.FileId)) { FileIDsInSRP.Add(tsdr.FileId); } } ((fFile)ParentForm).MainForm.PostSubmitTimekeepingReloadActivityTime(FileIDsInSRP); ReloadUserControlData(); ((fFile)ParentForm).GetUcCtlToc("timeslip", "SRP", selectedSRPid); //sRPBindingSource.Position = sRPBindingSource.Find("SRPID", selectedSRPid); } break; case "cmdFilter": if (e.Command.IsChecked) { timeSlipGridEX.FilterMode = Janus.Windows.GridEX.FilterMode.Automatic; } else { timeSlipGridEX.FilterMode = Janus.Windows.GridEX.FilterMode.None; } break; case "cmdFieldChooser": timeSlipGridEX.ShowFieldChooser(this.ParentForm, LawMate.Properties.Resources.FieldSelector); break; case "cmdRefresh": //int currentSRP = CurrentRowSRP().SRPID; ReloadUserControlData(); //((fFile)ParentForm).GetUcCtlToc("timeslip", "SRP", currentSRP); break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { Janus.Windows.UI.CommandBars.UICommandBar bar = uiCommandManager1.CommandBars["cbMergeToolbar"]; if (bar.Commands.Contains(e.Command.Key) && bar.Commands[e.Command.Key].Commands.Count > 0) { bar.Commands[e.Command.Key].Expand(); } switch (e.Command.Key) { case "cmdLinkOpinion": HookupNewOpinionDoc(true); break; case "cmdLinkRequest": HookupNewOpinionDoc(false); break; case "tsSave": Save(); break; case "tsShowOpinion": if (e.Command.IsChecked) { DisplayDoc(dvOpinion); tsShowRequest.IsChecked = false; } else { tsShowOpinion.IsChecked = true; } break; case "tsShowRequest": if (e.Command.IsChecked) { DisplayDoc(dvRequest); tsShowOpinion.IsChecked = false; } else { tsShowRequest.IsChecked = true; } break; case "tsDelete": Delete(); break; case "tsAudit": fData fAudit = new fData(CurrentRow()); fAudit.Show(); break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }