コード例 #1
0
 public ActionResult Create(int clientid2)
 {
     ProductProfile PP = new ProductProfile();
     PP.clientid = clientid2;
     PP.productmasterid = -1;
     PP.productdetailid = -1;
     PP = ProductsService.fnFillOtherPMProps(PP);
     return View(PP);
 }
コード例 #2
0
 public ActionResult LoadDetailPartial(int productdetailid)
 {
     using (db)
     {
         ProductProfile vm = new ProductProfile();
         vm.productdetailid = productdetailid;
         vm = ProductsService.FillFromPD(vm);
         vm = ProductsService.FillFromPM(vm);
         vm = ProductsService.fnFillOtherPMProps(vm);
         var vb = db.tblDivision.Find(vm.divisionid);
         ViewBag.Division = vb.Division;    // not in PP
         return PartialView("~/Views/ProductConversion/_ProductDetail.cshtml", vm);
     }
     return RedirectToAction("Index");
 }
コード例 #3
0
        public static void SaveProductMaster(ProductProfile pm)
        {
            using (var db = new EF.CMCSQL03Entities())
            {
                var q = db.tblProductMaster.Find(pm.productmasterid);

                q.UpdateDate = System.DateTime.Now;
                q.UpdateUser = HttpContext.Current.User.Identity.Name;
                q.ClientID = pm.clientid;
                q.MasterCode = pm.mastercode;
                q.MasterName = pm.mastername;
                q.SUPPLYID = pm.supplyid;
                q.Discontinued = pm.discontinued;
                q.NoReorder = pm.noreorder;
                q.PackOutOnReceipt = pm.packoutonreceipt;
                q.RestrictedToAmount = pm.restrictedtoamount;
                q.CreateDate = pm.createdate;
                q.MasterNotes = pm.masternotes;
                q.MasterNotesAlert = pm.masternotesalert;
                q.ReOrderAdjustmentDays = pm.reorderadjustmentdays;
                q.CeaseShipDifferential = pm.ceaseshipdifferential;
                q.CleanRoomGMP = pm.cleanroomgmp;
                q.NitrogenBlanket = pm.nitrogenblanket;
                q.MoistureSensitive = pm.moisturesensitive;
                q.MixWell = pm.mixwell;
                q.MixingInstructions = pm.mixinginstructions;
                q.Refrigerate = pm.refrigerate;
                q.DoNotPackAbove60 = pm.donotpackabove60;
                q.HandlingOther = pm.handlingother;
                q.FlammableGround = pm.flammableground;
                q.HeatPriorToFilling = pm.heatpriortofilling;
                q.FlashPoint = pm.flashpoint;
                q.HeatingInstructions = pm.heatinginstructions;
                q.OtherHandlingInstr = pm.otherhandlinginstr;
                q.NormalAppearence = pm.normalappearence;
                q.RejectionCriterion = pm.rejectioncriterion;
                q.Hood = pm.hood;
                q.LabHood = pm.labhood;
                q.WalkInHood = pm.walkinhood;
                q.SafetyGlasses = pm.safetyglasses;
                q.Gloves = pm.gloves;
                q.GloveType = pm.glovetype;
                q.Apron = pm.apron;
                q.ArmSleeves = pm.armsleeves;
                q.Respirator = pm.respirator;
                q.FaceShield = pm.faceshield;
                q.FullSuit = pm.fullsuit;
                q.CleanRoomEquipment = pm.cleanroomequipment;
                q.OtherEquipment = pm.otherequipment;
                q.Toxic = pm.toxic;
                q.HighlyToxic = pm.highlytoxic;
                q.ReproductiveToxin = pm.reproductivetoxin;
                q.CorrosiveHaz = pm.corrosivehaz;
                q.Sensitizer = pm.sensitizer;
                q.Carcinogen = pm.carcinogen;
                q.Ingestion = pm.ingestion;
                q.Inhalation = pm.inhalation;
                q.Skin = pm.skin;
                q.SkinContact = pm.skincontact;
                q.EyeContact = pm.eyecontact;
                q.Combustible = pm.combustible;
                q.Corrosive = pm.corrosive;
                q.Flammable = pm.flammable;
                q.Oxidizer = pm.oxidizer;
                q.Reactive = pm.reactive;
                q.Hepatotoxins = pm.hepatotoxins;
                q.Nephrotoxins = pm.nephrotoxins;
                q.Neurotoxins = pm.neurotoxins;
                q.Hepatopoetics = pm.hepatopoetics;
                q.PulmonaryDisfunction = pm.pulmonarydisfunction;
                q.ReporductiveToxin = pm.reporductivetoxin;
                q.CutaneousHazards = pm.cutaneoushazards;
                q.EyeHazards = pm.eyehazards;
                q.Health = pm.health;
                q.Flammability = pm.flammability;
                q.Reactivity = pm.reactivity;
                q.OtherEquipmentDescription = pm.otherequipmentdescription;
                q.ShlfLife = pm.shlflife;
                q.Booties = pm.booties;
                q.HazardClassGround_SG = pm.hazardclassground_sg;
                q.irritant = pm.irritant;
                q.RighttoKnow = pm.righttoknow;
                q.SARA = pm.sara;
                q.FlammableStorageRoom = pm.flammablestorageroom;
                q.FireList = pm.firelist;
                q.FreezableList = pm.freezablelist;
                q.MSDSOTHERNUMBER = pm.msdsothernumber;
                q.FREEZERSTORAGE = pm.freezerstorage;
                q.CLIENTREQ = pm.clientreq;
                q.CMCREQ = pm.cmcreq;
                q.RETURNLOCATION = pm.returnlocation;
                q.DENSITY = pm.density;
                q.SpecialBlend = pm.specialblend;
                q.SARA302EHS = pm.sara302ehs;
                q.SARA313 = pm.sara313;
                q.HalfMaskRespirator = pm.halfmaskrespirator;
                q.FullFaceRespirator = pm.fullfacerespirator;
                q.Torque = pm.torque;
                q.TorqueRequirements = pm.torquerequirements;
                q.OtherPkg = pm.otherpkg;
                q.EECAll = pm.eecall;
                q.RPhrasesAll = pm.rphrasesall;
                q.SPhrasesAll = pm.sphrasesall;
                q.PHAll = pm.phall;
                q.English = pm.english;
                q.German = pm.german;
                q.Dutch = pm.dutch;
                q.EECSymbol1 = pm.eecsymbol1;
                q.EECSymbol2 = pm.eecsymbol2;
                q.EECSymbol3 = pm.eecsymbol3;
                q.Handling = pm.handling;
                q.ShippingNotes = pm.shippingnotes;
                q.OtherLabelNotes = pm.otherlabelnotes;
                q.ProductDescription = pm.productdescription;
                q.PeroxideFormer = pm.peroxideformer;
                q.SpecificGravity = pm.specificgravity;
                q.phValue = pm.phvalue;
                q.PhysicalToxic = pm.physicaltoxic;
                q.WasteCode = pm.wastecode;
                q.CountryOfOrigin = pm.countryoforigin;
                q.LeadTime = pm.leadtime;
                q.DustFilter = pm.dustfilter;
                q.TemperatureControlledStorage = pm.temperaturecontrolledstorage;
                q.PrePacked = pm.prepacked;
                q.AlertNotesReceiving = pm.alertnotesreceiving;
                q.AlertNotesPackout = pm.alertnotespackout;

                q.WasteAccumStartDate = pm.wasteaccumstartdate;
                q.ProductSetupDate = pm.productsetupdate;

                db.SaveChanges();
            }
        }
