Пример #1
0
        private void btnFind_Click(object sender, RoutedEventArgs e)
        //Find a module & display it
        {
            DataFacadeSingleton df = DataFacadeSingleton.getInstance(); //Get access to te the data layer

            myModule = df.getModule(Int32.Parse(txtCode.Text));         //find module
            if (myModule != null)                                       //if module found
            {
                update();                                               //display details
            }
        }
Пример #2
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            //Save the existing module to the DataLayer
            try
            {
                myModule.code = Int32.Parse(txtCode.Text);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            myModule.name = txtName.Text;

            //Get access to the datalayer
            DataFacadeSingleton df = DataFacadeSingleton.getInstance();

            //Save the module
            df.addModule(myModule);
        }
Пример #3
0
 public static DataFacadeSingleton GetInstance()
 {
     return(reference ?? (reference = new DataFacadeSingleton()));
 }