GIF89;a
GIF89;a
#region Usages
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections;
using System.Collections.Specialized;
using System.Threading;
using System.Globalization;
using System.Text;
using System.Resources;
using System.Reflection;
using System.IO;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Globals;
#endregion
///
/// Summary description for BasePage
///
public class BasePage : System.Web.UI.Page
{
public string dir;
protected string alignLeft;
protected string alignRight;
protected HorizontalAlign horizAlign;
protected string PageUpdatedDate = string.Empty;
#region Costructors
public BasePage()
{
}
protected void Page_Load_Base(object sender, EventArgs e)
{
}
#endregion
protected override void InitializeCulture()
{
#region Language & Culture
string _sUserLanguage = "he";
// Set current culture for current user request thread
Thread.CurrentThread
.CurrentCulture = CultureInfo.CreateSpecificCulture(_sUserLanguage);
CultureInfo myCI = new CultureInfo("en-US", false);
CultureInfo myCIclone = (CultureInfo)myCI.Clone();
myCIclone.DateTimeFormat.AMDesignator = "";
myCIclone.DateTimeFormat.PMDesignator = "";
myCIclone.DateTimeFormat.LongDatePattern = "dd/MM/yyyy";
myCIclone.DateTimeFormat.DateSeparator = "/";
myCIclone.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy";
myCIclone.NumberFormat.CurrencySymbol = "USD";
myCIclone.NumberFormat.NumberDecimalDigits = 4;
System.Threading.Thread.CurrentThread.CurrentUICulture = myCIclone;
System.Threading.Thread.CurrentThread.CurrentCulture = myCIclone;
// Set culture that is used by ResourceManager to search
// localized resources
Thread.CurrentThread
.CurrentUICulture = CultureInfo.CreateSpecificCulture(_sUserLanguage);
// Set encoding of response to user request
this.Response.ContentEncoding =
Encoding.GetEncoding(65001);
this.Request.ContentEncoding = Encoding.GetEncoding(65001);
alignLeft = GetGlobalResourceObject("Common", "alignLeft").ToString();
alignRight = GetGlobalResourceObject("Common", "alignRight").ToString();
dir = GetGlobalResourceObject("Common", "dir").ToString();
if ("left".CompareTo(alignLeft.ToLower()) == 0)
horizAlign = HorizontalAlign.Left;
else
horizAlign = HorizontalAlign.Right;
#endregion
}
#region cose for AutoEventWireup="false"
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load_Base);
}
#endregion
#region Private Variables
bool m_refreshState = false;
bool m_isRefresh = false;
#endregion
#region Methods
protected System.Drawing.Color InbestColor(string p_value)
{
System.Drawing.Color color = new System.Drawing.Color();
color = System.Drawing.Color.Black;
if (Convert.ToDecimal(p_value) >= 100)
{
color = System.Drawing.Color.Green;
}
else if (Convert.ToDecimal(p_value) < 100)
{
color = System.Drawing.Color.Red;
}
return color;
}
///
/// /// Get page exchange parameter by it's name from the session storage
///
/// Parameter name
/// Parameter value
protected internal string GetPageParameter(string p_paramName)
{
return AppContextHelper.GetPageParameter(p_paramName);
}
///
/// Save page exchange parameter into the session storage
///
/// Parameter name
/// Parameter value
protected internal void SetPageParameter(string p_paramName, string p_paramValue)
{
AppContextHelper.SetPageParameter(p_paramName, p_paramValue);
}
///
/// Get page exchange parameters collection
///
/// Parameters collection
protected internal NameValueCollection GetPageParamsCollection()
{
return AppContextHelper.GetPageParamsCollection();
}
///
/// Delete page exchange parameters collection (clean memory)
///
protected internal void DeletePageParamsCollection()
{
AppContextHelper.DeletePageParamsCollection();
}
#endregion
#region Private Methods
#endregion
#region GoTo
protected internal void Go(string p_url)
{
Response.Redirect(p_url, true);
}
#endregion
#region Properties
protected int HelpPageId
{
set
{
m_helpPageId = value;
SetPageParameter("HelpPageId", m_helpPageId.ToString());
}
get
{
return m_helpPageId;
}
}protected int m_helpPageId = 0;
protected bool IsRefreshed
{
get { return m_isRefresh; }
}
protected CurrentPageId CurrentPage
{
set
{
if (value == CurrentPageId.Default)
{
Control connect = Page.Controls[0].Controls[0].FindControl("Sidebar1").FindControl("input_list");
if (connect != null)
{
connect.Visible = false;
Label title = (Label)Page.Controls[0].Controls[0].FindControl("Sidebar1").FindControl("Label2");
title.Text = Resources.Common.MainPage_Text5;
}
return;
}
m_localPage = value;
BusinessLayer.BOObjects.General general = new BusinessLayer.BOObjects.General();
if (m_localPage != CurrentPageId.Lid)
{
PageUpdatedDate = general.GetUpdatedDate(m_localPage).ToShortDateString();
SetPageParameter("CurrentPageId", ((int)m_localPage).ToString());
}
try
{
if (m_localPage == CurrentPageId.Main)
{
Control connect = Page.Controls[0].Controls[0].FindControl("Sidebar1").FindControl("input_list");
if (connect != null)
{
connect.Visible = false;
Label title = (Label)Page.Controls[0].Controls[0].FindControl("Sidebar1").FindControl("Label2");
title.Text = Resources.Common.MainPage_Text5;
}
}
else
{
Control text = Page.Controls[0].Controls[0].FindControl("Sidebar1").FindControl("divText");
if (text != null)
{
text.Visible = false;
Label title = (Label)Page.Controls[0].Controls[0].FindControl("Sidebar1").FindControl("Label2");
title.Text = Resources.Common.Title_2;
}
}
}
catch (Exception) { }
}
get
{
return m_localPage;
}
}protected CurrentPageId m_localPage = CurrentPageId.Default;
#endregion
}