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(); }
protected override void OnInit(EventArgs e) { base.OnInit(e); errorDisplayer = new ErrorMessageDisplayer(lblMessage); errorDisplayer.ClearErrorMessage(); transferedData = new PageDataTransfer(Request.Path); GINDataEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("TruckScaling", "GIN"); TruckWeightEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("TruckScaling", "TruckWeight"); GINIssuanceEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("TruckScaling", "GINIssuance"); ReturnedBagsDataEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("TruckScaling", "ReturnedBags"); ReturnedBagsGridViewer.Driver = GINViewConfigurationReader.GetViewConfiguration("TruckScaling", "ReturnedBagsGrid"); AddedBagsDataEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("TruckScaling", "AddedBags"); AddedBagsGridViewer.Driver = GINViewConfigurationReader.GetViewConfiguration("TruckScaling", "AddedBagsGrid"); GINDataEditor.IsNew = false; TruckWeightEditor.IsNew = false; GINIssuanceEditor.IsNew = false; ReturnedBagsDataEditor.Ok += new EventHandler(ReturnedBagsDataEditor_Ok); ReturnedBagsDataEditor.Cancel += new EventHandler(ReturnedBagsDataEditor_Cancel); AddedBagsDataEditor.Ok += new EventHandler(AddedBagsDataEditor_Ok); AddedBagsDataEditor.Cancel += new EventHandler(AddedBagsDataEditor_Cancel); try { ginProcess = GINProcessWrapper.GetGINProcess(IsPostBack); GINDataEditor.Lookup = ginProcess.LookupSource; TruckWeightEditor.Lookup = ginProcess.LookupSource; GINIssuanceEditor.Lookup = ginProcess.LookupSource; ReturnedBagsDataEditor.Lookup = ginProcess.LookupSource; ReturnedBagsGridViewer.Lookup = ginProcess.LookupSource; AddedBagsDataEditor.Lookup = ginProcess.LookupSource; AddedBagsGridViewer.Lookup = ginProcess.LookupSource; GINDataEditor.Setup(); TruckWeightEditor.Setup(); GINIssuanceEditor.Setup(); ReturnedBagsDataEditor.Setup(); AddedBagsDataEditor.Setup(); } catch (Exception ex) { throw ex; } }
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(); } }