void StackDataEditor_Ok(object sender, EventArgs e) { if (((TruckStackWrapper)StackDataEditor.DataSource).StackId == Guid.Empty) { errorDisplayer.ShowErrorMessage("Stack is required"); } else if (StackDataEditor.IsNew) { ginProcess.AddStack(GINTruckInformation.Load.TruckId, ((TruckStackWrapper)StackDataEditor.DataSource).TSInfo); StackGridViewer.DataBind(); TruckLoadEditor.DataSource = GINTruckInformation.Load; TruckLoadEditor.DataBind(); StackDataEditor.IsNew = false; } else { var editedStack = from stack in GINTruckInformation.Load.Stacks where stack.TruckStackId == ((TruckStackWrapper)StackDataEditor.DataSource).TruckStackId select stack; if (editedStack.Count() > 0) { editedStack.ElementAt(0).Copy(((TruckStackWrapper)StackDataEditor.DataSource).TSInfo); StackGridViewer.DataBind(); TruckLoadEditor.DataSource = GINTruckInformation.Load; TruckLoadEditor.DataBind(); } } mpeStackDataEditorExtender.Hide(); }
protected void Page_Load(object sender, EventArgs e) { StackGridViewer.DataSource = //GINTruckInformation.Load.Stacks; from stack in GINTruckInformation.Load.Stacks select new TruckStackWrapper(stack, ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear); StackGridViewer.DataBind(); ProposedStackGridViewer.DataSource = //GINTruckInformation.Load.Stacks; from stack in ProposedGINTruckInformation.Load.Stacks select new TruckStackWrapper(stack, ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear); ProposedStackGridViewer.DataBind(); ReturnedBagsGridViewer.DataSource = //GINTruckInformation.Weight.ReturnedBags; from returnedBags in GINTruckInformation.Weight.ReturnedBags select new ReturnedBagsWrapper(returnedBags, ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear); ReturnedBagsGridViewer.DataBind(); ProposedReturnedBagsGridViewer.DataSource = //GINTruckInformation.Weight.ReturnedBags; from returnedBags in ProposedGINTruckInformation.Weight.ReturnedBags select new ReturnedBagsWrapper(returnedBags, ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear); ProposedReturnedBagsGridViewer.DataBind(); if (!IsPostBack) { TruckDataEditor.DataSource = GINTruckInformation; TruckDataEditor.DataBind(); TruckLoadEditor.DataSource = GINTruckInformation.Load; TruckLoadEditor.DataBind(); TruckWeightEditor.DataSource = GINTruckInformation.Weight; TruckWeightEditor.DataBind(); ProposedTruckDataEditor.DataSource = ProposedGINTruckInformation; ProposedTruckDataEditor.DataBind(); ProposedTruckLoadEditor.DataSource = ProposedGINTruckInformation.Load; ProposedTruckLoadEditor.DataBind(); ProposedTruckWeightEditor.DataSource = ProposedGINTruckInformation.Weight; ProposedTruckWeightEditor.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { StackGridViewer.DataSource = from stack in GINTruckInformation.Load.Stacks select new TruckStackWrapper(stack, ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear); StackGridViewer.DataBind(); var gridCommands = from command in StackGridViewer.Driver.Columns where command.IsCommand select command.AttachedRenderer; foreach (LinkGINColumnRenderer linkCommand in gridCommands) { linkCommand.Command += new CommandEventHandler(linkCommand_Command); } if (!IsPostBack) { TruckLoadEditor.DataSource = GINTruckInformation.Load; TruckLoadEditor.DataBind(); } }