コード例 #4
0
        public static void SaveProductDetail(ProductProfile PP)
        {
            using (var db = new EF.CMCSQL03Entities())
            {
                var q = db.tblProductDetail.Find(PP.productdetailid);

                q.UpdateDate = System.DateTime.Now;
                q.UpdateUser = HttpContext.Current.User.Identity.Name;
                q.ProductCode = PP.productcode;
                q.ProductDetailID = PP.productdetailid;
                q.ProductMasterID = PP.productmasterid;
                q.DivisionID = PP.divisionid;
                q.ProductCode = PP.productcode;
                q.ProductName = PP.productname;
                q.CustCode = PP.custcode;
                q.MultiLotReq = PP.multilotreq;
                q.ExtendableExpDt = PP.extendableexpdt;
                q.HarmonizedCode = PP.harmonizedcode;
                q.EndUse = PP.enduse;
                q.SGRevisionDate = PP.sgrevisiondate;
                q.MSDSRevisionDate = PP.msdsrevisiondate;
                q.MSDSRevisionNumber = PP.msdsrevisionnumber;
                q.LabelRevisionDate = PP.labelrevisiondate;
                q.LabelNumber = PP.labelnumber;
                q.ProductChecked = PP.productchecked;
                q.CheckedBy = PP.checkedby;
                q.CheckedWhen = PP.checkedwhen;
                q.EPABiocide = PP.epabiocide;
                q.LabelInfo = PP.labelinfo;
                q.GHSReady = PP.ghsready;
                q.CustomsValue = PP.customsvalue;
                q.CustomsValueUnit = PP.customsvalueunit;
                q.GlobalProduct = PP.globalproduct;
                q.PolymerizationHazard = PP.polymerizationhazard;
                q.SDSContactName = PP.sdscontactname;
                q.SDSContactPhone = PP.sdscontactphone;
                q.ChinaCertificationDate = PP.chinacertificationdate;
                q.LabelContactName = PP.labelcontactname;
                q.LabelContactPhone = PP.labelcontactphone;
                q.TechnicalSheet = PP.technicalsheet;
                q.TechnicalSheetRevisionDate = PP.technicalsheetrevisondate;
                q.EmergencyContactNumber = PP.emergencycontactnumber;
                q.EPAHazardousWaste = PP.epahazardouswaste;
                q.NonRCRAWaste = PP.nonrcrawaste;
                q.WasteProfileNumber = PP.wasteprofilenumber;
                q.ShippingChemicalName = PP.shippingchemicalname;
                q.LabelNotesEPA = PP.labelnotesepa;
                q.GRNUNNUMBER = PP.grnunnumber;
                q.GRNPKGRP = PP.grnpkgrp;
                q.GRNHAZSUBCL = PP.grnhazsubcl;
                q.GRNLABEL = PP.grnlabel;
                q.GRNSUBLABEL = PP.grnsublabel;
                q.GRNHAZCL = PP.grnhazcl;
                q.GRNSHIPNAME = PP.grnshipname;
                q.GRNOSNAME = PP.grnosname;
                q.GRNSHIPNAMED = PP.grnshipnamed;
                q.GRNTREMACARD = PP.grntremacard;
                q.AIRUNNUMBER = PP.airunnumber;
                q.AIRPKGRP = PP.airpkgrp;
                q.AIRHAZSUBCL = PP.airhazsubcl;
                q.AIRLABEL = PP.airlabel;
                q.AIRSUBLABEL = PP.airsublabel;
                q.AIRHAZCL = PP.airhazcl;
                q.AIRSHIPNAME = PP.airshipname;
                q.AIRNOSNAME = PP.airnosname;
                q.SEAUNNUM = PP.seaunnum;
                q.SEAPKGRP = PP.seapkgrp;
                q.SEAHAZSUBCL = PP.seahazsubcl;
                q.SEALABEL = PP.sealabel;
                q.SEASUBLABEL = PP.seasublabel;
                q.SEAHAZCL = PP.seahazcl;
                q.SEASHIPNAME = PP.seashipname;
                q.SEANOSNAME = PP.seanosname;
                q.SEASHIPNAMED = PP.seashipnamed;
                q.SEAHAZMAT = PP.seahazmat;
                q.SEAEMSNO = PP.seaemsno;
                q.SEAMFAGNO = PP.seamfagno;
                q.AlertNotesShipping = PP.alertnotesshipping;
                q.AlertNotesOrderEntry = PP.alertnotesorderentry;
                q.RCRAUNNumber = PP.rcraunnumber;
                q.RCRAPKGRP = PP.rcrapkgrp;
                q.RCRAHAZSUBCL = PP.rcrahazsubcl;
                q.RCRALABEL = PP.rcralabel;
                q.RCRASUBLABEL = PP.rcrasublabel;
                q.RCRAHAZCL = PP.rcrahazcl;
                q.RCRASHIPNAME = PP.rcrashipname;
                q.RCRANOSNAME = PP.rcranosname;
                q.Active = PP.active;
                q.AccuracyVerified = PP.accuracyverified;

                if (q.AccuracyVerified == true)
                {
                    q.AccuracyVerifiedBy = HttpContext.Current.User.Identity.Name;
                }

                db.SaveChanges();
            }
        }
