示例#1
0
        private void frmCostAnalysisValues_Load(object sender, EventArgs e)
        {
            FormLoaded = false;

            using (var context = new TTI2Entities())
            {
                QueryParms = new CMTQueryParameters();

                var Depts = context.TLADM_Departments.Where(x => x.Dep_IsCMT).OrderBy(x => x.Dep_Description).ToList();
                foreach (var Dept in Depts)
                {
                    cmboCMTs.Items.Add(new CMT.CheckComboBoxItem(Dept.Dep_Id, Dept.Dep_Description, false));
                }

                var Styles = context.TLADM_Styles.OrderBy(x => x.Sty_Description).ToList();
                foreach (var Style in Styles)
                {
                    cmboStyles.Items.Add(new CMT.CheckComboBoxItem(Style.Sty_Id, Style.Sty_Description, false));
                }

                var Colours = context.TLADM_Colours.Where(x => !(bool)x.Col_Discontinued).OrderBy(x => x.Col_Display).ToList();
                foreach (var Colour in Colours)
                {
                    cmboColours.Items.Add(new CMT.CheckComboBoxItem(Colour.Col_Id, Colour.Col_Display, false));
                }

                var Sizes = context.TLADM_Sizes.Where(x => !(bool)x.SI_Discontinued).OrderBy(x => x.SI_DisplayOrder).ToList();
                foreach (var Size in Sizes)
                {
                    cmboSizes.Items.Add(new CMT.CheckComboBoxItem(Size.SI_id, Size.SI_Description, false));
                }
            }

            FormLoaded = true;
        }
示例#2
0
        public IQueryable <TLCUT_CutSheetReceipt> CMTCustSheetReceipt(CMTQueryParameters parameters)
        {
            var CutSheets = _context.TLCUT_CutSheetReceipt.Where(x => x.TLCUTSHR_Issued).AsQueryable();

            if (parameters.Styles.Count > 0)
            {
                var StylePredicate = PredicateBuilder.False <TLCUT_CutSheetReceipt>();
                foreach (var CutSheet in CutSheets)
                {
                    var temp = CutSheet;
                    StylePredicate = StylePredicate.Or(s => s.TLCUTSHR_Style_FK == temp.TLCUTSHR_Style_FK);
                }

                //CutSheets = CutSheets.AsExpandable().Where(StylePredicate);
            }

            if (parameters.Colours.Count > 0)
            {
                var ColourPredicate = PredicateBuilder.False <TLCUT_CutSheetReceipt>();
                foreach (var Colour in parameters.Colours)
                {
                    var temp = Colour;
                    ColourPredicate = ColourPredicate.Or(s => s.TLCUTSHR_Colour_FK == temp.Col_Id);
                }

                // CutSheets = CutSheets.AsExpandable().Where(ColourPredicate);
            }

            return(CutSheets);
        }
示例#3
0
        private void frmDateRequired_Load(object sender, EventArgs e)
        {
            FormLoaded = false;

            using (var context = new TTI2Entities())
            {
                if (!_Mode)
                {
                    dataGridView1.Rows.Clear();

                    var Entries = (from CutSheet in context.TLCUT_CutSheet
                                   join CmtLineIssue in context.TLCMT_LineIssue on CutSheet.TLCutSH_Pk equals CmtLineIssue.TLCMTLI_CutSheet_FK
                                   where !CmtLineIssue.TLCMTLI_WorkCompleted
                                   select new { CutSheet, CmtLineIssue }).ToList();

                    foreach (var Entry in Entries)
                    {
                        var index = dataGridView1.Rows.Add();
                        dataGridView1.Rows[index].Cells[0].Value = Entry.CmtLineIssue.TLCMTLI_Pk;
                        dataGridView1.Rows[index].Cells[1].Value = false;
                        dataGridView1.Rows[index].Cells[2].Value = Entry.CutSheet.TLCutSH_No;
                        if (Entry.CmtLineIssue.TLCMTLI_Required_Date != null)
                        {
                            dataGridView1.Rows[index].Cells[3].Value = (DateTime)Entry.CmtLineIssue.TLCMTLI_Required_Date;
                        }
                    }
                }
            }
            QueryParms = new CMTQueryParameters();
            FormLoaded = true;
        }
