Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                using (IDbConnection conn = installer.GetConnection())
                {
                    conn.Open();
                    string discriminator = GetDiscriminator(conn, int.Parse(Request["id"]));
                    string itemsSql      = string.Format("select * from {0}item where Type = '{1}'", tablePrefix, discriminator);
                    using (IDbCommand cmd = installer.GenerateCommand(CommandType.Text, itemsSql))
                    {
                        cmd.Connection      = conn;
                        dgrItems.DataSource = cmd.ExecuteReader();
                    }

                    ddlType.DataSource = N2.Context.Definitions.GetDefinitions();
                    DataBind();
                }
            }
        }