private void LoadPreviousActionOptions(String actionId) { dbHelper helper = new dbHelper(); _listActOpt.Clear(); _listActOpt = helper.GetActionOptionsForAction(actionId); ActionOptions itemActOpt; TextBox tx; CheckBox ck; RadioButtonList rd; DropDownList dd; if (MultiViewSpecific.GetActiveView() == ViewPostMessage) { rd = RadioButtonListPostMessage; } else { rd = RadioButtonListPostComment; } foreach (FlowActionOptions itemFlowActOpt in _listFlowActOpt) { if (itemFlowActOpt.FlowPosition == dt.Rows.Count) { itemActOpt = itemFlowActOpt.ActionOptions; if (itemActOpt.ControlName != null) { switch (itemActOpt.Options.OptionType) { case "textbox": tx = (TextBox)FindControl(itemActOpt.ControlName); if (tx != null) { tx.Text = itemFlowActOpt.Value; } break; case "check": ck = (CheckBox)FindControl(itemActOpt.ControlName); if (ck != null) { if (itemFlowActOpt.Value == "true") { ck.Checked = true; } else { ck.Checked = false; } } break; case "radio": if (itemFlowActOpt.Value == "true") { rd.SelectedValue = itemActOpt.ControlName; } if (itemActOpt.ControlName == "MultOptCom" && itemFlowActOpt.Value == "true") { dtOptions.Clear(); foreach (FlowMultiOptions itemFlowMultiOpt in _listFlowMultiOpt) { if (itemFlowMultiOpt.FlowPosition == dt.Rows.Count) { AddToDataTableOptions(itemFlowMultiOpt.OptionValue); } } BindGridOptions(); } break; case "dropdown": dd = (DropDownList)FindControl(itemActOpt.ControlName); if (dd != null) { dd.SelectedValue = itemFlowActOpt.Value; } break; } } } } ViewState["ActionOptions"] = _listActOpt; }
private void LoadActionOptions(String actionId) { dbHelper helper = new dbHelper(); _listActOpt.Clear(); _listActOpt = helper.GetActionOptionsForAction(actionId); TextBox tx; CheckBox ck; RadioButtonList rd; DropDownList dd; if (MultiViewSpecific.GetActiveView() == ViewPostMessage) { rd = RadioButtonListPostMessage; } else { rd = RadioButtonListPostComment; } foreach (ActionOptions itemActOpt in _listActOpt) { if (itemActOpt.ControlName != null) { switch (itemActOpt.Options.OptionType) { case "textbox": tx = (TextBox)FindControl(itemActOpt.ControlName); if (tx != null) { tx.Text = itemActOpt.DefaultValue; } break; case "check": ck = (CheckBox)FindControl(itemActOpt.ControlName); if (ck != null) { if (itemActOpt.DefaultValue == "true") { ck.Checked = true; } else { ck.Checked = false; } } break; case "radio": if (itemActOpt.DefaultValue == "true") { rd.SelectedValue = itemActOpt.ControlName; } break; case "dropdown": dd = (DropDownList)FindControl(itemActOpt.ControlName); if (dd != null) { dd.SelectedValue = itemActOpt.DefaultValue; } break; } } } ViewState["ActionOptions"] = _listActOpt; }