示例#4
0
        public IQueryable <TLCMT_LineIssue> CMTLineIssue(CMTQueryParameters parameters)
        {
            _context.Configuration.AutoDetectChangesEnabled = false;

            // This particular function has been changed To call for Panels in the CMT Panel Receipt Store
            var LineIssues = _context.TLCMT_LineIssue.Where(x => !x.TLCMTLI_WorkCompleted).AsQueryable();

            // Filter out any particular CMT if neccessary
            //------------------------------------------------------------
            if (parameters.Depts.Count > 0)
            {
                var DepartmentPredicate = PredicateBuilder.False <TLCMT_LineIssue>();
                foreach (var Dept in parameters.Depts)
                {
                    var temp = Dept;
                    DepartmentPredicate = DepartmentPredicate.Or(s => s.TLCMTLI_CmtFacility_FK == temp.Dep_Id);
                }

                LineIssues = LineIssues.AsExpandable().Where(DepartmentPredicate);
            }

            if (parameters.Styles.Count > 0)
            {
                var StylesPredicate = PredicateBuilder.False <TLCMT_LineIssue>();
            }

            return(LineIssues);
        }
示例#5
0
        public IQueryable <TLADM_Styles> CMTStylesByCustomer(CMTQueryParameters parameters)
        {
            var QueryStyles = _context.TLADM_Styles.AsQueryable();

            // Filter out any particular Customers if neccessary
            //------------------------------------------------------------
            if (parameters.Customers.Count > 0)
            {
                var CustomerPredicate = PredicateBuilder.False <TLADM_Styles>();
                foreach (var Customer in parameters.Customers)
                {
                    var temp = Customer;
                    CustomerPredicate = CustomerPredicate.Or(s => s.Sty_Label_FK == Customer.Cust_Pk);
                }
                QueryStyles = QueryStyles.AsExpandable().Where(CustomerPredicate);
            }
            if (parameters.Styles.Count != 0)
            {
                var StylePredicate = PredicateBuilder.False <TLADM_Styles>();
                foreach (var Style in parameters.Styles)
                {
                    var temp = Style;
                    StylePredicate = StylePredicate.Or(s => s.Sty_Id == temp.Sty_Id);
                }
                QueryStyles = QueryStyles.AsExpandable().Where(StylePredicate);
            }

            return(QueryStyles);
        }
示例#6
0
        public IQueryable <TLCMT_AuditMeasureRecorded> SelectAMrecorded(CMTQueryParameters parameters)
        {
            var AMRecorded = _context.TLCMT_AuditMeasureRecorded.AsQueryable();

            if (parameters.MeasurementPoints.Count > 0)
            {
                var MeasurePredicate = PredicateBuilder.False <TLCMT_AuditMeasureRecorded>();
                foreach (var Measure in parameters.MeasurementPoints)
                {
                    MeasurePredicate = MeasurePredicate.Or(s => s.TLBFAR_AuditMeasure_FK == Measure.CMTMP_Pk);
                }

                AMRecorded = AMRecorded.AsExpandable().Where(MeasurePredicate);
            }

            if (parameters.Depts.Count > 0)
            {
                var DeptPredicate = PredicateBuilder.False <TLCMT_AuditMeasureRecorded>();
                foreach (var Dept in parameters.Depts)
                {
                    DeptPredicate = DeptPredicate.Or(s => s.TLBFAR_Department_FK == Dept.Dep_Id);
                }

                AMRecorded = AMRecorded.AsExpandable().Where(DeptPredicate);
            }
            return(AMRecorded);
        }
        private void frmNonComplianceSelection_Load(object sender, EventArgs e)
        {
            FormLoaded = false;
            using (var context = new TTI2Entities())
            {
                var CSheets = (from NCR in context.TLCMT_NonCompliance
                               join CS in context.TLCUT_CutSheet on NCR.CMTNCD_CutSheet_Fk equals CS.TLCutSH_Pk
                               select CS).Distinct().ToList();

                foreach (var CSheet in CSheets)
                {
                    cmboCutSheets.Items.Add(new CMT.CheckComboBoxItem(CSheet.TLCutSH_Pk, CSheet.TLCutSH_No, false));
                }

                var NonCDetails = context.TLADM_CMTNonCompliance.OrderBy(x => x.CMTNC_ShortCode).ToList();
                foreach (var Detail in NonCDetails)
                {
                    cmbONonCompliance.Items.Add(new CMT.CheckComboBoxItem(Detail.CMTNC_Pk, Detail.CMTNC_Description, false));
                }
            }

            QueryParms = new CMTQueryParameters();

            FormLoaded = true;
        }