コード例 #5
0
        public static int fnSaveProductProfile(ProductProfile PPVM)
        {
            // Take a VM and insert/update records and return the ProductDetailID
            int pkProductMaster = Convert.ToInt32(PPVM.productmasterid);

            if (pkProductMaster == -1)
            {
                PPVM.productmasterid = fnNewProductMasterID();
            }

            ProductsService.SaveProductMaster(PPVM);

            int pkProductDetail = Convert.ToInt32(PPVM.productdetailid);

            if (pkProductDetail == -1)
            {
                PPVM.productdetailid = fnNewProductDetailID();
            }

            ProductsService.SaveProductDetail(PPVM);

            return PPVM.productdetailid;
        }
コード例 #6
0
        public static ProductProfile fnFillOtherPMProps(ProductProfile PP)
        {
            using (var db = new EF.CMCSQL03Entities())
            {
                // Countries
                PP.ListOfCountries = (from t in db.tblCountry
                                        orderby t.Country
                                        select new SelectListItem { Value = t.Country, Text = t.Country }).ToList();

                PP.ListOfCountries.Insert(0, new SelectListItem { Value = "0", Text = "" });

                //PackagePartNumbers
                PP.ListOfPackagePartNumbers = (from t in db.tblPackage
                                                orderby t.Size
                                                select new SelectListItem { Value = t.PackageID.ToString(), Text = t.Size + " " + t.PartNumber + " " + t.Description }).ToList();

                PP.ListOfPackagePartNumbers.Insert(0, new SelectListItem { Value = "0", Text = "" });

                List<SelectListItem> gloves = new List<SelectListItem>();
                gloves.Add(new SelectListItem { Value = "", Text = "" });
                gloves.Add(new SelectListItem { Value = "GMP NITRILE", Text = "GMP NITRILE" });
                gloves.Add(new SelectListItem { Value = "NEOPRENE", Text = "NEOPRENE" });
                gloves.Add(new SelectListItem { Value = "NEOPRENE+NITRIL", Text = "NEOPRENE+NITRIL" });
                gloves.Add(new SelectListItem { Value = "NITRILE", Text = "NITRILE" });
                PP.ListOfGloves = gloves;

                PP.ListOfEquivalents = (from t in db.tblProductDetail
                                            where t.ProductMasterID == PP.productmasterid && t.ProductCode != PP.productcode
                                            select new SelectListItem { Value = t.ProductCode, Text = t.ProductCode }).ToList();

                PP.ListOfEndUsesForCustoms = (from t in db.tblEndUseForCustoms
                                              orderby t.EndUse
                                              select new SelectListItem { Value = t.EndUse, Text = t.EndUse }).ToList();

                PP.ListOfEndUsesForCustoms.Insert(0, new SelectListItem { Value = "0", Text = "" });

                PP.ListOfHarmonizedCodes = (from t in db.tblHSCode
                                            orderby t.HarmonizedCode
                                            select new SelectListItem { Value = t.HarmonizedCode, Text = t.HarmonizedCode }).ToList();

                PP.ListOfHarmonizedCodes.Insert(0, new SelectListItem { Value = "0", Text = "" });

                PP.ListOfProductCodesXRefs = (from t in db.tblProductXRef
                                              where t.CMCProductCode == PP.mastercode
                                              select new SelectListItem { Value = t.ProductXRefID.ToString(), Text = t.CustProductCode }).ToList();

                // Logo filename (needs to be moved to a Client class)
                var q = (from t in db.tblClient
                            where t.ClientID == PP.clientid
                            select new { t.ClientName, t.LogoFileName }).FirstOrDefault();

                PP.clientname = q.ClientName;
                PP.logofilename = q.LogoFileName;

                PP.ListOfDivisions = (from t in db.tblDivision
                                        where t.ClientID == PP.clientid
                                        select new SelectListItem { Value = t.DivisionID.ToString(), Text = t.Division }).ToList();

                PP.ListOfDivisions.Insert(0, (new SelectListItem { Value = "0", Text = "" }));

                PP.ListOfSupplyIDs = (from t in db.tblBulkSupplier
                                        where t.ClientID == PP.clientid
                                        select new SelectListItem { Value = t.SupplyID, Text = t.SupplyID }).ToList();

                PP.ListOfSupplyIDs.Insert(0, new SelectListItem { Value = "0", Text = "" });

                PP.ListOfProductNotes = (from t in db.tblPPPDLogNote
                                         where t.ProductDetailID == PP.productdetailid
                                         select new ProductNote
                                         {
                                             productnoteid = t.PPPDLogNoteID,
                                             productdetailid = t.ProductDetailID,
                                             notedate = t.NoteDate,
                                             notes = t.Notes,
                                             reasoncode = t.ReasonCode
                                         }).ToList();

                PP.ListOfCasNumbers = (from t in db.tblCAS
                                       where t.ProductDetailID == PP.productdetailid
                                       select new Cas
                                       {
                                           casid = t.CASID,
                                           productdetailid = t.ProductDetailID,
                                           casnumber = t.CasNumber,
                                           chemicalname = t.ChemicalName,
                                           percentage = t.Percentage,
                                           restrictedqty = t.RestrictedQty,
                                           restrictedamount = t.RestrictedAmount,
                                           reportableqty = t.ReportableQty,
                                           reportableamount = t.ReportableAmount,
                                           lessthan = t.LessThan,
                                           excludefromlabel = t.ExcludeFromLabel
                                       }).ToList();

                // example of a left outer join with concept of Flattening the join (convert to use a SQL View later)
                var qshelf = (from t in db.tblShelfMaster
                              join p in db.tblPackage on t.PackageID equals p.PackageID into temp
                              from m in temp.DefaultIfEmpty()
                              where t.ProductDetailID == PP.productdetailid
                              select new ShelfMasterViewModel
                              {
                                  shelfid = t.ShelfID,
                                  size = t.Size,
                                  bin = t.Bin,
                                  packageid = t.PackageID,
                                  notes = t.Notes,
                                  reordermin = t.ReorderMin,
                                  reordermax = t.ReorderMax,
                                  reorderqty = t.ReorderQty
                              }).ToList();

                PP.ListOfShelfItems = qshelf;
            }
            return PP;
        }
