Exemple #1
0
        public bool CreateSpecifications(Specification specificationModel, int recordID)
        {
            try
            {
                CatalogDatabaseDataContext         context              = new WorkLinqToSql.CatalogDatabaseDataContext();
                WorkLinqToSql.Specification        specification        = new WorkLinqToSql.Specification();
                WorkLinqToSql.MachineSpecification machinespecification = new MachineSpecification();

                specification.Name  = specificationModel.Name;
                specification.Value = specificationModel.Value;

                machinespecification.MachineID     = recordID;
                machinespecification.Specification = specification;

                context.Specifications.InsertOnSubmit(specification);
                context.MachineSpecifications.InsertOnSubmit(machinespecification);


                context.Specifications.Context.SubmitChanges();
                context.MachineSpecifications.Context.SubmitChanges();
            }
            catch
            {
                return(false);
            }

            return(true);
        }
Exemple #2
0
 public static IExpectProducer ForMachine() => MachineSpecification.Initialize();