示例#8
0
        private void cmboPrevious_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox oCmbo = (ComboBox)sender;

            if (oCmbo != null && formloaded)
            {
                var SelectedItem = (TLCMT_PanelIssue)oCmbo.SelectedItem;
                if (SelectedItem != null)
                {
                    using (var context = new TTI2Entities())
                    {
                        var PI = context.TLCMT_PanelIssue.Find(SelectedItem.CMTPI_Pk);
                        if (PI != null)
                        {
                            label2.Text = SelectedItem.CMTPI_DeliveryNumber.ToString().PadLeft(5, '0');
                            label6.Text = context.TLADM_WhseStore.Find(PI.CMTPI_FromWhse_FK).WhStore_Description;
                            label7.Text = context.TLADM_Departments.Find(PI.CMTPI_Department_FK).Dep_Description;

                            var Items = context.TLCMT_PanelIssue.Where(x => x.CMTPI_DeliveryNumber == SelectedItem.CMTPI_DeliveryNumber).ToList();
                            if (Items.Count != 0)
                            {
                                QueryParms = new CMTQueryParameters();

                                foreach (var Item in Items)
                                {
                                    QueryParms.PanelIssue.Add(Repo.LoadPanelIssue(Item.CMTPI_Pk));
                                }
                            }
                        }
                    }
                }
            }
        }
示例#9
0
        public IQueryable <TLCMT_ProductionCosts> CMTProductionsCosts(CMTQueryParameters parameters)
        {
            var ProdCosts = _context.TLCMT_ProductionCosts.AsQueryable();

            if (parameters.Styles.Count > 0)
            {
                var StylePredicate = PredicateBuilder.False <TLCMT_ProductionCosts>();
                foreach (var Style in parameters.Styles)
                {
                    StylePredicate = StylePredicate.Or(s => s.CMTP_Style_FK == Style.Sty_Id);
                }

                ProdCosts = ProdCosts.AsExpandable().Where(StylePredicate);
            }

            if (parameters.Depts.Count > 0)
            {
                var DeptPredicate = PredicateBuilder.False <TLCMT_ProductionCosts>();
                foreach (var Dept in parameters.Depts)
                {
                    DeptPredicate = DeptPredicate.Or(s => s.CMTP_CMTFacility_FK == Dept.Dep_Id);
                }

                ProdCosts = ProdCosts.AsExpandable().Where(DeptPredicate);
            }

            //-------------------------------------------------------------
            // Filter out any particular Colour if neccessary
            //------------------------------------------------------------
            if (parameters.Colours.Count > 0)
            {
                var ColourPredicate = PredicateBuilder.False <TLCMT_ProductionCosts>();
                foreach (var Colour in parameters.Colours)
                {
                    var temp = Colour;
                    ColourPredicate = ColourPredicate.Or(s => s.CMTP_Colour_FK == temp.Col_Id);
                }

                ProdCosts = ProdCosts.AsExpandable().Where(ColourPredicate);
            }

            //------------------------------------------------------------------
            // Filter out any particular Size if neccessary
            //------------------------------------------------------------
            if (parameters.Sizes.Count > 0)
            {
                var SizePredicate = PredicateBuilder.False <TLCMT_ProductionCosts>();
                foreach (var Size in parameters.Sizes)
                {
                    var temp = Size;
                    SizePredicate = SizePredicate.Or(s => s.CMTP_Size_FK == temp.SI_id);
                }

                ProdCosts = ProdCosts.AsExpandable().Where(SizePredicate);
            }

            return(ProdCosts);
        }
示例#10
0
 private void frmCMTSelection_Load(object sender, EventArgs e)
 {
     QueryParms = new CMTQueryParameters();
     using (var context = new TTI2Entities())
     {
         var CMTs = context.TLADM_Departments.Where(x => x.Dep_IsCMT).OrderBy(x => x.Dep_Description).ToList();
         foreach (var CMT in CMTs)
         {
             cmboCMT.Items.Add(new CMT.CheckComboBoxItem(CMT.Dep_Id, CMT.Dep_Description, false));
         }
     }
 }
