コード例 #1
0
        protected void wzMerge_FinishButtonClick(object sender, WizardNavigationEventArgs e)
        {
            List <LogbookEntry> lst = new List <LogbookEntry>();

            // Need to use LogbookEntry, not LogbookEntryDisplay, since you can't commit LogbookEntryDisplay
            // Also need to do ascending so 1st element is target.
            DBHelper dbh = new DBHelper(LogbookEntry.QueryCommand(Query, -1, -1, true, LogbookEntry.LoadTelemetryOption.LoadAll));

            dbh.ReadRows((comm) => { },
                         (dr) =>
            {
                LogbookEntry le = new LogbookEntry(dr, Query.UserName, LogbookEntryCore.LoadTelemetryOption.LoadAll);     // Note: this has no telemetry
                le.PopulateImages();
                lst.Add(le);
            });

            LogbookEntry target = lst[0];

            lst.RemoveAt(0);
            foreach (LogbookEntry le in lst)
            {
                le.PopulateImages();
            }

            target.MergeFrom(lst);
            Response.Redirect("~/Member/LogbookNew.aspx");
        }