コード例 #7
0
        public static ProductProfile FillFromPD(ProductProfile PP)
        {
            using (var db = new EF.CMCSQL03Entities())
            {
                var qd = (from t in db.tblProductDetail
                            where t.ProductDetailID == PP.productdetailid
                            select t).FirstOrDefault();

                PP.productdetailid = qd.ProductDetailID;
                PP.productmasterid = qd.ProductMasterID;
                PP.divisionid = qd.DivisionID;
                PP.productcode = qd.ProductCode;
                PP.productname = qd.ProductName;
                PP.custcode = qd.CustCode;
                PP.multilotreq = qd.MultiLotReq;
                PP.extendableexpdt = qd.ExtendableExpDt;
                PP.harmonizedcode = qd.HarmonizedCode;
                PP.enduse = qd.EndUse;
                PP.sgrevisiondate = qd.SGRevisionDate;
                PP.msdsrevisiondate = qd.MSDSRevisionDate;
                PP.msdsrevisionnumber = qd.MSDSRevisionNumber;
                PP.labelrevisiondate = qd.LabelRevisionDate;
                PP.labelnumber = qd.LabelNumber;
                PP.productchecked = qd.ProductChecked;
                PP.checkedby = qd.CheckedBy;
                PP.checkedwhen = qd.CheckedWhen;
                PP.epabiocide = qd.EPABiocide;
                PP.labelinfo = qd.LabelInfo;
                PP.ghsready = qd.GHSReady;
                PP.customsvalue = qd.CustomsValue;
                PP.customsvalueunit = qd.CustomsValueUnit;
                PP.globalproduct = qd.GlobalProduct;
                PP.polymerizationhazard = qd.PolymerizationHazard;
                PP.sdscontactname = qd.SDSContactName;
                PP.sdscontactphone = qd.SDSContactPhone;
                PP.chinacertificationdate = qd.ChinaCertificationDate;
                PP.labelcontactname = qd.LabelContactName;
                PP.labelcontactphone = qd.LabelContactPhone;
                PP.technicalsheet = qd.TechnicalSheet;
                PP.technicalsheetrevisondate = qd.TechnicalSheetRevisionDate;
                PP.emergencycontactnumber = qd.EmergencyContactNumber;
                PP.epahazardouswaste = qd.EPAHazardousWaste;
                PP.nonrcrawaste = qd.NonRCRAWaste;
                PP.wasteprofilenumber = qd.WasteProfileNumber;
                PP.shippingchemicalname = qd.ShippingChemicalName;
                PP.labelnotesepa = qd.LabelNotesEPA;
                PP.grnunnumber = qd.GRNUNNUMBER;
                PP.grnpkgrp = qd.GRNPKGRP;
                PP.grnhazsubcl = qd.GRNHAZSUBCL;
                PP.grnlabel = qd.GRNLABEL;
                PP.grnsublabel = qd.GRNSUBLABEL;
                PP.grnhazcl = qd.GRNHAZCL;
                PP.grnshipname = qd.GRNSHIPNAME;
                PP.grnosname = qd.GRNOSNAME;
                PP.grnshipnamed = qd.GRNSHIPNAMED;
                PP.grntremacard = qd.GRNTREMACARD;
                PP.airunnumber = qd.AIRUNNUMBER;
                PP.airpkgrp = qd.AIRPKGRP;
                PP.airhazsubcl = qd.AIRHAZSUBCL;
                PP.airlabel = qd.AIRLABEL;
                PP.airsublabel = qd.AIRSUBLABEL;
                PP.airhazcl = qd.AIRHAZCL;
                PP.airshipname = qd.AIRSHIPNAME;
                PP.airnosname = qd.AIRNOSNAME;
                PP.seaunnum = qd.SEAUNNUM;
                PP.seapkgrp = qd.SEAPKGRP;
                PP.seahazsubcl = qd.SEAHAZSUBCL;
                PP.sealabel = qd.SEALABEL;
                PP.seasublabel = qd.SEASUBLABEL;
                PP.seahazcl = qd.SEAHAZCL;
                PP.seashipname = qd.SEASHIPNAME;
                PP.seanosname = qd.SEANOSNAME;
                PP.seashipnamed = qd.SEASHIPNAMED;
                PP.seahazmat = qd.SEAHAZMAT;
                PP.seaemsno = qd.SEAEMSNO;
                PP.seamfagno = qd.SEAMFAGNO;
                PP.rcraunnumber = qd.RCRAUNNumber;
                PP.rcrapkgrp = qd.RCRAPKGRP;
                PP.rcrahazsubcl = qd.RCRAHAZSUBCL;
                PP.rcralabel = qd.RCRALABEL;
                PP.rcrasublabel = qd.RCRASUBLABEL;
                PP.rcrahazcl = qd.RCRAHAZCL;
                PP.rcrashipname = qd.RCRASHIPNAME;
                PP.rcranosname = qd.RCRANOSNAME;
                PP.alertnotesshipping = qd.AlertNotesShipping;
                PP.alertnotesorderentry = qd.AlertNotesOrderEntry;
                PP.accuracyverified = qd.AccuracyVerified;
                PP.accuracyverifiedby = qd.AccuracyVerifiedBy;
                PP.active = qd.Active;
                PP.CreateDateDetail = qd.CreateDate;
                PP.CreateUserDetail = qd.CreateUser;
                PP.UpdateDateDetail = qd.UpdateDate;
                PP.UpdateUserDetail = qd.UpdateUser;

                return PP;
            }
        }