示例#11
0
        public IQueryable <TLCMT_CompletedWork> CMTPlanedVsActual(CMTQueryParameters parameters)
        {
            var CompletedWork = (from LI in _context.TLCMT_LineIssue
                                 join WC in _context.TLCMT_CompletedWork on LI.TLCMTLI_Pk equals WC.TLCMTWC_PanelIssue_FK
                                 where LI.TLCMTLI_WorkCompleted && LI.TLCMTLI_WorkCompletedDate >= parameters.FromDate && LI.TLCMTLI_WorkCompletedDate <= parameters.ToDate
                                 select WC).AsQueryable();

            //----------------------------------------------------------------------
            // Filter out any particular Styles if neccessary
            //------------------------------------------------------------
            if (parameters.Styles.Count > 0)
            {
                var StylePredicate = PredicateBuilder.False <TLCMT_CompletedWork>();
                foreach (var Style in parameters.Styles)
                {
                    var temp = Style;
                    StylePredicate = StylePredicate.Or(s => s.TLCMTWC_Style_FK == temp.Sty_Id);
                }

                CompletedWork = CompletedWork.AsExpandable().Where(StylePredicate);
            }
            //----------------------------------------------------------------------
            // Filter out any particular Colours if neccessary
            //------------------------------------------------------------
            if (parameters.Colours.Count > 0)
            {
                var ColourPredicate = PredicateBuilder.False <TLCMT_CompletedWork>();
                foreach (var Colour in parameters.Colours)
                {
                    var temp = Colour;
                    ColourPredicate = ColourPredicate.Or(s => s.TLCMTWC_Colour_FK == temp.Col_Id);
                }

                CompletedWork = CompletedWork.AsExpandable().Where(ColourPredicate);
            }

            //----------------------------------------------------------------------
            // Filter out any particular Sizes if neccessary
            //------------------------------------------------------------
            if (parameters.Sizes.Count > 0)
            {
                var SizePredicate = PredicateBuilder.False <TLCMT_CompletedWork>();
                foreach (var Size in parameters.Sizes)
                {
                    var temp = Size;
                    SizePredicate = SizePredicate.Or(s => s.TLCMTWC_Size_FK == temp.SI_id);
                }

                CompletedWork = CompletedWork.AsExpandable().Where(SizePredicate);
            }
            return(CompletedWork);
        }
示例#12
0
        private void frmCMTPanelStock_Load(object sender, EventArgs e)
        {
            formloaded = false;

            var reportOptions = new BindingList <KeyValuePair <int, string> >();

            reportOptions.Add(new KeyValuePair <int, string>(1, "CutSheet"));
            reportOptions.Add(new KeyValuePair <int, string>(2, "Style"));
            reportOptions.Add(new KeyValuePair <int, string>(3, "Colour"));
            reportOptions.Add(new KeyValuePair <int, string>(4, "Style By Colour"));
            reportOptions.Add(new KeyValuePair <int, string>(5, "CutSheet By Style By Colour"));
            cmboReportOptions.DataSource    = reportOptions;
            cmboReportOptions.ValueMember   = "Key";
            cmboReportOptions.DisplayMember = "Value";
            cmboReportOptions.SelectedIndex = -1;


            QueryParms = new CMTQueryParameters();
            repo       = new CMTRepository();

            using (var context = new TTI2Entities())
            {
                var Existing = context.TLADM_Departments.Where(x => x.Dep_IsCMT).ToList();
                foreach (var Record in Existing)
                {
                    cmboDepartment.Items.Add(new CMT.CheckComboBoxItem(Record.Dep_Id, Record.Dep_Description, false));
                }

                var Styles = context.TLADM_Styles.ToList();
                foreach (var Record in Styles)
                {
                    comboStyles.Items.Add(new CMT.CheckComboBoxItem(Record.Sty_Id, Record.Sty_Description, false));
                }

                var Colours = context.TLADM_Colours.OrderBy(x => x.Col_Display).ToList();
                foreach (var Colour in Colours)
                {
                    comboColours.Items.Add(new CMT.CheckComboBoxItem(Colour.Col_Id, Colour.Col_Display, false));
                }

                var Sizes = context.TLADM_Sizes.ToList();
                foreach (var Size in Sizes)
                {
                    comboSizes.Items.Add(new CMT.CheckComboBoxItem(Size.SI_id, Size.SI_Description, false));
                }
            }

            formloaded = true;
        }
示例#13
0
        private void frmNCRByMonth_Load(object sender, EventArgs e)
        {
            FormLoaded = false;
            QueryParms = new CMTQueryParameters();

            using (var context = new TTI2Entities())
            {
                var Styles = context.TLADM_Styles.OrderBy(x => x.Sty_Description).ToList();
                foreach (var Style in Styles)
                {
                    cmboStyles.Items.Add(new CMT.CheckComboBoxItem(Style.Sty_Id, Style.Sty_Description, false));
                }
            }
            FormLoaded = true;
        }
