コード例 #1
0
 private bool FilterShift(Shift entity)
 {
     return (entity.ID == this.ShiftID);
 }
コード例 #2
0
ファイル: RGReport.cs プロジェクト: shenoyroopesh/Gama
        /// <summary>
        /// This constructor creates an initial RGReport based on an existing fpTemplate. It does not check whether
        /// an existing RG Report exists, so make sure of that before calling this method
        /// </summary>
        /// <param name="fpTemplate"></param>
        /// <param name="ctx">Database Context with reference which to create the object</param>
        public RGReport(FixedPatternTemplate fpTemplate, string RTNo, string ReportNo, RadiographyContext ctx, bool isDirectlyReshoot)
        {
            //shallow copy properties
            fpTemplate.CopyTo(this, "ID");
            this.DateOfTest = this.ReportDate = DateTime.Now;
            this.Shift      = Shift.getShift("DAY", ctx); //defaulting so it can be saved
            this.Status     = RGStatus.getStatus("CASTING UNDER REPAIR", ctx);
            this.RTNo       = RTNo;
            this.ReportNo   = ReportNo;

            RGReportRowType freshRowType = RGReportRowType.getRowType("FRESH", ctx);

            if (fpTemplate.FPTemplateRows == null)
            {
                return;
            }

            this.RGReportRows = new List <RGReportRow>();


            //some default values as suggested by Shankaran (10-Apr-2012)
            this.Film = "AGFA D7";
            if (fpTemplate.FixedPattern.Customer.FoundryID == 7)
            {
                this.LeadScreen     = "0.25mm"; //Default for Leadscreen changed as per NEW requirements shared on 07-Jun-14.
                this.LeadScreenBack = "0.25mm"; //Default for Leadscreen changed as per NEW requirements shared on 07-Jun-14.
            }
            else if (fpTemplate.FixedPattern.Customer.FoundryID == 6)
            {
                this.LeadScreen     = "0.125mm"; //Default for Leadscreen changed as per NEW requirements shared on 07-Jun-14.
                this.LeadScreenBack = "0.125mm"; //Default for Leadscreen changed as per NEW requirements shared on 07-Jun-14.
            }

            if (isDirectlyReshoot)
            {
                this.ReportType      = "Reshoot";
                this.ReshootNo       = 1; //explicitly setting this, even though this is the default value
                this.ReportTypeAndNo = this.ReportType + "-" + this.ReshootNo.ToString();
            }
            else
            {
                this.ReportTypeAndNo = this.ReportType = "Fresh";
                this.ReshootNo       = 0; //explicitly setting this, even though this is the default value
            }

            //since this is the first report for this FP and RT No
            this.First       = true;
            this.RowsDeleted = false;
            foreach (var row in fpTemplate.FPTemplateRows.OrderBy(p => p.SlNo))
            {
                var rgReportRow = new RGReportRow
                {
                    RowType      = freshRowType,
                    Energy       = Energy.getEnergyForThickness(row.Thickness, ctx),
                    Observations = " ", //for grid to work fine
                    FilmCount    = 1    // default for the new film count
                };
                row.CopyTo(rgReportRow, "ID,FilmSizeString");

                //for future reports, so that ordering can be done on this basis
                rgReportRow.FPSLNo = row.SlNo;

                this.RGReportRows.Add(rgReportRow);
            }
        }