Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         GINDataEditor.DataSource = GINInformation;
         GINInfo ginInfo = (GINInfo)GINDataEditor.DataSource;
         if (NullFinder.IsNull(ginInfo.DateApproved, "System.DateTime"))
         {
             ginInfo.DateApproved = DateTime.Now;
         }
         GINDataEditor.DataBind();
     }
 }
Esempio n. 2
0
 void GINDataEditor_Ok(object sender, EventArgs e)
 {
     try
     {
         if (GINDataEditor.DataSource != null)
         {
             GINInfo originalGIN = new GINInfo();
             originalGIN.Copy(GINTruckInformation.GIN);
             GINTruckInformation.GIN.Copy(((LeavingTruck)GINDataEditor.DataSource).GIN);
             GINProcessWrapper.TruckLeftCompound(GINTruckInformation.TruckId);
             GINProcessWrapper.RemoveGINProcessInformation();
             transferedData.Return();
         }
     }
     catch (Exception ex)
     {
         errorDisplayer.ShowErrorMessage(ex.Message);
     }
 }
Esempio n. 3
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     //AuditTrailWrapper auditTrail = new AuditTrailWrapper(AuditTrailWrapper.TruckWeighing);
     if (GINDataEditor.DataSource != null)
     {
         GINInfo editedGin = new GINInfo();
         editedGin.Copy((GINInfo)GINDataEditor.DataSource);
         //auditTrail.AddChange(GINTruckInformation.GIN, editedGin);
         GINTruckInformation.GIN.Copy((GINInfo)GINDataEditor.DataSource);
     }
     try
     {
         GINProcessWrapper.SaveGIN(GINTruckInformation.TruckId);//, auditTrail);
         GINProcessWrapper.RemoveGINProcessInformation();
         transferedData.Return();
     }
     catch (Exception ex)
     {
         errorDisplayer.ShowErrorMessage(ex.Message);
     }
 }
Esempio n. 4
0
 protected void btnGenerate_Click(object sender, EventArgs e)
 {
     //AuditTrailWrapper auditTrail = new AuditTrailWrapper(AuditTrailWrapper.TruckWeighing);
     if (GINDataEditor.DataSource != null)
     {
         GINInfo editedGin = new GINInfo();
         editedGin.Copy((GINInfo)GINDataEditor.DataSource);
         //auditTrail.AddChange(GINTruckInformation.GIN, editedGin);
         GINTruckInformation.GIN.Copy((GINInfo)GINDataEditor.DataSource);
     }
     try
     {
         GINProcessWrapper.SaveGIN(GINTruckInformation.TruckId);//, auditTrail);
         GINProcessWrapper.GINGenerated(GINTruckInformation.TruckId);
         //GINProcessWrapper.CompleteWorkflowTask(GINTruckInformation.TransactionId);
         PageDataTransfer reportTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/ReportViewerForm.aspx");
         reportTransfer.TransferData["TransactionId"]    = GINTruckInformation.TransactionId;
         reportTransfer.TransferData["IsGINTransaction"] = true;
         reportTransfer.TransferData["RequestedReport"]  = "rptGINReport";
         reportTransfer.TransferData["ReturnPage"]       = transferedData.GetTransferedData("ReturnPage");
         reportTransfer.PersistToSession();
         ScriptManager.RegisterStartupScript(this,
                                             this.GetType(),
                                             "ShowReport",
                                             "<script type=\"text/javascript\">" +
                                             string.Format("javascript:window.open(\"ReportViewerForm.aspx?id={0}\", \"_blank\",\"height=400px,width=600px,top=0,left=0,resizable=yes,scrollbars=yes\");", Guid.NewGuid()) +
                                             string.Format("location.href = '{0}';", transferedData.GetTransferedData("ReturnPage")) +
                                             "</script>",
                                             false);
         GINProcessWrapper.RemoveGINProcessInformation();
     }
     catch (Exception ex)
     {
         errorDisplayer.ShowErrorMessage(ex.Message);
     }
 }
Esempio n. 5
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;
        }
Esempio n. 6
0
 public void ValidateGIN(GINInfo gin)
 {
     currentGINProcess.ValidateGIN(gin);
 }