예제 #1
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            this.CreateLink1.NavigateUrl = PageUrlAttribute.Get <MaterialGroups.Edit>(new MaterialGroups.Edit.Query());
            this.CreateLink2.NavigateUrl = PageUrlAttribute.Get <MaterialGroups.Edit>(new MaterialGroups.Edit.Query());

            this.MaterialGroupRepeater.DataSource = MaterialGroup.LoadAll();
            this.MaterialGroupRepeater.DataBind();
        }
        //Methods
        #region Page_Load
        protected void Page_Load(Object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                var             articleItems = Article.LoadAll().ToList().Select(runner => new ListItem($"{runner.ArticleNumber} - {runner.NameIntern}", runner.Id.ToString())).ToList();
                var             noneItem     = new ListItem("keiner", String.Empty);
                List <ListItem> allItems     = new List <ListItem>();
                allItems.Add(noneItem);
                allItems.AddRange(articleItems);
                this.MasterArticleList.Items.AddRange(allItems.ToArray());

                this.MaterialGroupList.DataValueField = nameof(MaterialGroup.Id);
                this.MaterialGroupList.DataTextField  = nameof(MaterialGroup.Name);
                this.MaterialGroupList.DataSource     = MaterialGroup.LoadAll();
                this.MaterialGroupList.DataBind();

                this.SupplierList.DataValueField = nameof(Supplier.Id);
                this.SupplierList.DataTextField  = nameof(Supplier.Name);
                this.SupplierList.DataSource     = Supplier.LoadAll();
                this.SupplierList.DataBind();
            }
        }