Пример #1
0
        private void Save()
        {
            if (GINIssuanceEditor.DataSource != null)
            {
                GINTruckInformation.GIN.Copy((GINInfo)GINIssuanceEditor.DataSource);
            }
            if (TruckWeightEditor.DataSource != null)
            {
                TruckWeightInfo truckWeight = (TruckWeightInfo)TruckWeightEditor.DataSource;

                GINTruckInformation.Weight.Copy(truckWeight);
            }
            GINProcessWrapper.SaveScaling(GINTruckInformation.TruckId);
            GINProcessWrapper.SaveGIN(GINTruckInformation.TruckId);
        }
Пример #2
0
        protected void btnRecalculate_Click(object sender, EventArgs e)
        {
            //TruckWeightInfo oldWeight = new TruckWeightInfo();
            //oldWeight.Copy(GINTruckInformation.Weight);
            //GINTruckInformation.Weight.Copy((TruckWeightInfo)this.TruckWeightEditor.DataSource);
            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;
            //GINTruckInformation.Weight.Copy(oldWeight);
        }
Пример #3
0
 protected void btnOk_Click(object sender, EventArgs e)
 {
     try
     {
         //AuditTrailWrapper auditTrail = new AuditTrailWrapper(AuditTrailWrapper.TruckWeighing);
         TruckWeightInfo originalWeight = new TruckWeightInfo();
         originalWeight.Copy(GINTruckInformation.Weight);
         GINTruckInformation.Weight.Copy((TruckWeightInfo)TruckWeightEditor.DataSource);
         //auditTrail.AddChange(originalWeight, GINTruckInformation.Weight);
         GINProcessWrapper.SaveScaling(GINTruckInformation.TruckId);//, auditTrail);
         GINProcessWrapper.RemoveGINProcessInformation();
         transferedData.Return();
     }
     catch (Exception ex)
     {
         errorDisplayer.ShowErrorMessage(ex.Message);
     }
 }
Пример #4
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;
        }
Пример #5
0
 public void ValidateTruckWeight(TruckWeightInfo weight)
 {
     currentGINProcess.ValidateTruckWeight(weight);
 }