Esempio n. 1
0
        public ActionResult EquipUtilSummaryWorkShiftGroups_Read([DataSourceRequest] DataSourceRequest request, string id)
        {
            DataSourceResult result = new DataSourceResult();

            using (var appDB = new ProductionDashboardDBContext())
            {
                try
                {
                    IQueryable <equipUtilTransposeWorkShiftWTDChildGroup> equipUtil = (from o in appDB.equipUtilWorkShiftWTDChildGroup
                                                                                       where o.EquipGroups == id
                                                                                       orderby o.Equipment
                                                                                       select new PseudoEUChildGroup()
                    {
                        EquipGroups = o.EquipGroups,
                        EquipmentPackageFamily = o.EquipmentPackageFamily,
                        EquipmentFamily = o.EquipmentFamily,
                        Equipment = o.Equipment,
                        ParentVendorModel = o.ParentVendorModel,
                        WorkWeek = o.WorkWeek,
                        WorkShift = o.WorkShift,
                        Target = o.Target,
                        Saturday = o.Saturday / 12,
                        Sunday = o.Sunday / 12,
                        Monday = o.Monday / 12,
                        Tuesday = o.Tuesday / 12,
                        Wednesday = o.Wednesday / 12,
                        Thursday = o.Thursday / 12,
                        Friday = o.Friday / 12,
                        TotalHours = o.TotalHours / 84,
                    });

                    result = equipUtil.ToDataSourceResult(request);
                }
                catch (Exception ex)
                {
                }

                return(Json(result, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 2
0
        public ActionResult UpdateComments(TestOutputRemarks comments)
        {
            TestOutputRemarks updateComments = pdDBContext.Remarks.FirstOrDefault(c => c.TestOutputID == comments.TestOutputID);

            HistoricalRemarks addRemarksLogs = new HistoricalRemarks();

            if (comments.Remarks != null)
            {
                addRemarksLogs.GUID            = System.Guid.NewGuid().ToString().ToUpper();
                addRemarksLogs.Department      = "TEST";
                addRemarksLogs.Operation       = "MovesToFG";
                addRemarksLogs.ConnectorID     = comments.TestOutputID;
                addRemarksLogs.UpdatedRemarks  = comments.Remarks;
                addRemarksLogs.OriginalRemarks = updateComments.Remarks;
                addRemarksLogs.CreatedBy       = Common.GetWebCurrentUser(Common.WebUserInformation.Username);
                addRemarksLogs.DateAdded       = DateTime.Now;

                pdDBContext.RemarksLogs.Attach(addRemarksLogs);
                pdDBContext.RemarksLogs.Add(addRemarksLogs);
                pdDBContext.SaveChanges();
            }


            if (updateComments != null)
            {
                updateComments.ModifiedBy   = Common.GetWebCurrentUser(Common.WebUserInformation.Username);
                updateComments.DateModified = DateTime.Now;
                updateComments.Remarks      = comments.Remarks;
            }

            using (var dbContext = new ProductionDashboardDBContext())
            {
                dbContext.Entry(updateComments).State = System.Data.EntityState.Modified;
                dbContext.SaveChanges();
            }

            return(View());
        }
Esempio n. 3
0
        public ActionResult OutsSummaryWorkShift_Read([DataSourceRequest] DataSourceRequest request, string id)
        {
            DataSourceResult result = new DataSourceResult();

            using (var appDB = new ProductionDashboardDBContext())
            {
                try
                {
                    IQueryable <outsTestTransposeWorkShiftWTDChildClass> outs = (from o in appDB.OutsTestTransposeWorkShiftWTDc
                                                                                 where o.OpClass == id
                                                                                 orderby o.Operations
                                                                                 select new PseudoWorkShiftChildClass()
                    {
                        OpClass = o.OpClass,
                        Operations = o.Operations,
                        WorkWeek = o.WorkWeek,
                        WorkShift = o.WorkShift,
                        Saturday = o.Saturday,
                        Sunday = o.Sunday,
                        Monday = o.Monday,
                        Tuesday = o.Tuesday,
                        Wednesday = o.Wednesday,
                        Thursday = o.Thursday,
                        Friday = o.Friday,
                        TotalQty = o.TotalQty,
                    });

                    result = outs.ToDataSourceResult(request);
                }
                catch (Exception ex)
                {
                }

                return(Json(result, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 4
0
        public ActionResult EquipUtilSummary_Read([DataSourceRequest] DataSourceRequest request, string fYrWk, string classification, string groupings)
        {
            DataSourceResult result = new DataSourceResult();

            if (classification.Contains("Summary"))
            {
                using (var appDB = new ProductionDashboardDBContext())
                {
                    try
                    {
                        var equipUtil = (from o in appDB.equipUtilWorkDayWTDParentGroup
                                         where o.FYrWk == fYrWk && o.Groupings == groupings
                                         orderby o.Equipment
                                         select new
                        {
                            EquipGroups = o.EquipGroups,
                            EquipmentPackageFamily = o.EquipmentPackageFamily,
                            EquipmentFamily = o.EquipmentFamily,
                            Equipment = o.Equipment,
                            ParentVendorModel = o.ParentVendorModel,
                            Target = o.Target,
                            WorkWeek = o.WorkWeek,
                            Saturday = o.Saturday / 24,
                            Sunday = o.Sunday / 24,
                            Monday = o.Monday / 24,
                            Tuesday = o.Tuesday / 24,
                            Wednesday = o.Wednesday / 24,
                            Thursday = o.Thursday / 24,
                            Friday = o.Friday / 24,
                            TotalHours = o.TotalHours / 168
                        }).ToList();

                        result = equipUtil.ToDataSourceResult(request);
                    }
                    catch (Exception ex)
                    {
                    }

                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
            }

            else
            {
                using (var appDB = new ProductionDashboardDBContext())
                {
                    try
                    {
                        var equipUtil = (from o in appDB.equipUtilWorkDayWTDParentClass
                                         where o.FYrWk == fYrWk && o.Classification == classification
                                         orderby o.Equipment
                                         select new
                        {
                            EquipClass = o.EquipClass,
                            EquipmentPackageFamily = o.EquipmentPackageFamily,
                            EquipmentFamily = o.EquipmentFamily,
                            Equipment = o.Equipment,
                            ParentVendorModel = o.ParentVendorModel,
                            Target = o.Target,
                            WorkWeek = o.WorkWeek,
                            Saturday = o.Saturday / 24,
                            Sunday = o.Sunday / 24,
                            Monday = o.Monday / 24,
                            Tuesday = o.Tuesday / 24,
                            Wednesday = o.Wednesday / 24,
                            Thursday = o.Thursday / 24,
                            Friday = o.Friday / 24,
                            TotalHours = o.TotalHours / 168
                        }).ToList();

                        result = equipUtil.ToDataSourceResult(request);
                    }
                    catch (Exception ex)
                    {
                    }

                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
            }
        }
Esempio n. 5
0
        public ActionResult OutsSummaryWW_Read([DataSourceRequest] DataSourceRequest request, string fYrWk, string classification, string groupings)
        {
            DataSourceResult result = new DataSourceResult();

            if (classification.Contains("Summary"))
            {
                using (var appDB = new ProductionDashboardDBContext())
                {
                    try
                    {
                        var outs = (from o in appDB.OutsTestTransposeWorkDayWTDg
                                    where o.FYrWk == fYrWk && o.Groupings == groupings
                                    orderby o.Operations
                                    select new
                        {
                            OpGroups = o.OpGroups,
                            Operations = o.Operations,
                            WorkWeek = o.WorkWeek,
                            Saturday = o.Saturday,
                            Sunday = o.Sunday,
                            Monday = o.Monday,
                            Tuesday = o.Tuesday,
                            Wednesday = o.Wednesday,
                            Thursday = o.Thursday,
                            Friday = o.Friday,
                            TotalQty = o.TotalQty,
                        }
                                    ).ToList();

                        result = outs.ToDataSourceResult(request);
                    }
                    catch (Exception ex)
                    {
                    }

                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
            }

            else
            {
                using (var appDB = new ProductionDashboardDBContext())
                {
                    try
                    {
                        var outs = (from o in appDB.OutsTestTransposeWorkDayWTDc
                                    where o.FYrWk == fYrWk && o.Classification == classification
                                    orderby o.Operations
                                    select new
                        {
                            OpClass = o.OpClass,
                            Operations = o.Operations,
                            WorkWeek = o.WorkWeek,
                            Saturday = o.Saturday,
                            Sunday = o.Sunday,
                            Monday = o.Monday,
                            Tuesday = o.Tuesday,
                            Wednesday = o.Wednesday,
                            Thursday = o.Thursday,
                            Friday = o.Friday,
                            TotalQty = o.TotalQty,
                        }
                                    ).ToList();

                        result = outs.ToDataSourceResult(request);
                    }
                    catch (Exception ex)
                    {
                    }

                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
            }
        }