示例#14
0
        public IQueryable <TLCMT_LineIssue> CutsOnHold(CMTQueryParameters parameters)
        {
            var LineIssuesCw = _context.TLCMT_LineIssue.Where(x => x.TLCMTLI_OnHold).AsQueryable();

            // Filter out any particular CMT if neccessary
            //------------------------------------------------------------
            if (parameters.Depts.Count > 0)
            {
                var DepartmentPredicate = PredicateBuilder.False <TLCMT_LineIssue>();
                foreach (var Dept in parameters.Depts)
                {
                    var temp = Dept;
                    DepartmentPredicate = DepartmentPredicate.Or(s => s.TLCMTLI_CmtFacility_FK == temp.Dep_Id);
                }

                LineIssuesCw = LineIssuesCw.AsExpandable().Where(DepartmentPredicate);
            }

            /*
             * if (parameters.Styles.Count > 0)
             * {
             *  var StylePredicate = PredicateBuilder.False<TLCMT_LineIssue>();
             *  foreach (var Style in parameters.Styles)
             *  {
             *      var temp = Style;
             *      StylePredicate = StylePredicate.Or(s => s.S.TLCUTSHR_Style_FK == temp.TLCUTSHR_Style_FK);
             *  }
             *
             *  //CutSheets = CutSheets.AsExpandable().Where(StylePredicate);
             * }
             *
             * if (parameters.Colours.Count > 0)
             * {
             *  var ColourPredicate = PredicateBuilder.False<TLCUT_CutSheetReceipt>();
             *  foreach (var Colour in parameters.Colours)
             *  {
             *      var temp = Colour;
             *      ColourPredicate = ColourPredicate.Or(s => s.TLCUTSHR_Colour_FK == temp.Col_Id);
             *
             *  }
             *
             *  // CutSheets = CutSheets.AsExpandable().Where(ColourPredicate);
             *
             * }
             */

            return(LineIssuesCw);
        }
示例#15
0
        private void frmCMTFinishedWAnalysis_Load(object sender, EventArgs e)
        {
            var reportOptions = new BindingList <KeyValuePair <int, string> >();

            formloaded = false;

            QueryParms = new CMTQueryParameters();

            reportOptions.Add(new KeyValuePair <int, string>(1, "Cut Sheet"));
            reportOptions.Add(new KeyValuePair <int, string>(2, "Style"));
            reportOptions.Add(new KeyValuePair <int, string>(3, "CMT Line"));
            reportOptions.Add(new KeyValuePair <int, string>(4, "Style By Colour"));
            reportOptions.Add(new KeyValuePair <int, string>(5, "Style By Size"));

            cmboReportOptions.DataSource    = reportOptions;
            cmboReportOptions.ValueMember   = "Key";
            cmboReportOptions.DisplayMember = "Value";
            cmboReportOptions.SelectedIndex = -1;


            using (var context = new TTI2Entities())
            {
                var Factories = context.TLADM_Departments.Where(x => x.Dep_IsCMT).OrderBy(x => x.Dep_Description).ToList();
                foreach (var Factory in Factories)
                {
                    cmboFactory.Items.Add(new CMT.CheckComboBoxItem(Factory.Dep_Id, Factory.Dep_Description, false));
                }

                var Styles = context.TLADM_Styles.OrderBy(x => x.Sty_Description).ToList();
                foreach (var Style in Styles)
                {
                    cmboStyle.Items.Add(new CMT.CheckComboBoxItem(Style.Sty_Id, Style.Sty_Description, false));
                }

                var Colours = context.TLADM_Colours.Where(x => (bool)!x.Col_Discontinued).OrderBy(x => x.Col_Display).ToList();
                foreach (var Colour in Colours)
                {
                    cmboColour.Items.Add(new CMT.CheckComboBoxItem(Colour.Col_Id, Colour.Col_Display, false));
                }

                var Sizes = context.TLADM_Sizes.Where(x => (bool)!x.SI_Discontinued).OrderBy(x => x.SI_DisplayOrder).ToList();
                foreach (var Size in Sizes)
                {
                    cmboSize.Items.Add(new CMT.CheckComboBoxItem(Size.SI_id, Size.SI_Description, false));
                }
            }
            formloaded = true;
        }
示例#16
0
        private void frmPanelStock_Load(object sender, EventArgs e)
        {
            formloaded = false;
            parms      = new CMTQueryParameters();

            using (var context = new TTI2Entities())
            {
                var Existing = context.TLADM_WhseStore.Where(x => x.WhStore_PanelStore).ToList();
                foreach (var Record in Existing)
                {
                    cmboWarehouses.Items.Add(new CMT.CheckComboBoxItem(Record.WhStore_Id, Record.WhStore_Description, false));
                }
            }

            formloaded = true;
        }
示例#17
0
        public IQueryable <TLADM_CMTMeasurementPoints> CMTMeasurementPoints(CMTQueryParameters parameters)
        {
            var MeasurePoints = _context.TLADM_CMTMeasurementPoints.AsQueryable();

            if (parameters.MeasurementPoints.Count > 0)
            {
                var MeasurePredicate = PredicateBuilder.False <TLADM_CMTMeasurementPoints>();
                foreach (var Measure in parameters.MeasurementPoints)
                {
                    MeasurePredicate = MeasurePredicate.Or(s => s.CMTMP_Pk == Measure.CMTMP_Pk);
                }

                MeasurePoints = MeasurePoints.AsExpandable().Where(MeasurePredicate);
            }

            return(MeasurePoints);
        }
