Ejemplo n.º 1
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (ddlPropType.SelectedItem.ToString() == "Object Type")
        {
            ddlBaseType2.SelectedValue = gvProperties.DataKeys[gvProperties.SelectedIndex]["property_object_type"].ToString();
            ddlBaseType2.Visible       = true;
            lblPropObjectType.Visible  = true;
        }
        else
        {
            ddlBaseType2.SelectedValue = "";
            ddlBaseType2.Visible       = false;
            lblPropObjectType.Visible  = false;
        }

        if (hdnSelectedStateRow.Text != "")
        {
            txtStateName.Text    = gvStates.DataKeys[Int32.Parse(hdnSelectedStateRow.Text)]["state_name"].ToString();//hdnSelectedStateName.Text;
            txtStateLabel.Text   = gvStates.DataKeys[Int32.Parse(hdnSelectedStateRow.Text)]["state_label"].ToString();
            txtStateTooltip.Text = gvStates.DataKeys[Int32.Parse(hdnSelectedStateRow.Text)]["state_tooltip"].ToString();
        }
        if (hdnSelectedMethodRow.Text != "")
        {
            txtMethodName.Text    = gvMethods.DataKeys[Int32.Parse(hdnSelectedMethodRow.Text)]["method_name"].ToString();//hdnSelectedMethodName.Text;
            txtMethodLabel.Text   = gvMethods.DataKeys[Int32.Parse(hdnSelectedMethodRow.Text)]["method_label"].ToString();
            txtParam1Label.Text   = gvMethods.DataKeys[Int32.Parse(hdnSelectedMethodRow.Text)]["param_1_label"].ToString();
            txtParam2Label.Text   = gvMethods.DataKeys[Int32.Parse(hdnSelectedMethodRow.Text)]["param_2_label"].ToString();
            txtParam1Default.Text = gvMethods.DataKeys[Int32.Parse(hdnSelectedMethodRow.Text)]["param_1_default"].ToString();
            txtParam2Default.Text = gvMethods.DataKeys[Int32.Parse(hdnSelectedMethodRow.Text)]["param_2_default"].ToString();
            txtMethodTooltip.Text = gvMethods.DataKeys[Int32.Parse(hdnSelectedMethodRow.Text)]["method_tooltip"].ToString();
        }
        if (hdnSelectedEventRow.Text != "")
        {
            txtEventName.Text    = gvEvents.DataKeys[Int32.Parse(hdnSelectedEventRow.Text)]["event_name"].ToString();//hdnSelectedEventName.Text;
            txtEventLabel.Text   = gvEvents.DataKeys[Int32.Parse(hdnSelectedEventRow.Text)]["event_label"].ToString();
            txtEventTooltip.Text = gvEvents.DataKeys[Int32.Parse(hdnSelectedEventRow.Text)]["event_tooltip"].ToString();
        }

        if (hdnSelectedObjectName.Text != "")
        {
            lblExportScript.Text = OSAEObjectTypeManager.ObjectTypeExport(hdnSelectedObjectName.Text);
        }
    }
    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (hdnSelectedRow.Text != "")
        {
            gvObjectTypes.Rows[Int32.Parse(hdnSelectedRow.Text)].Attributes.Remove("onmouseout");
            gvObjectTypes.Rows[Int32.Parse(hdnSelectedRow.Text)].Style.Add("background", "lightblue");
        }
        if (hdnSelectedPropRow.Text != "")
        {
            txtPropName.Text          = hdnSelectedPropName.Text;
            txtPropDefault.Text       = gvProperties.DataKeys[Int32.Parse(hdnSelectedPropRow.Text)]["property_default"].ToString();
            chkTrackChanges.Checked   = (bool)gvProperties.DataKeys[Int32.Parse(hdnSelectedPropRow.Text)]["track_history"];
            ddlPropType.SelectedValue = gvProperties.DataKeys[Int32.Parse(hdnSelectedPropRow.Text)]["property_datatype"].ToString();
            gvProperties.Rows[Int32.Parse(hdnSelectedPropRow.Text)].Attributes.Remove("onmouseout");
            gvProperties.Rows[Int32.Parse(hdnSelectedPropRow.Text)].Style.Add("background", "lightblue");
        }
        if (hdnSelectedStateRow.Text != "")
        {
            gvStates.Rows[Int32.Parse(hdnSelectedStateRow.Text)].Attributes.Remove("onmouseout");
            gvStates.Rows[Int32.Parse(hdnSelectedStateRow.Text)].Style.Add("background", "lightblue");
            txtStateName.Text  = hdnSelectedStateName.Text;
            txtStateLabel.Text = gvStates.DataKeys[Int32.Parse(hdnSelectedStateRow.Text)]["state_label"].ToString();
        }
        if (hdnSelectedMethodRow.Text != "")
        {
            gvMethods.Rows[Int32.Parse(hdnSelectedMethodRow.Text)].Attributes.Remove("onmouseout");
            gvMethods.Rows[Int32.Parse(hdnSelectedMethodRow.Text)].Style.Add("background", "lightblue");
            txtMethodName.Text    = hdnSelectedMethodName.Text;
            txtMethodLabel.Text   = gvMethods.DataKeys[Int32.Parse(hdnSelectedMethodRow.Text)]["method_label"].ToString();
            txtParam1Label.Text   = gvMethods.DataKeys[Int32.Parse(hdnSelectedMethodRow.Text)]["param_1_label"].ToString();
            txtParam2Label.Text   = gvMethods.DataKeys[Int32.Parse(hdnSelectedMethodRow.Text)]["param_2_label"].ToString();
            txtParam1Default.Text = gvMethods.DataKeys[Int32.Parse(hdnSelectedMethodRow.Text)]["param_1_default"].ToString();
            txtParam2Default.Text = gvMethods.DataKeys[Int32.Parse(hdnSelectedMethodRow.Text)]["param_2_default"].ToString();
        }
        if (hdnSelectedEventRow.Text != "")
        {
            gvEvents.Rows[Int32.Parse(hdnSelectedEventRow.Text)].Attributes.Remove("onmouseout");
            gvEvents.Rows[Int32.Parse(hdnSelectedEventRow.Text)].Style.Add("background", "lightblue");
            txtEventName.Text  = hdnSelectedEventName.Text;
            txtEventLabel.Text = gvEvents.DataKeys[Int32.Parse(hdnSelectedEventRow.Text)]["event_label"].ToString();
        }

        if (hdnSelectedObjectName.Text != "")
        {
            lblExportScript.Text = OSAEObjectTypeManager.ObjectTypeExport(hdnSelectedObjectName.Text);
            // lblExportScript.Text = OSAEObjectTypeManager.ObjectTypeExport(hdnSelectedObjectName.Text).Replace(";",";" + Environment.NewLine);
            // lblExportScript.Text = "Line 1 " + Environment.NewLine + "Line 2";
        }
        //if (gvMethods.Rows.Count == 0)
        //    divMethods.Visible = false;
        //else
        //    divMethods.Visible = true;

        //if (gvStates.Rows.Count == 0)
        //    divStates.Visible = false;
        //else
        //    divStates.Visible = true;

        //if (gvProperties.Rows.Count == 0)
        //    divProps.Visible = false;
        //else
        //    divProps.Visible = true;

        //if (gvEvents.Rows.Count == 0)
        //    divEvents.Visible = false;
        //else
        //    divEvents.Visible = true;
    }