protected void btnAddReturnedBags_Click(object sender, EventArgs e) { ReturnedBagsDataEditor.IsNew = true; ReturnedBagsWrapper returnedBagsWrapper = new ReturnedBagsWrapper(ginProcess.GetBlankReturnedBags(GINTruckInformation.Weight.TruckId), ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear); returnedBagsWrapper.Returned = true; ReturnedBagsDataEditor.DataSource = returnedBagsWrapper; ReturnedBagsDataEditor.DataBind(); mpeReturnedBagsDataEditorExtender.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(); } }