예제 #1
0
 void AddedBagsDataEditor_Ok(object sender, EventArgs e)
 {
     if (((ReturnedBagsWrapper)AddedBagsDataEditor.DataSource).StackId == Guid.Empty)
     {
         errorDisplayer.ShowErrorMessage("Stack is required");
     }
     else if (AddedBagsDataEditor.IsNew)
     {
         ginProcess.AddReturnedBags(GINTruckInformation.Weight.TruckId, ((ReturnedBagsWrapper)AddedBagsDataEditor.DataSource).RBInfo);
         AddedBagsGridViewer.DataBind();
         AddedBagsDataEditor.IsNew = false;
     }
     else
     {
         var editedAddedBags = from addedBags in GINTruckInformation.Weight.AddedBags
                               where addedBags.ReturnedBagsId == ((ReturnedBagsWrapper)AddedBagsDataEditor.DataSource).ReturnedBagsId
                               select addedBags;
         if (editedAddedBags.Count() > 0)
         {
             editedAddedBags.ElementAt(0).Copy(((ReturnedBagsWrapper)AddedBagsDataEditor.DataSource).RBInfo);
             AddedBagsGridViewer.DataBind();
         }
     }
     mpeAddedBagsDataEditorExtender.Hide();
 }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ReturnedBagsGridViewer.DataSource =
                from returnedBags in GINTruckInformation.Weight.ReturnedBags
                select new ReturnedBagsWrapper(returnedBags, ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear);

            ReturnedBagsGridViewer.DataBind();

            AddedBagsGridViewer.DataSource =
                from addedBags in GINTruckInformation.Weight.AddedBags
                select new ReturnedBagsWrapper(addedBags, ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear);

            AddedBagsGridViewer.DataBind();

            var gridCommands = from command in ReturnedBagsGridViewer.Driver.Columns
                               where command.IsCommand
                               select command.AttachedRenderer;

            foreach (LinkGINColumnRenderer linkCommand in gridCommands)
            {
                linkCommand.Command += new CommandEventHandler(linkCommand_Command);
            }

            var addedGridCommands = from command in AddedBagsGridViewer.Driver.Columns
                                    where command.IsCommand
                                    select command.AttachedRenderer;

            foreach (LinkGINColumnRenderer linkCommand in addedGridCommands)
            {
                linkCommand.Command += new CommandEventHandler(linkCommand_Command);
            }

            if (!IsPostBack)
            {
                try
                {
                    TruckWeightEditor.DataSource = GINTruckInformation.Weight;
                    TruckWeightEditor.DataBind();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ReturnedBagsGridViewer.DataSource =
                from returnedBags in GINTruckInformation.Weight.ReturnedBags
                select new ReturnedBagsWrapper(returnedBags, ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear);

            ReturnedBagsGridViewer.DataBind();

            AddedBagsGridViewer.DataSource =
                from addedBags in GINTruckInformation.Weight.AddedBags
                select new ReturnedBagsWrapper(addedBags, ginProcess.GINProcessInformation.CommodityGradeId, ginProcess.GINProcessInformation.ProductionYear);

            AddedBagsGridViewer.DataBind();

            var gridCommands = from command in ReturnedBagsGridViewer.Driver.Columns
                               where command.IsCommand
                               select command.AttachedRenderer;

            foreach (LinkGINColumnRenderer linkCommand in gridCommands)
            {
                linkCommand.Command += new CommandEventHandler(linkCommand_Command);
            }

            var addedGridCommands = from command in AddedBagsGridViewer.Driver.Columns
                                    where command.IsCommand
                                    select command.AttachedRenderer;

            foreach (LinkGINColumnRenderer linkCommand in addedGridCommands)
            {
                linkCommand.Command += new CommandEventHandler(linkCommand_Command);
            }

            if (!IsPostBack)
            {
                try
                {
                    GINDataEditor.DataSource = ginProcess.GetGINReport(GINTruckInformation.TruckId);
                    GINDataEditor.DataBind();
                    TruckWeightEditor.DataSource = GINTruckInformation.Weight;
                    TruckWeightEditor.DataBind();
                    GINIssuanceEditor.DataSource = GINTruckInformation.GIN;
                    GINInfo ginInfo = (GINInfo)GINIssuanceEditor.DataSource;
                    if (NullFinder.IsNull(ginInfo.DateIssued, "System.DateTime"))
                    {
                        ginInfo.DateIssued = DateTime.Now;
                    }
                    GINIssuanceEditor.DataBind();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            TruckWeightInfo newWeight   = (TruckWeightInfo)TruckWeightEditor.DataSource;
            decimal         truckWeight = GINTruckInformation.Weight.TruckWeight;
            decimal         grossWeight = GINTruckInformation.Weight.GrossWeight;

            GINTruckInformation.Weight.TruckWeight = newWeight.TruckWeight;
            GINTruckInformation.Weight.GrossWeight = newWeight.GrossWeight;
            lblNetWeight.Text = ginProcess.CalculateNetWeight(newWeight.TruckId).ToString();
            GINTruckInformation.Weight.TruckWeight = truckWeight;
            GINTruckInformation.Weight.GrossWeight = grossWeight;
        }