Exemple #1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     XmlHelper.XmlSerializeToFile(_menuList, _path, Encoding.UTF8);
     CboData.BindiComboBox(_cb, _path);
     MessageBox.Show("修改成功!");
     this.Close();
 }
        private void RoutineData_Edit_Load(object sender, EventArgs e)
        {
            CboData.BindiWearAmsType(cboiWearAmsType);
            switch (_type)
            {
            case "1":
                btnAdd.Visible = true;
                break;

            case "2":
                btnAdd.Visible = true;
                SetValue();
                break;

            case "0":
                btnUpdate.Visible = true;
                SetValue();
                break;
            }
        }
Exemple #3
0
        private void RoutineNewDataEdit_Load(object sender, EventArgs e)
        {
            CboData.BindiComboBox(comboBox1, CboData.WearAmspath);
            DataHelper.CopyRowToData(this, _dr);
            string path = Path.Combine(ToolsHelper.ExplainPath, _tableName + ".xml");

            DataHelper.SetLabelTextBox(this, _dr, _type, path, btnUpdate, btnAdd);

            string[] condition = _dr.Cells["condition"].Value.ToString().Split(',');
            string   buffName  = string.Empty;

            for (int i = 0; i < condition.Length; i++)
            {
                if (condition[i] == "" || condition[i] == "0")
                {
                    continue;
                }
                buffName += DataHelper.GetValue(_buffTable, "CondName", "@ConditionID", condition[i]) + ",";
            }
            txtBuffName.Text = buffName.TrimEnd(new char[] { ',' });;
        }
Exemple #4
0
        private void NeiGongEdit_Load(object sender, EventArgs e)
        {
            string path = Path.Combine(ToolsHelper.ExplainPath, "NeigongData.xml");

            DataHelper.SetLabelTextBox(this, _dr, _type, path, btnUpdate, btnAdd);

            textBox17.Text = DataHelper.GetConditionName(textBox9.Text);
            textBox16.Text = DataHelper.GetConditionName(textBox11.Text);
            textBox18.Text = DataHelper.GetConditionName(textBox13.Text);
            textBox19.Text = DataHelper.GetConditionName(textBox15.Text);

            Dictionary <string, string> ngLevel = new Dictionary <string, string>();

            for (int i = 1; i <= 10; i++)
            {
                string key = $"(10,0,{textBox1.Text},{i})";
                ngLevel.Add(key, "第" + i + "层");
            }
            DataHelper.BinderComboBox(comboBox1, ngLevel);
            DataHelper.BinderComboBox(comboBox2, ngLevel);
            DataHelper.BinderComboBox(comboBox3, ngLevel);

            CboData.BindiComboBox(comboBox4, CboData.NeiGongPath);
            CboData.BindiComboBox(comboBox5, CboData.NeiGongPath);

            DataHelper.SetDicConfig("NeiGong.Attribute", CboData.NeiGongPath);
            textBox20.Text = DataHelper.GetNeiGongLevelAttribute(textBox5.Text);
            textBox23.Text = DataHelper.GetNeiGongLevelAttribute(textBox6.Text);

            comboBox1.SelectedValue = textBox10.Text;
            comboBox2.SelectedValue = textBox12.Text;
            comboBox3.SelectedValue = textBox14.Text;

            this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
            this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
            this.comboBox3.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
        }
        private void BattleCondition_Edit_Load(object sender, EventArgs e)
        {
            //增加 预设下拉框新增 功能2016年10月23日 07:39:48
            List <BattleCondition> conditions = DataHelper.ReadXmlToList <BattleCondition>(CboData.PresetConditionPath);
            //下拉框数据源
            Dictionary <string, string> dropdownSource = new Dictionary <string, string>();

            dropdownSource.Add("SELADD", "选择新增");
            //与下拉框关联的预设效果
            _presetConditions = new Dictionary <string, List <Condition> >();
            foreach (BattleCondition condition in conditions)
            {
                if (dropdownSource.ContainsKey(condition.Key))
                {
                    continue;
                }
                dropdownSource.Add(condition.Key, condition.Value);
                _presetConditions.Add(condition.Key, condition.Conditions);
            }

            DataHelper.BinderComboBox(cboPresetCondition, dropdownSource);
            cboPresetCondition.SelectedIndex              = 0;
            this.cboPresetCondition.SelectedIndexChanged += new System.EventHandler(this.cboPresetCondition_SelectedIndexChanged);

            //2016年7月7日 20:57:50 修改为统一的下拉框读取
            CboData.BindiComboBox(cboEffectType1, CboData.BattleConditionPath);
            CboData.BindiComboBox(cboAccumulate, CboData.AccumulatePath);

            if (_type != "Add")
            {
                DataHelper.CopyRowToData(groupBox1, _dr);
                _initialId = txtConditionID.Text;
                SetdgXiaoGuo();
            }
            this.dgXiaoGuo.DataSource = _conditionD;
        }