private void explorerBar1_ItemClick(object sender, Janus.Windows.ExplorerBar.ItemEventArgs e) { try { Application.UseWaitCursor = true; if (!lookupsLoaded) { LoadLookups(); } Search srch = new Search(Atmng, eFileBindingSource); switch (e.Item.Key) { 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(); Application.UseWaitCursor = false; } catch (Exception x) { Application.UseWaitCursor = false; UIHelper.HandleUIException(x); } }
private void explorerBar1_ItemClick(object sender, Janus.Windows.ExplorerBar.ItemEventArgs e) { try { Application.UseWaitCursor = true; atLogic.WhereClause wcy = new atLogic.WhereClause(); if (e.Item.Key.StartsWith("ndChron")) { wcy.Add("d.docid", "in", "select docid from recipient where officerid = " + myAtmng.WorkingAsOfficer.OfficerId.ToString() + " and type=0"); } else { wcy.Add("d.docid", "in", "select docid from recipient where officerid = " + myAtmng.WorkingAsOfficer.OfficerId.ToString() + " and type in (1,2)"); } atLogic.WhereClause wcToExecute = wcy; bool executeSearch = true; switch (e.Item.Key) { case "ndCheckedOut": atLogic.WhereClause wc = new atLogic.WhereClause(); wc.Add("CheckedoutBy", "=", myAtmng.WorkingAsOfficer.OfficerId); wcToExecute = wc; break; case "ndDrafts": atLogic.WhereClause wcDrafts = new atLogic.WhereClause(); wcDrafts.Add("d.OfficerId", "=", myAtmng.WorkingAsOfficer.OfficerId); wcDrafts.Add("d.IsDraft", "=", true); wcToExecute = wcDrafts; break; case "ndChronToday": wcy.Add("d.efDate", "Between", atDates.StandardDate.Today.BeginDate, atDates.StandardDate.Today.EndDate); break; case "ndChronYesterday": wcy.Add("d.efDate", "Between", atDates.StandardDate.Yesterday.BeginDate, atDates.StandardDate.Yesterday.EndDate); break; case "ndChronThisWeek": wcy.Add("d.efDate", "Between", atDates.StandardDate.ThisWeek.BeginDate, atDates.StandardDate.ThisWeek.EndDate); break; case "ndChronLastWeek": wcy.Add("d.efDate", "Between", atDates.StandardDate.LastWeek.BeginDate, atDates.StandardDate.LastWeek.EndDate); break; case "ndChronCustom": fCustomDateRange fDateRange = new fCustomDateRange(); if (fDateRange.ShowDialog() == DialogResult.OK) { wcy.Add("d.efDate", "Between", (DateTime)fDateRange.BeginDate, (DateTime)fDateRange.EndDate); } else { executeSearch = false; } break; case "ndRecToday": wcy.Add("d.efDate", "Between", atDates.StandardDate.Today.BeginDate, atDates.StandardDate.Today.EndDate); break; case "ndRecYesterday": wcy.Add("d.efDate", "Between", atDates.StandardDate.Yesterday.BeginDate, atDates.StandardDate.Yesterday.EndDate); break; case "ndRecThisWeek": wcy.Add("d.efDate", "Between", atDates.StandardDate.ThisWeek.BeginDate, atDates.StandardDate.ThisWeek.EndDate); break; case "ndRecLastWeek": wcy.Add("d.efDate", "Between", atDates.StandardDate.LastWeek.BeginDate, atDates.StandardDate.LastWeek.EndDate); break; case "ndRecCustom": fCustomDateRange fDateRange2 = new fCustomDateRange(); if (fDateRange2.ShowDialog() == DialogResult.OK) { wcy.Add("d.efDate", "Between", (DateTime)fDateRange2.BeginDate, (DateTime)fDateRange2.EndDate); } else { executeSearch = false; } break; default: executeSearch = false; break; } if (executeSearch) { myDM.GetDocument().PreRefresh(); myDM.GetDocument().Search(wcToExecute, false); PostDataLoad(myDM); ucRecordList1.SearchResult(true); } Application.UseWaitCursor = false; } catch (Exception x) { Application.UseWaitCursor = false; UIHelper.HandleUIException(x); } }