示例#18
0
        public IQueryable <TLCMT_NonCompliance> CMTNonCompliance(CMTQueryParameters parameters)
        {
            IQueryable <TLCMT_NonCompliance> NonComp = null;

            if (!parameters.UseDatePicker)
            {
                NonComp = _context.TLCMT_NonCompliance.Where(x => x.CMTNCD_Year == parameters.Year).AsQueryable();
            }
            else
            {
                NonComp = _context.TLCMT_NonCompliance.Where(x => x.CMTNCD_TransDate >= parameters.FromDate && x.CMTNCD_TransDate <= parameters.ToDate).AsQueryable();
            }
            if (parameters.Styles.Count != 0)
            {
                var NonCompliancePredicate = PredicateBuilder.False <TLCMT_NonCompliance>();
                foreach (var Style in parameters.Styles)
                {
                    NonCompliancePredicate = NonCompliancePredicate.Or(s => s.CMTNCD_Style_FK == Style.Sty_Id);
                }

                NonComp = NonComp.AsExpandable().Where(NonCompliancePredicate);
            }

            if (parameters.Lines.Count != 0)
            {
                var LineCompliancePredicate = PredicateBuilder.False <TLCMT_NonCompliance>();
                foreach (var Line in parameters.Lines)
                {
                    LineCompliancePredicate = LineCompliancePredicate.Or(s => s.CMTNCD_Style_FK == Line.TLCMTCFG_Pk);
                }

                NonComp = NonComp.AsExpandable().Where(LineCompliancePredicate);
            }

            if (parameters.CutSheets.Count != 0)
            {
                var CutSheetPredicate = PredicateBuilder.False <TLCMT_NonCompliance>();
                foreach (var Line in parameters.CutSheets)
                {
                    CutSheetPredicate = CutSheetPredicate.Or(s => s.CMTNCD_CutSheet_Fk == Line.TLCutSH_Pk);
                }

                NonComp = NonComp.AsExpandable().Where(CutSheetPredicate);
            }
            return(NonComp);
        }
示例#19
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = (Button)sender;

            if (oBtn != null && FormLoaded)
            {
                CMTReportOptions repOpts = new CMTReportOptions();
                var FDate = Convert.ToDateTime(dtpFromDate.Value.ToShortDateString());
                var TDate = Convert.ToDateTime(DtpToDate.Value.ToShortDateString());
                TDate = TDate.AddHours(23);

                repOpts.fromDate = FDate;
                repOpts.toDate   = TDate;

                if (rbGradeA.Checked)
                {
                    repOpts.GradeAOnly = true;
                }
                else if (rbGradeB.Checked)
                {
                    repOpts.GradeBOnly = true;
                }
                else
                {
                    repOpts.GradeBoth = true;
                }

                if (rbUnits.Checked)
                {
                    repOpts.Units = true;
                }
                else
                {
                    repOpts.Boxes = true;
                }

                CMTQueryParameters QueryParms = new CMTQueryParameters();

                frmCMTViewRep vRep = new frmCMTViewRep(26, QueryParms, repOpts);
                int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);
            }
        }
示例#20
0
        public IQueryable <TLCMT_PanelIssue> CMTPanelIssue(CMTQueryParameters parameters)
        {
            // var PanelIssue = _context.TLCMT_PanelIssue.Where(x=>!x.CMTPI_Closed).AsQueryable();
            var PanelIssue = _context.TLCMT_PanelIssue.AsQueryable();

            if (parameters.PanelIssue.Count > 0)
            {
                var PIPredicate = PredicateBuilder.False <TLCMT_PanelIssue>();
                foreach (var PI in parameters.PanelIssue)
                {
                    PIPredicate = PIPredicate.Or(s => s.CMTPI_Pk == PI.CMTPI_Pk);
                }

                PanelIssue = PanelIssue.AsExpandable().Where(PIPredicate);
            }

            return(PanelIssue);
        }
示例#21
0
        public IQueryable <TLCUT_CutSheetReceiptDetail> CMTCutSheetReceiptDetail(CMTQueryParameters parameters)
        {
            var CutSheets = _context.TLCUT_CutSheetReceiptDetail.AsQueryable();

            if (parameters.Sizes.Count > 0)
            {
                var SizePredicate = PredicateBuilder.False <TLCUT_CutSheetReceiptDetail>();
                foreach (var Size in parameters.Sizes)
                {
                    var temp = Size;
                    SizePredicate = SizePredicate.Or(s => s.TLCUTSHRD_Size_FK == temp.SI_id);
                }

                CutSheets = CutSheets.AsExpandable().Where(SizePredicate);
            }

            return(CutSheets);
        }