コード例 #8
0
        public static Inventory fnFillInventoryVM(int id)
        {
            using (var db = new CMCSQL03Entities())
            {
                Inventory vm = new Inventory();
                ProductProfile PP = new ProductProfile();

                PP.productdetailid = id;
                vm.PP = ProductsService.FillFromPD(PP);
                PP = ProductsService.FillFromPM(PP);
                PP = ProductsService.fnFillOtherPMProps(PP);

                //vm.vmMasterNotesAlert = PP.masternotesalert;    // cannot get View to properly handle this when buried in PP
                vm.ClientCode = (from t in db.tblClient
                                 where t.ClientID == PP.clientid
                                 select t.ClientCode).FirstOrDefault();

                vm.ClientUM = (from t in db.tblClient
                               where t.ClientID == id
                               select t.ClientUM).FirstOrDefault();

                vm.Division = (from t in db.tblDivision
                               where t.DivisionID == PP.divisionid
                               select t.Division).FirstOrDefault();

                var q = (from t in db.tblBulkOrderItem
                         where t.ProductMasterID == id && t.Status == "OP"
                         select t).FirstOrDefault();

                vm.BackOrderPending = q == null ? false : true;

                var q1 = (from t in db.tblBulkOrderItem
                          where t.ProductMasterID == id && t.Status == "OP"
                          select new { tot = t.Qty * t.Weight }).ToList();

                var q2 = (from x in q1 select x.tot).Sum();

                vm.BulkWeightCurrentlyOnOrder = Convert.ToDecimal(q2);

                vm.ShelfLevelTotal = StatusLevelShelf(id, "TOTAL");
                vm.ShelfLevelAvail = StatusLevelShelf(id, "AVAIL");
                vm.ShelfLevelTest = StatusLevelShelf(id, "TEST");
                vm.ShelfLevelHold = StatusLevelShelf(id, "HOLD");
                vm.ShelfLevelQC = StatusLevelShelf(id, "QC");
                vm.ShelfLevelReturn = StatusLevelShelf(id, "RETURN");
                vm.ShelfLevelRecd = StatusLevelShelf(id, "RECD");
                vm.ShelfLevelOther = StatusLevelShelf(id, "OTHER");
                vm.BulkLevelTotal = StatusLevelBulk(id, "TOTAL");
                vm.BulkLevelAvail = StatusLevelBulk(id, "AVAIL");
                vm.BulkLevelTest = StatusLevelBulk(id, "TEST");
                vm.BulkLevelHold = StatusLevelBulk(id, "HOLD");
                vm.BulkLevelQC = StatusLevelBulk(id, "QC");
                vm.BulkLevelReturn = StatusLevelBulk(id, "RETURN");
                vm.BulkLevelRecd = StatusLevelBulk(id, "RECD");
                vm.BulkLevelOther = StatusLevelBulk(id, "OTHER");
                vm.TotalLevelTotal = StatusLevelTotal(id, "TOTAL");
                vm.TotalLevelAvail = StatusLevelTotal(id, "AVAIL");
                vm.TotalLevelTest = StatusLevelTotal(id, "TEST");
                vm.TotalLevelHold = StatusLevelTotal(id, "HOLD");
                vm.TotalLevelQC = StatusLevelTotal(id, "QC");
                vm.TotalLevelReturn = StatusLevelTotal(id, "RETURN");
                vm.TotalLevelReturn = StatusLevelTotal(id, "RECD");
                vm.TotalLevelOther = StatusLevelTotal(id, "OTHER");

                return vm;
            }
        }
