protected override void OnInit(EventArgs e) { base.OnInit(e); errorDisplayer = new ErrorMessageDisplayer(lblMessage); errorDisplayer.ClearErrorMessage(); transferedData = new PageDataTransfer(Request.Path); TruckLoadEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("EditTruckLoading", "TruckLoad"); StackDataEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("EditTruckLoading", "Stack"); StackGridViewer.Driver = GINViewConfigurationReader.GetViewConfiguration("EditTruckLoading", "StackGrid"); StackDataEditor.Ok += new EventHandler(StackDataEditor_Ok); StackDataEditor.Cancel += new EventHandler(StackDataEditor_Cancel); try { ginProcess = GINProcessWrapper.GetGINProcess(IsPostBack); TruckLoadEditor.Lookup = ginProcess.LookupSource; StackDataEditor.Lookup = ginProcess.LookupSource; StackGridViewer.Lookup = ginProcess.LookupSource; TruckLoadEditor.Setup(); StackDataEditor.Setup(); } catch (Exception ex) { throw ex; } }
protected void btnAddStack_Click(object sender, EventArgs e) { StackDataEditor.IsNew = true; StackDataEditor.DataSource = new TruckStackWrapper(ginProcess.GetBlankTruckStack(GINTruckInformation.Load.TruckId), ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear); StackDataEditor.DataBind(); mpeStackDataEditorExtender.Show(); }
void linkCommand_Command(object sender, CommandEventArgs e) { if (e.CommandName == "EditStack") { StackDataEditor.IsNew = false; var stackToEdit = from stack in GINTruckInformation.Load.Stacks where stack.TruckStackId == new Guid((string)e.CommandArgument) select stack; StackDataEditor.DataSource = new TruckStackWrapper(stackToEdit.ElementAt(0), ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear); StackDataEditor.DataBind(); mpeStackDataEditorExtender.Show(); } }