Esempio n. 1
0
        private void createActionTable(String actionType, DataTable dt)
        {
            dbHelper             helper = new dbHelper();
            List <ActionInputs>  actionsInput;
            List <ActionOutputs> actionsOutput;

            List <Actions> actionsType = helper.GetActionsByType(actionType);

            foreach (Actions itemAction in actionsType)
            {
                actionsInput  = helper.GetActionInputsForAction(itemAction.ActionId);
                actionsOutput = helper.GetActionOutputsForAction(itemAction.ActionId);
                DataRow dr = dt.NewRow();
                if (actionsInput.Count > 0)
                {
                    dr["Input"] = actionsInput[0].InputObject;
                }
                else
                {
                    dr["Input"] = String.Empty;
                }
                dr["Name"] = itemAction.ActionName;
                if (actionsOutput.Count > 0)
                {
                    dr["Output"] = actionsOutput[0].OutputObject;
                }
                else
                {
                    dr["Output"] = String.Empty;
                }
                dt.Rows.Add(dr);
            }
        }
Esempio n. 2
0
        public String GetActionInput(String actionId)
        {
            dbHelper            helper = new dbHelper();
            List <ActionInputs> inputs = helper.GetActionInputsForAction(actionId);

            if (inputs.Count > 0)
            {
                return(inputs[0].InputObject);
            }
            else
            {
                return(String.Empty);
            }
        }
Esempio n. 3
0
        private void SaveActionOptions(int position)
        {
            FlowActionOptions fao;
            FlowActionInputs  faIn;
            FlowActionOutputs faOut;
            TextBox           tx;
            CheckBox          ck;
            RadioButtonList   rd;
            DropDownList      dd;

            _listFlowActOpt.RemoveAll(f => f.FlowPosition == position);
            _listFlowActInput.RemoveAll(f => f.FlowPosition == position);
            _listFlowActOutput.RemoveAll(f => f.FlowPosition == position);

            if (MultiViewSpecific.GetActiveView() == ViewPostMessage)
            {
                rd = RadioButtonListPostMessage;
            }
            else
            {
                rd = RadioButtonListPostComment;
            }
            foreach (ActionOptions itemActOpt in _listActOpt)
            {
                if (itemActOpt.ControlName != null)
                {
                    fao = new FlowActionOptions();
                    fao.ActionOptions = itemActOpt;
                    fao.FlowPosition  = position;
                    switch (itemActOpt.Options.OptionType)
                    {
                    case "textbox":
                        tx = (TextBox)FindControl(itemActOpt.ControlName);
                        if (tx != null)
                        {
                            fao.Value = tx.Text;
                        }
                        break;

                    case "check":
                        ck = (CheckBox)FindControl(itemActOpt.ControlName);
                        if (ck != null)
                        {
                            if (ck.Checked)
                            {
                                fao.Value = "true";
                            }
                            else
                            {
                                fao.Value = "false";
                            }
                        }
                        break;

                    case "radio":
                        if (rd.SelectedValue == itemActOpt.ControlName)
                        {
                            fao.Value = "true";
                        }
                        else
                        {
                            fao.Value = "false";
                        }

                        if (itemActOpt.ControlName == "MultOptCom" && fao.Value == "true")
                        {
                            FlowMultiOptions fmo;
                            _listFlowMultiOpt.RemoveAll(fm => fm.FlowPosition == position);
                            foreach (DataRow itemMultiOpt in dtOptions.Rows)
                            {
                                fmo = new FlowMultiOptions();
                                fmo.FlowPosition = position;
                                fmo.OptionValue  = itemMultiOpt["Option"].ToString();
                                _listFlowMultiOpt.Add(fmo);
                            }
                            if (dt.Rows.Count != position)
                            {
                                dtOptions.Clear();
                                AddToDataTableOptions("Add Options...");
                                BindGridOptions();
                            }
                        }
                        break;

                    case "dropdown":
                        dd = (DropDownList)FindControl(itemActOpt.ControlName);
                        if (dd != null)
                        {
                            fao.Value = dd.SelectedValue;
                        }
                        break;
                    }
                    _listFlowActOpt.Add(fao);
                }
            }
            dbHelper helper = new dbHelper();

            if (dt.Rows[position - 1].Field <String>("Input") != String.Empty)
            {
                List <ActionInputs> inputs = helper.GetActionInputsForAction(dt.Rows[position - 1].Field <String>("Id"));
                faIn = new FlowActionInputs();
                faIn.FlowPosition = position;
                faIn.ActionInputs = inputs[0];
                faIn.Value        = dt.Rows[position - 1].Field <String>("Input");
                _listFlowActInput.Add(faIn);
            }
            if (dt.Rows[position - 1].Field <String>("Output") != String.Empty)
            {
                List <ActionOutputs> outputs = helper.GetActionOutputsForAction(dt.Rows[position - 1].Field <String>("Id"));
                faOut = new FlowActionOutputs();
                faOut.FlowPosition  = position;
                faOut.ActionOutputs = outputs[0];
                faOut.Value         = dt.Rows[position - 1].Field <String>("Output");
                _listFlowActOutput.Add(faOut);
            }
        }