protected void btnAddAddedBags_Click(object sender, EventArgs e) { AddedBagsDataEditor.IsNew = true; ReturnedBagsWrapper addedBagsWrapper = new ReturnedBagsWrapper(ginProcess.GetBlankReturnedBags(GINTruckInformation.Weight.TruckId), ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear); addedBagsWrapper.Returned = false; AddedBagsDataEditor.DataSource = addedBagsWrapper; AddedBagsDataEditor.DataBind(); mpeAddedBagsDataEditorExtender.Show(); }
void linkCommand_Command(object sender, CommandEventArgs e) { if (e.CommandName == "EditReturnedBags") { ReturnedBagsDataEditor.IsNew = false; var returnedBagsToEdit = from returnedBags in GINTruckInformation.Weight.ReturnedBags where returnedBags.ReturnedBagsId == new Guid((string)e.CommandArgument) select returnedBags; ReturnedBagsDataEditor.DataSource = new ReturnedBagsWrapper(returnedBagsToEdit.ElementAt(0), ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear); ReturnedBagsDataEditor.DataBind(); mpeReturnedBagsDataEditorExtender.Show(); } if (e.CommandName == "EditAddedBags") { AddedBagsDataEditor.IsNew = false; var addedBagsToEdit = from addedBags in GINTruckInformation.Weight.AddedBags where addedBags.ReturnedBagsId == new Guid((string)e.CommandArgument) select addedBags; AddedBagsDataEditor.DataSource = new ReturnedBagsWrapper(addedBagsToEdit.ElementAt(0), ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear); AddedBagsDataEditor.DataBind(); mpeAddedBagsDataEditorExtender.Show(); } }