Exemple #1
0
        public static ConfigDomain MapConfig(IDataReader reader, int index)
        {
            ConfigDomain model = new ConfigDomain();

            model.Id      = reader.GetSafeInt32(index++);
            model.ApiName = reader.GetSafeString(index++);
            model.ApiKey  = reader.GetSafeString(index++);
            return(model);
        }
Exemple #2
0
        /// <summary>
        ///InitDomain 的测试
        ///</summary>
        public void InitDomainTestHelper <T>()
            where T : BaseWorld, new()
        {
            Domain <T>   target       = new Domain <T>(); // TODO: 初始化为适当的值
            ConfigDomain configDomain = null;             // TODO: 初始化为适当的值

            target.InitDomain(configDomain);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
Exemple #3
0
        public void DomainIDTest()
        {
            ConfigDomain target   = new ConfigDomain(); // TODO: 初始化为适当的值
            string       expected = string.Empty;       // TODO: 初始化为适当的值
            string       actual;

            target.DomainID = expected;
            actual          = target.DomainID;
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Exemple #4
0
        public void DomainPortTest()
        {
            ConfigDomain target   = new ConfigDomain(); // TODO: 初始化为适当的值
            int          expected = 0;                  // TODO: 初始化为适当的值
            int          actual;

            target.DomainPort = expected;
            actual            = target.DomainPort;
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Exemple #5
0
        public ConfigDomain SelectById(int Id)
        {
            ConfigDomain model = null;

            _dataProvider.ExecuteCmd(
                "config_select_by_id",
                inputParamMapper : delegate(SqlParameterCollection paramList)
            {
                paramList.AddWithValue("@Id", Id);
            },
                singleRecordMapper : delegate(IDataReader reader, short set)
            {
                int index = 0;
                model     = MapConfig(reader, index);
            }
                );
            return(model);
        }
Exemple #6
0
        protected void btnEdit_Click(object sender, EventArgs e)
        {
            List <string> keys = GetSelectKeys();

            if (keys.Count == 0 || keys.Count > 1)
            {
                Response.Write("<script>alert('有仅只能选中一项进行编辑')</script>");
                return;
            }
            else
            {
                MSMQConfig config = this.TempConfig;
                foreach (MSMQConfigNode node in config.Nodes)
                {
                    if (keys[0] == node.ToString())
                    {
                        ddlCategory.SelectedValue = node.CategoryName;
                        //绑定数据
                        ddlCounter.DataSource     = GetCounterList(node.CategoryName);
                        ddlCounter.DataTextField  = "Text";
                        ddlCounter.DataValueField = "Value";
                        ddlCounter.DataBind();

                        ddlCounter.SelectedValue = node.CounterName;
                        txtInstance.Text         = node.Instance;
                        //获取Domain
                        ConfigDomain cd = config.Domains.Find(p => (p.Name == node.Domain));
                        if (cd != null)
                        {
                            string[] strs = EncryptHelper.DecryptDES(cd.Value).Split('|');

                            txtIP.Text      = strs[0];
                            txtDomain.Text  = strs[1];
                            txtAccount.Text = strs[2];
                            txtPwd.Text     = strs[3];
                        }
                    }
                }
            }
        }
Exemple #7
0
        public void ConfigDomainConstructorTest()
        {
            ConfigDomain target = new ConfigDomain();

            Assert.Inconclusive("TODO: 实现用来验证目标的代码");
        }