示例#22
0
        public IQueryable <TLCUT_CutSheetReceipt> SelCutSheetByWhse(CMTQueryParameters parameters)
        {
            var CutSheetReceipts = _context.TLCUT_CutSheetReceipt.Where(X => !X.TLCUTSHR_Issued && X.TLCUTSHR_InPanelStore).AsQueryable();

            if (parameters.WhseStores.Count != 0)
            {
                var WhsePredicate = PredicateBuilder.False <TLCUT_CutSheetReceipt>();

                foreach (var Whse in parameters.WhseStores)
                {
                    var temp = Whse;
                    WhsePredicate = WhsePredicate.Or(s => s.TLCUTSHR_WhsePanStore_FK == temp.WhStore_Id);
                }

                CutSheetReceipts = CutSheetReceipts.AsExpandable().Where(WhsePredicate);
            }

            return(CutSheetReceipts);
        }
示例#23
0
        public IQueryable <TLADM_Sizes> CMTSizes(CMTQueryParameters parameters)
        {
            var QuerySizes = _context.TLADM_Sizes.AsQueryable();

            // Filter out any particular Customers if neccessary
            //------------------------------------------------------------
            if (parameters.Sizes.Count > 0)
            {
                var SizePredicate = PredicateBuilder.False <TLADM_Sizes>();
                foreach (var Size in parameters.Sizes)
                {
                    var temp = Size;
                    SizePredicate = SizePredicate.Or(s => s.SI_id == temp.SI_id);
                }

                QuerySizes = QuerySizes.AsExpandable().Where(SizePredicate);
            }

            return(QuerySizes);
        }
示例#24
0
        public IQueryable <TLADM_Colours> CMTColours(CMTQueryParameters parameters)
        {
            var QueryColours = _context.TLADM_Colours.AsQueryable();

            // Filter out any particular Customers if neccessary
            //------------------------------------------------------------
            if (parameters.Colours.Count > 0)
            {
                var ColourPredicate = PredicateBuilder.False <TLADM_Colours>();
                foreach (var Colour in parameters.Colours)
                {
                    var temp = Colour;
                    ColourPredicate = ColourPredicate.Or(s => s.Col_Id == temp.Col_Id);
                }

                QueryColours = QueryColours.AsExpandable().Where(ColourPredicate);
            }

            return(QueryColours);
        }
示例#25
0
        public IQueryable <TLCMT_CompletedWork> CMTCompletedWorkExport(CMTQueryParameters parameters)
        {
            var CompletedWork = _context.TLCMT_CompletedWork.Where(x => !x.TLCMTWC_CMTBilled && x.TLCMTWC_TransactionDate <= parameters.ToDate).AsQueryable();

            //--------------------------------------------------------------
            // Filter out any particular CMT if neccessary
            //------------------------------------------------------------
            if (parameters.Depts.Count > 0)
            {
                var DepartmentPredicate = PredicateBuilder.False <TLCMT_CompletedWork>();
                foreach (var Dept in parameters.Depts)
                {
                    var temp = Dept;
                    DepartmentPredicate = DepartmentPredicate.Or(s => s.TLCMTWC_CMTFacility_FK == temp.Dep_Id);
                }

                CompletedWork = CompletedWork.AsExpandable().Where(DepartmentPredicate);
            }


            return(CompletedWork);
        }
示例#26
0
        private void frmCMTWip_Load(object sender, EventArgs e)
        {
            FormLoaded = false;
            using (var context = new TTI2Entities())
            {
                var Depts = context.TLADM_Departments.Where(x => x.Dep_IsCMT).OrderBy(x => x.Dep_Description).ToList();
                foreach (var Dept in Depts)
                {
                    cmboCMT.Items.Add(new CMT.CheckComboBoxItem(Dept.Dep_Id, Dept.Dep_Description, false));
                }

                var Lines = context.TLCMT_FactConfig.OrderBy(x => x.TLCMTCFG_Description).ToList();
                foreach (var Line in Lines)
                {
                    cmboLine.Items.Add(new CMT.CheckComboBoxItem(Line.TLCMTCFG_Pk, Line.TLCMTCFG_Description, false));
                }
            }

            QueryParms = new CMTQueryParameters();

            FormLoaded = true;
        }
