// ////////////////////////////////////////////////////////////////////////
        // INITIAL EVENTS
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            // Register client scripts
            this.RegisterClientScripts();

            if (!IsPostBack)
            {
                // Security check
                if ((!Convert.ToBoolean(Session["sgLFS_RESOURCES_UNITSOFMEASUREMENT_VIEW"])) && (!Convert.ToBoolean(Session["sgLFS_RESOURCES_UNITSOFMEASUREMENT_ADD"])) && (!Convert.ToBoolean(Session["sgLFS_RESOURCES_UNITSOFMEASUREMENT_EDIT"])) && (!Convert.ToBoolean(Session["sgLFS_RESOURCES_UNITSOFMEASUREMENT_DELETE"])) )
                {
                    Response.Redirect("./../../error_page.aspx?error=" + "You are not authorized to view this page. Contact your system administrator.");
                }

                // Validate query string
                if ((string)Request.QueryString["source_page"] == null)
                {
                    Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in unitsOfMeasurement_navigator.aspx");
                }

                // Tag Page
                Session.Remove("unitOfMeasurementDummy");
                hdfCompanyId.Value = Session["companyID"].ToString();

                // If coming from out
                if (((string)Request.QueryString["source_page"] == "out") || ((string)Request.QueryString["source_page"] == "unitsOfMeasurement_navigator.aspx"))
                {
                    unitsOfMeasurementNavigatorTDS = new UnitsOfMeasurementNavigatorTDS();

                    // Get unitsOfMeasurement records
                    int companyId = Int32.Parse(hdfCompanyId.Value);
                    UnitsOfMeasurementNavigatorGateway unitsOfMeasurementNavigatorGateway = new UnitsOfMeasurementNavigatorGateway(unitsOfMeasurementNavigatorTDS);
                    unitsOfMeasurementNavigatorGateway.LoadAll(companyId);

                    // Store dataset
                    Session["unitsOfMeasurementNavigatorTDS"] = unitsOfMeasurementNavigatorTDS;
                    Session["unitsOfMeasurementNavigator"] = unitsOfMeasurementNavigatorTDS.UnitsOfMeasurementNavigator;
                    unitsOfMeasurementNavigator = unitsOfMeasurementNavigatorTDS.UnitsOfMeasurementNavigator;
                }

                // Databind
                Page.DataBind();
            }
            else
            {
                // Restore dataset
                unitsOfMeasurementNavigatorTDS = (UnitsOfMeasurementNavigatorTDS)Session["unitsOfMeasurementNavigatorTDS"];
                unitsOfMeasurementNavigator = unitsOfMeasurementNavigatorTDS.UnitsOfMeasurementNavigator;
            }
        }
 // ////////////////////////////////////////////////////////////////////////
 // PUBLIC METHODS
 //
 /// <summary>
 /// LoadAll
 /// </summary>
 /// <param name="companyId">companyId</param>        
 public void LoadAll(int companyId)
 {
     UnitsOfMeasurementNavigatorGateway unitsOfMeasurementNavigatorGateway = new UnitsOfMeasurementNavigatorGateway(Data);
     unitsOfMeasurementNavigatorGateway.LoadAll(companyId);
 }