//private Random rnd = new Random();

        public ControlWindow()
        {
            InitializeComponent();

            _cont = new DBModelContext();

            //TODO убрать это
            int count = _cont.ScenarioSet.ToList().Count;

            if (count == 0 && File.Exists("dbo.TemperatureDatas.data.sql"))
            {
                try
                {
                    using (SqlConnection conn = new SqlConnection(DBModelContext.GetConnectingString()))
                    {
                        conn.Open();
                        SqlCommand com = new SqlCommand(File.ReadAllText("dbo.TemperatureDatas.data.sql"), conn);
                        com.ExecuteNonQuery();
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show($"Ошибка:\n{e}");
                }
            }

            LoadRecomendations();
            LoadActions();
        }
Example #2
0
        public void TestMethod1()
        {
            Reflector reflector = new Reflector();

            reflector.Reflect(pathh);
            ISerializer    ser = new DatabaseSerializer();
            DBModelContext db  = new DBModelContext();

            ser.Serialize(reflector.AssemblyModel.MapUp(), null);
            AssemblyMetadata assemblyTest = new AssemblyMetadata(ser.Deserialize(null));


            Assert.AreEqual(4, assemblyTest.m_Namespaces.ToList().Count());
        }
Example #3
0
        public void MethotsInClass()
        {
            Reflector reflector = new Reflector();

            reflector.Reflect(pathh);
            ISerializer    ser = new DatabaseSerializer();
            DBModelContext db  = new DBModelContext();

            ser.Serialize(reflector.AssemblyModel.MapUp(), null);
            AssemblyMetadata assemblyTest = new AssemblyMetadata(ser.Deserialize(null));

            List <TypeMetadata> test = assemblyTest.m_Namespaces.ToList().Find(t => t.m_NamespaceName == "TPA.ApplicationArchitecture.BusinessLogic").m_Types.ToList();

            Assert.AreEqual(6, test.First().m_Methods.ToList().Count);
        }
Example #4
0
 //Constructors
 public OrderService()
 {
     db = new DBModelContext();
 }
Example #5
0
 //Constructors
 public SalesmanService()
 {
     db = new DBModelContext();
 }
Example #6
0
 //Constructors
 public ContactService()
 {
     db = new DBModelContext();
 }
Example #7
0
 //Constructors
 public ProductDetailService()
 {
     db = new DBModelContext();
 }
Example #8
0
 //Constructors
 public DriveTestService()
 {
     db = new DBModelContext();
 }
Example #9
0
 //Constructors
 public TestCarService()
 {
     db = new DBModelContext();
 }
Example #10
0
 //Constructors
 public ProspectService()
 {
     db = new DBModelContext();
 }
 //Constructors
 public CustomerService()
 {
     db = new DBModelContext();
 }
 //Constructors
 public RemainderService()
 {
     db = new DBModelContext();
 }
Example #13
0
 public InvoiceService()
 {
     db = new DBModelContext();
 }
 //Constructors
 public SpecialOfferService()
 {
     db = new DBModelContext();
 }