示例#27
0
        private void frmCMTDelivery_Load(object sender, EventArgs e)
        {
            formloaded  = false;
            label2.Text = "0";
            label6.Text = string.Empty;
            label7.Text = string.Empty;

            QueryParms = new CMTQueryParameters();

            using (var context = new TTI2Entities())
            {
                try
                {
                    formloaded = false;

                    /*
                     * var Existing = context.TLCMT_PanelIssue.Where(x => !x.CMTPI_Closed).OrderBy(x => x.CMTPI_Number).ToList();
                     * foreach (var Row in Existing)
                     * {
                     *  cmboCurrentPIMultiple.Items.Add(new CMT.CheckComboBoxItem(Row.CMTPI_Pk, Row.CMTPI_Display.ToString(), false));
                     * }
                     */

                    cmboCMT.DataSource    = context.TLADM_Departments.Where(x => x.Dep_IsCMT).ToList();
                    cmboCMT.DisplayMember = "Dep_Description";
                    cmboCMT.ValueMember   = "Dep_Id";
                    cmboCMT.SelectedValue = -1;

                    formloaded = true;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    return;
                }
            }

            formloaded = true;
        }
示例#28
0
        private void frmMPSel_Load(object sender, EventArgs e)
        {
            formloaded = false;

            QueryParms = new CMTQueryParameters();

            using (var context = new TTI2Entities())
            {
                var Departments = context.TLADM_Departments.Where(x => x.Dep_IsCMT).ToList();
                foreach (var Department in Departments)
                {
                    cmboDepartment.Items.Add(new CMT.CheckComboBoxItem(Department.Dep_Id, Department.Dep_Description, false));
                }
                cmboDepartment.SelectedValue = -1;

                var MeasurementPoints = context.TLADM_CMTMeasurementPoints.OrderBy(x => x.CMTMP_Description).ToList();
                foreach (var MeasurementPoint in MeasurementPoints)
                {
                    cmboMeasurement.Items.Add(new CMT.CheckComboBoxItem(MeasurementPoint.CMTMP_Pk, MeasurementPoint.CMTMP_Description, false));
                }
                cmboMeasurement.SelectedValue = -1;

                var Styles = context.TLADM_Styles.OrderBy(x => x.Sty_Description).ToList();
                foreach (var Style in Styles)
                {
                    cmboStyle.Items.Add(new CMT.CheckComboBoxItem(Style.Sty_Id, Style.Sty_Description, false));
                }
                cmboStyle.SelectedIndex = -1;

                var Sizes = context.TLADM_Sizes.Where(x => (bool)!x.SI_Discontinued).OrderBy(x => x.SI_DisplayOrder).ToList();
                foreach (var Size in Sizes)
                {
                    cmboSize.Items.Add(new CMT.CheckComboBoxItem(Size.SI_id, Size.SI_Description, false));
                }
                cmboStyle.SelectedIndex = -1;
            }
            formloaded = true;
        }
示例#29
0
        public IQueryable <TLCMT_LineIssue> CMTLineIssueCW(CMTQueryParameters parameters)
        {
            var LineIssuesCw = (from T1 in _context.TLCMT_LineIssue
                                join T2 in _context.TLCMT_CompletedWork on T1.TLCMTLI_Pk equals T2.TLCMTWC_LineIssue_FK
                                where T1.TLCMTLI_WorkCompleted && !T2.TLCMTWC_Despatched
                                select T1).Distinct().AsQueryable();

            // Filter out any particular CMT if neccessary
            //------------------------------------------------------------
            if (parameters.Depts.Count > 0)
            {
                var DepartmentPredicate = PredicateBuilder.False <TLCMT_LineIssue>();
                foreach (var Dept in parameters.Depts)
                {
                    var temp = Dept;
                    DepartmentPredicate = DepartmentPredicate.Or(s => s.TLCMTLI_CmtFacility_FK == temp.Dep_Id);
                }

                LineIssuesCw = LineIssuesCw.AsExpandable().Where(DepartmentPredicate);
            }

            return(LineIssuesCw);
        }
        private void frmCMTDeliveryNoteReprint_Load(object sender, EventArgs e)
        {
            FormLoaded = false;
            QueryParms = new CMTQueryParameters();

            using (var context = new TTI2Entities())
            {
                DateTime StartDate = DateTime.Now.AddMonths(-6);

                var DeliveryNotes = context.TLCMT_PanelIssue.Where(x => x.CMTPI_Closed && x.CMTPI_Date >= StartDate).ToList();
                foreach (var DeliveryNote in DeliveryNotes)
                {
                    var index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells[0].Value = DeliveryNote.CMTPI_Pk;
                    dataGridView1.Rows[index].Cells[1].Value = false;
                    dataGridView1.Rows[index].Cells[2].Value = DeliveryNote.CMTPI_DeliveryNumber;
                    dataGridView1.Rows[index].Cells[3].Value = DeliveryNote.CMTPI_Number;
                    var dt = DeliveryNote.CMTPI_Date.ToString("dd/MM/yyyy");
                    dataGridView1.Rows[index].Cells[4].Value = DeliveryNote.CMTPI_Date;
                }
            }
            FormLoaded = true;
        }