Skip Navigation Links.

Northwind\WebControls\WebCustomControlWCCBase.cs

D:\NorthwindForWeb\Northwind\CS\DotNet\ADO.Net\Northwind\WebControls\WebCustomControlWCCBase.cs
/*
 * This file was generated by ProCG version 2.0
 *
 * File name:	Northwind\WebControls\WebCustomControlWCCBase.cs
 * Language:	C# - ADO.Net 
 * Database:	My Sql
 *
 * Copyright (c) 2002-2019 iGenXSoft.
 * For more information visit http://www.igenxsoft.com
 */

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using Northwind.General;
using Northwind.Data;
using Northwind.WebControls;

namespace Northwind.WebControls
{
	/// <summary>
	/// Summary description for WebCustomControlWCC.
	/// </summary>
	[DefaultProperty("Value"), 
	ToolboxData("<{0}:WebCustomControlWCCBase runat=server></{0}:WebCustomControlWCCBase>")]
	public abstract class WebCustomControlWCCBase : System.Web.UI.WebControls.CompositeControl, IWebCustomControl
	{
		public int m_DataRowIndex;
		protected CStructData m_StructData;
		protected int m_FieldNum;
		protected Northwind.General.WebCustomeControlPlaceEnum m_CustomeControlPlace;
		protected Northwind.General.FieldShowModeEnum	m_FieldShowMode;
		protected DataManager m_DataManager;
		protected Northwind.WebControls.NorthwindWebEnv m_WebEnv;


		public int DataRowIndex
		{
			get 
			{
				if (m_DataRowIndex == 0)
				{
					if (this.ViewState["DataRowIndex"] != null)
						m_DataRowIndex = (int)this.ViewState["DataRowIndex"];
				}

				return m_DataRowIndex; 
			}
			set 
			{
				this.ViewState["DataRowIndex"] = value;
				m_DataRowIndex = value; 
			}

		}

		public string Value
		{
			get
			{
				EnsureChildControls();
				InternalValue = GetCurrentControlValue();
				return InternalValue;
			}
			set
			{
				EnsureChildControls();
				InternalValue = value;
				SetCurrentControlValue(value);
			}
		}

		protected string InternalValue
		{
			get
			{
				EnsureChildControls();
				System.Diagnostics.Debug.Assert(ViewState["Value"] != null);
				return (string)this.ViewState["Value"];
			}
			set
			{
				EnsureChildControls();
				this.ViewState["Value"] = value;
			}
		}

		protected abstract void SetCurrentControlValue(string value);

		protected abstract string GetCurrentControlValue();

		protected override void CreateChildControls()
		{
			throw new NotImplementedException("CreateChildControls() not implemented in "+this.GetType().ToString());
			
			/*
			if (this.FieldShowMode == FieldShowModeEnum.SHOW_NORMAL)
			{
				System.Web.UI.UpdatePanel updatePanel = new UpdatePanel();
				updatePanel.ID = "updatePanel";

				System.Web.UI.WebControls.Literal literal;

				m_Calendar = new Calendar();
				m_Calendar.ID = "Calendar";
				m_Calendar.SelectionChanged += new EventHandler(DateTime_Changed);
				updatePanel.ContentTemplateContainer.Controls.Add(m_Calendar);
				this.Controls.Add(updatePanel);
			}
			else if (FieldShowMode == FieldShowModeEnum.SHOW_READ_ONLY)
			{
				m_DateTimeLabel = new Label();
				this.Controls.Add(m_DateTimeLabel);
			}
			*/
		}


		protected virtual void UpdateField(string value)
		{
			System.Diagnostics.Debug.Assert(StructData != null && FieldNum != 0);
			StructData.SetFieldStringValue(FieldNum, value);
		}


		#region IWebCustomControl Members

		public void SetCustomeControlPlace(Northwind.General.WebCustomeControlPlaceEnum customeControlPlace)
		{
			m_CustomeControlPlace = customeControlPlace;
		}

		public Northwind.General.FieldShowModeEnum FieldShowMode
		{
			get
			{
				if (ViewState["FieldShowMode"] != null)
					m_FieldShowMode = (Northwind.General.FieldShowModeEnum)ViewState["FieldShowMode"];
				return m_FieldShowMode;
			}
			set
			{
				ViewState["FieldShowMode"] = value;
				m_FieldShowMode = value;
			}
		}

		public WebCustomeControlPlaceEnum WebCustomeControlPlace
		{
			get
			{
				if (ViewState["CustomeControlPlace"] != null)
					m_CustomeControlPlace = (WebCustomeControlPlaceEnum)ViewState["CustomeControlPlace"];
				return m_CustomeControlPlace;
			}
			set
			{
				ViewState["CustomeControlPlace"] = value;
				m_CustomeControlPlace = value;
			}
		}

		public virtual CStructData StructData
		{
			get 
			{
				if (m_StructData == null)
				{
					Control control = this.Parent;
					while (control != null)
					{
						if (control is NorthwindGrid)
						{
							IStructDataCollection structDataCollection = (IStructDataCollection)(control as NorthwindGrid).RowsData;
							m_StructData = structDataCollection.GetAtReturnsStructData(DataRowIndex);
							break;
						}
						if (control is NorthwindWCC)
						{
							m_StructData = (CStructData)(control as NorthwindWCC).Data;
							break;
						}
						control = control.Parent;
					}
					if (m_StructData == null)
						throw new Exception("Struct Data is null in "+this.GetType().ToString());
				}
				return m_StructData; 
			}
			set 
			{
				Control control = this.Parent;
				while (control != null)
				{
					if (control is NorthwindGrid)
					{
						IStructDataCollection structDataCollection = (IStructDataCollection)(control as NorthwindGrid).RowsData;
						structDataCollection[DataRowIndex] = value;
						break;
					}
					if (control is NorthwindWCC)
					{
						(control as NorthwindWCC).Data = value;
						break;
					}
					control = control.Parent;
				}
 
				m_StructData = value; 
			}
		}

		public int FieldNum
		{
			get 
			{
				if (m_FieldNum == 0)
				{
					if (this.ViewState["FieldNum"] != null)
						m_FieldNum = (int)this.ViewState["FieldNum"];
				}

				return m_FieldNum; 
			}
			set 
			{
				this.ViewState["FieldNum"] = value;
				m_FieldNum = value; 
			}
		}

		#endregion

		public DataManager DataManager
		{
			get
			{
				if (m_DataManager == null)
				{
					if (this.Page is NorthwindPage)
						m_DataManager = (this.Page as NorthwindPage).DataManager;
					else
						throw new Exception("This control can be only in page type NorthwindPage");
				}
				return m_DataManager;
			}
			set { m_DataManager = value; }
		}

		public Northwind.WebControls.NorthwindWebEnv  WebEnv
		{
			get { return m_WebEnv;}
			set { m_WebEnv = value;}
		}

	}
}


  //      6290 ProCG uses this line - don't edit it

2020 © iGenXSoft ProCG Generated Codes
pompy wtryskowe|cheap huarache shoes| bombas inyeccion|cheap jordans|cheap air max| cheap sneaker|wholesale jordans|cheap china jordans|cheap wholesale jordans