Exemplo n.º 1
0
        public static void CreateFormPhaseRecord(int operationalLicensesFormID, string userName, int formState, int devPhase, int PUN)
        {
            OperationalLicensesFormPhase olfp;

            // Query the database for the rows to be deleted.
            using (var db = new Models.SmizeeContext())
            {
                olfp = new OperationalLicensesFormPhase();
                olfp.DevelopmentPhaseID        = devPhase;
                olfp.ProductionUnitsNumber     = PUN;
                olfp.OperationalLicensesFormID = operationalLicensesFormID;
                db.OperationalLicensesFormPhases.Add(olfp);
                db.SaveChanges();
            }
        }
        public static int?GetFormDevelopmentPhase(int operationalLicensesFormID, int developmentPhaseID)
        {
            int?productionUnitsNumber;

            var db = new Models.SmizeeContext();

            using (SmizeeContext Context = new SmizeeContext())
            {
                OperationalLicensesFormPhase formDevPhase = Context.OperationalLicensesFormPhases.FirstOrDefault(o => o.OperationalLicensesFormID == operationalLicensesFormID & o.DevelopmentPhaseID == developmentPhaseID);
                if (formDevPhase == null)
                {
                    return(null);
                }
                productionUnitsNumber = formDevPhase.ProductionUnitsNumber;
            }
            return(productionUnitsNumber);
        }