コード例 #9
0
 public ActionResult Edit(int id)
 {
     ProductProfile PP = new ProductProfile();
     PP.productdetailid = id;
     PP = ProductsService.FillFromPD(PP);
     PP = ProductsService.FillFromPM(PP);
     PP = ProductsService.fnFillOtherPMProps(PP);
     return View(PP);
 }
コード例 #10
0
 public ActionResult SaveProductProfile(ProductProfile PPVM)
 {
     System.Threading.Thread.Sleep(500);    // dev, remove later
     // the call to the service always returns a ProductDetailID
     int pk = ProductsService.fnSaveProductProfile(PPVM);
     return RedirectToAction("Edit", new { id = pk });
 }
コード例 #11
0
        public ActionResult PrintProfile(int id)
        {
            string footer = "--footer-left \"Printed on: " +
                DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss") +
                "                                                                                                                                    " +
                " Page: [page]/[toPage]\"" +
                " --footer-font-size \"9\" --footer-spacing 6 --footer-font-name \"calibri light\"";

            ProductProfile PP = new ProductProfile();
            PP.productdetailid = id;
            PP = ProductsService.FillFromPD(PP);
            PP = ProductsService.FillFromPM(PP);
            PP = ProductsService.fnFillOtherPMProps(PP);
            return new ViewAsPdf(PP) { CustomSwitches = footer };
        }
コード例 #12
0
 public ActionResult Equiv(int productdetailid3)
 {
     ProductProfile PP = new ProductProfile();
     PP.productdetailid = -1;
     PP.productmasterid = ProductsService.fnProductMasterID(productdetailid3);
     PP = ProductsService.FillFromPM(PP);
     PP = ProductsService.fnFillOtherPMProps(PP);
     return View("~/Views/Products/Create.cshtml", PP);
 }