Пример #1
0
        // 获得当前 ListView 中(和外面)的动作参数
        List <OneAction> GetActions()
        {
            List <OneAction> results = new List <OneAction>();

#if NO
            if (this.changeStateActionControl1.ActionString == "<不改变>")
            {
            }
            else if (this.changeStateActionControl1.ActionString == "<增、减>")
            {
                if (string.IsNullOrEmpty(this.changeStateActionControl1.AddString) == false)
                {
                    OneAction action = new OneAction();
                    action.FieldName  = "{state}";
                    action.Action     = "add";
                    action.FieldValue = this.changeStateActionControl1.AddString;
                    results.Add(action);
                }
                if (string.IsNullOrEmpty(this.changeStateActionControl1.RemoveString) == false)
                {
                    OneAction action = new OneAction();
                    action.FieldName  = "{state}";
                    action.Action     = "remove";
                    action.FieldValue = this.changeStateActionControl1.RemoveString;
                    results.Add(action);
                }
            }
            else
            {
                OneAction action = new OneAction();
                action.FieldName  = "{state}";
                action.FieldValue = this.changeStateActionControl1.ActionString;
                results.Add(action);
            }
#endif

            foreach (ListViewItem item in this.listView_actions.Items)
            {
#if NO
                OneAction action = new OneAction();
                action.FieldName  = ListViewUtil.GetItemText(item, 0);
                action.FieldValue = ListViewUtil.GetItemText(item, 1);
                action.Additional = ListViewUtil.GetItemText(item, 2);

                results.Add(action);
#endif
                string strFieldName = ListViewUtil.GetItemText(item, 0);

                string strFieldValue = ListViewUtil.GetItemText(item, 1);
                string strAdd        = ListViewUtil.GetItemText(item, 2);
                string strRemove     = ListViewUtil.GetItemText(item, 3);
                string strAdditional = ListViewUtil.GetItemText(item, 4);

                if (strFieldValue == "<不改变>")
                {
                }
                else if (strFieldValue == "<删除>")
                {
                    OneAction action = new OneAction();
                    action.FieldName  = strFieldName;
                    action.Action     = "delete";
                    action.FieldValue = "";
                    results.Add(action);
                }
                else if (strFieldValue == "<增、减>")
                {
                    if (string.IsNullOrEmpty(strAdd) == false)
                    {
                        OneAction action = new OneAction();
                        action.FieldName  = strFieldName;
                        action.Action     = "add";
                        action.FieldValue = strAdd;
                        results.Add(action);
                    }
                    if (string.IsNullOrEmpty(strRemove) == false)
                    {
                        OneAction action = new OneAction();
                        action.FieldName  = strFieldName;
                        action.Action     = "remove";
                        action.FieldValue = strRemove;
                        results.Add(action);
                    }
                }
                else
                {
                    OneAction action = new OneAction();
                    action.FieldName  = strFieldName;
                    action.FieldValue = strFieldValue;
                    results.Add(action);
                }
            }

            return(results);
        }
Пример #2
0
        // 获得当前 ListView 中(和外面)的动作参数
        List<OneAction> GetActions()
        {
            List<OneAction> results = new List<OneAction>();

#if NO
            if (this.changeStateActionControl1.ActionString == "<不改变>")
            {
            }
            else if (this.changeStateActionControl1.ActionString == "<增、减>")
            {
                if (string.IsNullOrEmpty(this.changeStateActionControl1.AddString) == false)
                {
                    OneAction action = new OneAction();
                    action.FieldName = "{state}";
                    action.Action = "add";
                    action.FieldValue = this.changeStateActionControl1.AddString;
                    results.Add(action);
                }
                if (string.IsNullOrEmpty(this.changeStateActionControl1.RemoveString) == false)
                {
                    OneAction action = new OneAction();
                    action.FieldName = "{state}";
                    action.Action = "remove";
                    action.FieldValue = this.changeStateActionControl1.RemoveString;
                    results.Add(action);
                }
            }
            else
            {
                OneAction action = new OneAction();
                action.FieldName = "{state}";
                action.FieldValue = this.changeStateActionControl1.ActionString;
                results.Add(action);
            }
#endif

            foreach (ListViewItem item in this.listView_actions.Items)
            {
#if NO
                OneAction action = new OneAction();
                action.FieldName = ListViewUtil.GetItemText(item, 0);
                action.FieldValue = ListViewUtil.GetItemText(item, 1);
                action.Additional = ListViewUtil.GetItemText(item, 2);

                results.Add(action);
#endif
                string strFieldName = ListViewUtil.GetItemText(item, 0);

                string strFieldValue = ListViewUtil.GetItemText(item, 1);
                string strAdd = ListViewUtil.GetItemText(item, 2);
                string strRemove = ListViewUtil.GetItemText(item, 3);
                string strAdditional = ListViewUtil.GetItemText(item, 4);

                if (strFieldValue == "<不改变>")
                {
                }
                else if (strFieldValue == "<删除>")
                {
                    OneAction action = new OneAction();
                    action.FieldName = strFieldName;
                    action.Action = "delete";
                    action.FieldValue = "";
                    results.Add(action);
                }
                else if (strFieldValue == "<增、减>")
                {
                    if (string.IsNullOrEmpty(strAdd) == false)
                    {
                        OneAction action = new OneAction();
                        action.FieldName = strFieldName;
                        action.Action = "add";
                        action.FieldValue = strAdd;
                        results.Add(action);
                    }
                    if (string.IsNullOrEmpty(strRemove) == false)
                    {
                        OneAction action = new OneAction();
                        action.FieldName = strFieldName;
                        action.Action = "remove";
                        action.FieldValue = strRemove;
                        results.Add(action);
                    }
                }
                else
                {
                    OneAction action = new OneAction();
                    action.FieldName = strFieldName;
                    action.FieldValue = strFieldValue;
                    results.Add(action);
                }
            }

            return results;
        }
Пример #3
0
        // 获得当前 ListView 中(和外面)的动作参数
        List<OneAction> GetActions()
        {
            List<OneAction> results = new List<OneAction>();


            if (this.changeStateActionControl1.ActionString == "<不改变>")
            {
            }
            else if (this.changeStateActionControl1.ActionString == "<增、减>")
            {
                if (string.IsNullOrEmpty(this.changeStateActionControl1.AddString) == false)
                {
                    OneAction action = new OneAction();
                    action.FieldName = "{state}";
                    action.Action = "add";
                    action.FieldValue = this.changeStateActionControl1.AddString;
                    results.Add(action);
                }
                if (string.IsNullOrEmpty(this.changeStateActionControl1.RemoveString) == false)
                {
                    OneAction action = new OneAction();
                    action.FieldName = "{state}";
                    action.Action = "remove";
                    action.FieldValue = this.changeStateActionControl1.RemoveString;
                    results.Add(action);
                }
            }
            else
            {
                OneAction action = new OneAction();
                action.FieldName = "{state}";
                action.FieldValue = this.changeStateActionControl1.ActionString;
                results.Add(action);
            }

#if NO
            if (this.comboBox_fieldName.Text != "<不使用>")
            {
                OneAction action = new OneAction();
                action.FieldName = this.comboBox_fieldName.Text;
                action.FieldValue = this.textBox_fieldValue.Text;
                results.Add(action);
            }
#endif

            foreach (ListViewItem item in this.listView_actions.Items)
            {
                OneAction action = new OneAction();
                action.FieldName = ListViewUtil.GetItemText(item, 0);
                action.FieldValue = ListViewUtil.GetItemText(item, 1);

                results.Add(action);
            }

            return results;
        }