using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using GZTW.AyaNova.BLL;
using Infragistics.Win.UltraWinGrid;
using Infragistics.Win;
using log4net;
namespace AyaNova
{
///
/// Summary description for NotifyDeliveryLogsForm.
///
public class NotifyDeliveryLogsForm : System.Windows.Forms.Form
{
// Create a logger for use in this class
//case 1039 private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private Infragistics.Win.UltraWinGrid.UltraGrid Grid;
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _NotifyDeliveryLogsForm_Toolbars_Dock_Area_Left;
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _NotifyDeliveryLogsForm_Toolbars_Dock_Area_Right;
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _NotifyDeliveryLogsForm_Toolbars_Dock_Area_Top;
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _NotifyDeliveryLogsForm_Toolbars_Dock_Area_Bottom;
private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager ToolBarManager;
private GZTW.WinForm.Controls.GZDateTimePicker GridCalendar;
private System.ComponentModel.IContainer components;
public NotifyDeliveryLogsForm()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
//
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
Infragistics.Win.UltraWinToolbars.UltraToolbar ultraToolbar1 = new Infragistics.Win.UltraWinToolbars.UltraToolbar("SecurityGroupsToolBar");
Infragistics.Win.UltraWinToolbars.PopupMenuTool popupMenuTool1 = new Infragistics.Win.UltraWinToolbars.PopupMenuTool("LT:UI.Toolbar.Print");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool1 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Toolbar.Refresh");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool2 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Toolbar.Refresh");
Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinToolbars.ListTool listTool1 = new Infragistics.Win.UltraWinToolbars.ListTool("REPORTLIST");
Infragistics.Win.UltraWinToolbars.PopupMenuTool popupMenuTool2 = new Infragistics.Win.UltraWinToolbars.PopupMenuTool("LT:UI.Toolbar.Print");
Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinToolbars.ListTool listTool2 = new Infragistics.Win.UltraWinToolbars.ListTool("REPORTLIST");
this.Grid = new Infragistics.Win.UltraWinGrid.UltraGrid();
this.ToolBarManager = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components);
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
this.GridCalendar = new GZTW.WinForm.Controls.GZDateTimePicker();
((System.ComponentModel.ISupportInitialize)(this.Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ToolBarManager)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.GridCalendar)).BeginInit();
this.SuspendLayout();
//
// Grid
//
this.Grid.Cursor = System.Windows.Forms.Cursors.Default;
this.Grid.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.Sychronized;
this.Grid.DisplayLayout.Override.RowSizingArea = Infragistics.Win.UltraWinGrid.RowSizingArea.EntireRow;
this.Grid.Dock = System.Windows.Forms.DockStyle.Fill;
this.Grid.Location = new System.Drawing.Point(0, 26);
this.Grid.Name = "Grid";
this.Grid.Size = new System.Drawing.Size(536, 499);
this.Grid.TabIndex = 1;
this.Grid.Text = "NotifyDeliveryLog form";
this.Grid.InitializeRow += new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(this.Grid_InitializeRow);
this.Grid.AfterColPosChanged += new Infragistics.Win.UltraWinGrid.AfterColPosChangedEventHandler(this.Grid_AfterColPosChanged);
this.Grid.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Grid_MouseDown);
//
// ToolBarManager
//
this.ToolBarManager.DesignerFlags = 1;
this.ToolBarManager.DockWithinContainer = this;
this.ToolBarManager.DockWithinContainerBaseType = typeof(System.Windows.Forms.Form);
this.ToolBarManager.MdiMergeable = false;
this.ToolBarManager.ShowFullMenusDelay = 500;
ultraToolbar1.DockedColumn = 0;
ultraToolbar1.DockedRow = 0;
ultraToolbar1.NonInheritedTools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
popupMenuTool1,
buttonTool1});
ultraToolbar1.Text = "NotifydeliverylogsToolBar";
this.ToolBarManager.Toolbars.AddRange(new Infragistics.Win.UltraWinToolbars.UltraToolbar[] {
ultraToolbar1});
this.ToolBarManager.ToolbarSettings.AllowCustomize = Infragistics.Win.DefaultableBoolean.False;
this.ToolBarManager.ToolbarSettings.AllowFloating = Infragistics.Win.DefaultableBoolean.False;
this.ToolBarManager.ToolbarSettings.AllowHiding = Infragistics.Win.DefaultableBoolean.False;
appearance1.Image = global::AyaNova.Resource1.Refresh32;
buttonTool2.SharedPropsInternal.AppearancesLarge.Appearance = appearance1;
appearance2.Image = global::AyaNova.Resource1.Refresh16;
buttonTool2.SharedPropsInternal.AppearancesSmall.Appearance = appearance2;
buttonTool2.SharedPropsInternal.Caption = "LT:UI.Toolbar.Refresh";
buttonTool2.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
listTool1.DisplayCheckmark = false;
appearance3.Image = global::AyaNova.Resource1.Print32;
popupMenuTool2.SharedPropsInternal.AppearancesLarge.Appearance = appearance3;
appearance4.Image = global::AyaNova.Resource1.Print16;
popupMenuTool2.SharedPropsInternal.AppearancesSmall.Appearance = appearance4;
popupMenuTool2.SharedPropsInternal.Caption = "LT:UI.Toolbar.Print";
popupMenuTool2.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageOnlyOnToolbars;
popupMenuTool2.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
listTool2});
this.ToolBarManager.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
buttonTool2,
listTool1,
popupMenuTool2});
this.ToolBarManager.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.ToolBarManager_ToolClick);
//
// _NotifyDeliveryLogsForm_Toolbars_Dock_Area_Left
//
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Left.BackColor = System.Drawing.SystemColors.Control;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 26);
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Left.Name = "_NotifyDeliveryLogsForm_Toolbars_Dock_Area_Left";
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 499);
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Left.ToolbarsManager = this.ToolBarManager;
//
// _NotifyDeliveryLogsForm_Toolbars_Dock_Area_Right
//
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Right.BackColor = System.Drawing.SystemColors.Control;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(536, 26);
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Right.Name = "_NotifyDeliveryLogsForm_Toolbars_Dock_Area_Right";
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 499);
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Right.ToolbarsManager = this.ToolBarManager;
//
// _NotifyDeliveryLogsForm_Toolbars_Dock_Area_Top
//
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Top.BackColor = System.Drawing.SystemColors.Control;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0);
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Top.Name = "_NotifyDeliveryLogsForm_Toolbars_Dock_Area_Top";
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(536, 26);
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Top.ToolbarsManager = this.ToolBarManager;
//
// _NotifyDeliveryLogsForm_Toolbars_Dock_Area_Bottom
//
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.SystemColors.Control;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText;
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 525);
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Bottom.Name = "_NotifyDeliveryLogsForm_Toolbars_Dock_Area_Bottom";
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(536, 0);
this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.ToolBarManager;
//
// GridCalendar
//
this.GridCalendar.GZEnabled = true;
this.GridCalendar.GZReadOnly = false;
this.GridCalendar.Location = new System.Drawing.Point(259, 291);
this.GridCalendar.Name = "GridCalendar";
this.GridCalendar.Size = new System.Drawing.Size(125, 24);
this.GridCalendar.TabIndex = 152;
this.GridCalendar.Visible = false;
//
// NotifyDeliveryLogsForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
this.ClientSize = new System.Drawing.Size(536, 525);
this.ControlBox = false;
this.Controls.Add(this.Grid);
this.Controls.Add(this.GridCalendar);
this.Controls.Add(this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Left);
this.Controls.Add(this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Right);
this.Controls.Add(this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Bottom);
this.Controls.Add(this._NotifyDeliveryLogsForm_Toolbars_Dock_Area_Top);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "NotifyDeliveryLogsForm";
this.Text = "NotifyDeliveryLogsForm";
this.Closing += new System.ComponentModel.CancelEventHandler(this.Form_Closing);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.NotifyDeliveryLogsForm_FormClosing);
this.Load += new System.EventHandler(this.Form_Load);
this.VisibleChanged += new System.EventHandler(this.NotifyDeliveryLogsForm_VisibleChanged);
((System.ComponentModel.ISupportInitialize)(this.Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ToolBarManager)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.GridCalendar)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
// __ _ _ ___ ____ __ __ __ __ __ ___ ___
// / _)( )( )/ __)(_ _)/ \( \/ ) / _)/ \( \( _)
// ( (_ )()( \__ \ )( ( () )) ( ( (_( () )) ) )) _)
// \__) \__/ (___/ (__) \__/(_/\/\_) \__)\__/(___/(___)
//
#region Public props
private bool _AdminMode=false;
private bool _UpdateDisplay=false;
///
/// Show deliveries for all users if true else only for current logged in user
///
public bool AdminMode
{
set
{
if(_AdminMode!=value)
{
_AdminMode=value;
_UpdateDisplay=true;
}
}
}
#endregion
#region Grid Preparation, Display and Events
//variable to hold user form settings
//UIUserFormSetting mFormSetting;
private void Form_Load(object sender, System.EventArgs e)
{
//case 1039 //log.Debug("Form_Load");
Util.LoadFormCustomization("NotifyDeliveryLogsForm", this, ToolBarManager, true);
Grid.DataSource=NotifyDeliveryLogList.GetEmptyList();
Util.FetchGridLayout("NotifyDeliveryLog","",Grid);
if(!Grid.DisplayLayout.Bands[0].Columns.Exists("EventDescription"))
Grid.DisplayLayout.Bands[0].Columns.Add("EventDescription");
//GridCalendar.MaskInput=Util.LocaleDateTimeMask();
Grid.DisplayLayout.Override.HeaderClickAction=HeaderClickAction.SortSingle;
//Grid.DisplayLayout.Override.AllowUpdate=DefaultableBoolean.False;
Grid.DisplayLayout.Bands[0].Override.RowSelectors=DefaultableBoolean.False;
//Set the caption to be on the left side of the grid
Grid.DisplayLayout.CaptionAppearance.TextHAlign=HAlign.Left;
Grid.DisplayLayout.Bands[0].Columns["LT_NotifyDeliveryLog_Label_EventKey"].Hidden=true;
Grid.DisplayLayout.Bands[0].Columns["EventDescription"].Header.Caption=Util.LocaleText.GetLocalizedText("NotifySubscription.Label.EventDescription");
Grid.DisplayLayout.Override.AllowRowFiltering=DefaultableBoolean.True;
Grid.DisplayLayout.Bands[0].Columns["LT_NotifyDeliveryLog_Label_ErrorMessage"].CellMultiLine=DefaultableBoolean.True;
Grid.DisplayLayout.Bands[0].Columns["LT_NotifyDeliveryLog_Label_ErrorMessage"].AutoSizeEdit=DefaultableBoolean.True;
Grid.DisplayLayout.Bands[0].Columns["LT_NotifyDeliveryLog_Label_ErrorMessage"].VertScrollBar=true;
Grid.DisplayLayout.Bands[0].Columns["LT_NotifyDeliveryLog_Label_DeliveryDate"].EditorComponent=this.GridCalendar;
PopulateGridValueLists();
Util.Localize(this);
BindGrid(false);
foreach(UltraGridColumn c in Grid.DisplayLayout.Bands[0].Columns)
{
c.CellActivation=Activation.NoEdit;//.NoEdit;
}
if (AyaBizUtils.Right("Object.Report") < (int)SecurityLevelTypes.ReadOnly)
{
ToolBarManager.Tools["LT:UI.Toolbar.Print"].SharedProps.Visible = false;
}
else
{
ToolBarManager.Tools["LT:UI.Toolbar.Print"].SharedProps.Visible = true;
Util.ReportFillList(this.ToolBarManager.Tools["REPORTLIST"], NotifyDeliveryLogList.ReportKey, "");
}
//case 2108
Util.GridStyler(Grid);
}
///
/// When form closes it will save
/// (main form must call close on this form for this to work)
///
///
///
private void Form_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
//case 1039 //log.Debug("Form_Closing");
Util.SaveGridLayout("NotifyDeliveryLog","","List of NotifyDeliveryLog",Grid);
}
///
/// Add custom filters for dates, alphabetic ranges etc etc
///
///
///
private void Grid_BeforeRowFilterDropDown(object sender, Infragistics.Win.UltraWinGrid.BeforeRowFilterDropDownEventArgs e)
{
//case 1039 //log.Debug("Grid_BeforeRowFilterDropDown");
Util.SetCustomFilters(e);
}
// ///
// /// Intercept a sort change event
// /// This is to ensure that no columns other than first
// /// are sorted on
// ///
// ///
// ///
// private void Grid_BeforeSortChange(object sender, Infragistics.Win.UltraWinGrid.BeforeSortChangeEventArgs e)
// {
// //case 1039 //log.Debug("Grid_BeforeSortChange");
// //Did the user click on any other column than the first visible one?
// if(e.SortedColumns[0].Key!=Util.GetLeftMostColumnInBand(Grid.DisplayLayout.Bands[0]).Key)
// {
// e.Cancel=true;
// //Yes they did so don't do anything or allow sorting to happen
// return;
// }
//
//
// Grid.BeginUpdate();
// //display new list
// BindGrid(true);
//
// }
///
/// Intercept a filter change event
/// Set the grid to an empty list, this effectively
/// stops the grid from doing any time consuming work to filter the data
/// which we want done in the sql server in the afterfilterchanged event
///
///
///
///
private void Grid_BeforeRowFilterChanged(object sender, Infragistics.Win.UltraWinGrid.BeforeRowFilterChangedEventArgs e)
{//
////case 1039 //log.Debug("Grid_BeforeRowFilterChanged");
//Grid.BeginUpdate();
//Grid.DataSource=NotifyDeliveryLogList.GetEmptyList();
}
///
/// called when the user filters rows
///
///
///
private void Grid_AfterRowFilterChanged(object sender, Infragistics.Win.UltraWinGrid.AfterRowFilterChangedEventArgs e)
{
////case 1039 //log.Debug("Grid_AfterRowFilterChanged");
//BindGrid(false);
}
///
/// Called when the user repositions columns
///
///
///
private void Grid_AfterColPosChanged(object sender, Infragistics.Win.UltraWinGrid.AfterColPosChangedEventArgs e)
{
//case 1039 //log.Debug("Grid_AfterColPosChanged");
// //rebind if columns were moved only
// //i.e.don't do it if they were just resized
// if(e.PosChanged==Infragistics.Win.UltraWinGrid.PosChanged.Moved)
// {
// //disable refresh for a time
// Grid.BeginUpdate();
//
// //Deal with sort indicators on
// //newly positioned columns
// Util.HandleColPosChanged(Grid);
//
// //rebind to data source
// BindGrid(false);
// }
}
///
/// Rebind the control to the data source based on the latest
/// user filter and sort settings
///
private void BindGrid(bool bReverseSort)
{
//case 1039 //log.Debug("BindGrid - entering");
Cursor.Current=Cursors.WaitCursor;
Grid.DataSource=NotifyDeliveryLogList.GetList(this._AdminMode);
Grid.Text=Util.LocaleText.GetLocalizedText("NotifyDeliveryLog.Label.List")+" ("+Grid.Rows.FilteredInRowCount.ToString()+")";
bool bFiltered=(Grid.Rows.FilteredInRowCount<((NotifyDeliveryLogList)Grid.DataSource).Count);
Util.SetGridFilteredStyle(Grid,bFiltered);
//case 1039 //if(log.IsDebugEnabled) //case 1039 //log.Debug("BindGrid - finished (" + Grid.Text + ")");
Grid.EndUpdate();
Cursor.Current = Cursors.Default;
}
private void Grid_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
{
// if((bool)e.Row.Cells["LT_NotifyDeliveryLog_Label_Viewed"].Value==true)
// {
// e.Row.Appearance.FontData.Bold=DefaultableBoolean.False;
// }
// else
// {
// e.Row.Appearance.FontData.Bold=DefaultableBoolean.True;
// }
e.Row.Cells["EventDescription"].Value=
Util.LocaleText.GetLocalizedText((string)e.Row.Cells["LT_NotifyDeliveryLog_Label_EventKey"].Value);
}
///
/// Populate the drop down lists inside the grid
/// so they display and can select the correct underlying
/// value
///
private void PopulateGridValueLists()
{
//case 1039 //log.Debug("PopulateGridValueLists");
Grid.DisplayLayout.ValueLists.Clear();
//Populate NotifyDeliveryMethods
ValueList vl=Grid.DisplayLayout.ValueLists.Add("NotifyDeliveryMethods");
vl.ValueListItems.Add(NotifyDeliveryMethods.Memo,Util.LocaleText.GetLocalizedText("NotifyDeliveryMethods.Label.Memo"));
vl.ValueListItems.Add(NotifyDeliveryMethods.PopUp,Util.LocaleText.GetLocalizedText("NotifyDeliveryMethods.Label.PopUp"));
vl.ValueListItems.Add(NotifyDeliveryMethods.SMS,Util.LocaleText.GetLocalizedText("NotifyDeliveryMethods.Label.SMS"));
vl.ValueListItems.Add(NotifyDeliveryMethods.SMTP,Util.LocaleText.GetLocalizedText("NotifyDeliveryMethods.Label.SMTP"));
//Bind value lists to correct columns in grid
Grid.DisplayLayout.Bands[0].Columns["LT_O_NotifySubscriptionDelivery"].ValueList=Grid.DisplayLayout.ValueLists["NotifyDeliveryMethods"];
//Set column to dropdownlist style so that user can not type an invalid value in a cell
//but must select from the list only
Grid.DisplayLayout.Bands[0].Columns["LT_O_NotifySubscriptionDelivery"].Style=Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownValidate;//Case 96 for autocomplete (was DropDownList)
Grid.DisplayLayout.Bands[0].Columns["LT_O_NotifySubscriptionDelivery"].AutoCompleteMode = Infragistics.Win.AutoCompleteMode.SuggestAppend;
}
#endregion
#region Selection and Editing
Infragistics.Win.UIElement ElementLastClicked;
///
/// This is whacky Infragistics stuff, where normally we would
/// just do someting like override Row.OnDoubleClick we can't
/// do that with a grid because it's rows don't have a click event
///
/// To know which row is clicked on we need to always keep
/// track of what element of the grid was last clicked on
/// so that later on we can (in doubleclick) pre-know what was
/// clicked in the first click of the double click.
///
///
///
private void Grid_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
ElementLastClicked = Grid.DisplayLayout.UIElement.ElementFromPoint(new System.Drawing.Point(e.X, e.Y));
//Handle right click
if( e.Button == MouseButtons.Right)
{
GridNameValueCellItem nvb=Util.NameValueButtonRightClicked(Grid,e);
if(nvb!=null)
{
Util.DisplayObjectContextMenu(nvb.RootObjectType,nvb.Value,this);
}
else
{
UltraGridBand b=Util.BandRightClicked(Grid/*NAME OF GRID HERE, REST IS STOCK TO ANY FORM*/,e);
if(b!=null)
{
UtilGridColumnSelector c = new UtilGridColumnSelector();
c.HideColumns.Add("LT_NotifyDeliveryLog_Label_EventKey",0);
c.BandToEdit=b;
c.ShowDialog(this);
}
}
}
}
#endregion
#region MenuMerging
public Infragistics.Win.UltraWinToolbars.UltraToolbarsManager ToolBar
{
get
{
Util.Localize(ToolBarManager);
return ToolBarManager;
}
}
#endregion
#region Menu tool items
private void ToolBarManager_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
{
//case 1039 //if(log.IsDebugEnabled) //case 1039 //log.Debug("ToolClick: "+e.Tool.Key);
switch (e.Tool.Key)
{
case "LT:UI.Toolbar.Refresh": // ButtonTool
Grid.BeginUpdate();
BindGrid(false);
break;
case "REPORTLIST":
{
//if(Util.ReportHandleToolClickIsSummary(e.Tool))
Util.ReportHandleToolClick(e.Tool,NotifyDeliveryLogList.ReportKey,Grid.DataSource);
//else
//{
//bool bFiltered=false;
//Util.ReportHandleToolClick(e.Tool,ClientListDetailed.ReportKey,ClientListDetailed.GetListByCriteria(Util.GetGridSortAndFilterXML(Grid.DisplayLayout.Bands[0],false,ref bFiltered)));
//}
Util.ReportFillList(this.ToolBarManager.Tools["REPORTLIST"],NotifyDeliveryLogList.ReportKey,"");
break;
}
}
}
#endregion
///
/// This is to ensure that if a user goes from User's view to admin view
/// it will force a refresh
///
///
///
private void NotifyDeliveryLogsForm_VisibleChanged(object sender, System.EventArgs e)
{
if(_UpdateDisplay && this.Visible)
{
_UpdateDisplay=false;
BindGrid(false);
}
}
private void NotifyDeliveryLogsForm_FormClosing(object sender, FormClosingEventArgs e)
{
Util.SaveFormCustomization("NotifyDeliveryLogsForm", this, ToolBarManager, true);
}
}
}