Пример #1
0
        public HomeForm(Controller.Controller ctrl)
        {
            this.ctrl = ctrl;
            try
            {
                ctrl.readFromFile("transactions.txt");
            }
            catch (MyException ex)
            {
                MessageBox.Show(ex.getMessage());
            }

            if (this.ctrl.errorCounter > 0)
            {
                MessageBox.Show("No of errors: " + this.ctrl.errorCounter);
            }


            this.Text = "Real Estate Agency";
            this.Size = new Size(600, 600);
            this.CenterToScreen();

            this.addListView();
            this.addButtons();
        }
Пример #2
0
        private void btnAceptarE_Click(object sender, EventArgs e)
        {
            String idestudiante        = txtId.Text;
            String codigoestudiante    = txtCodigo.Text;
            String nombreestudiante    = txtNombre.Text;
            String apellidoestudiante  = txtApellido.Text;
            String telefonoestudiante  = txtTelefono.Text;
            String direccionestudiante = txtDireccion.Text;
            String correoestudiante    = txtCorreo.Text;

            if (f == false)
            {
                rutafotoestudiante = "0";
            }
            modelo.Estudiante objE = new modelo.Estudiante(idestudiante, codigoestudiante, nombreestudiante, apellidoestudiante,
                                                           telefonoestudiante, direccionestudiante, correoestudiante, rutafotoestudiante);

            Controller.Controller objC = new Controller.Controller();
            bool resul = objC.pasarDatosInsertE(objE);

            if (resul)
            {
                MessageBox.Show("Datos insertados");
            }
            else
            {
                MessageBox.Show("Datos No insertados");
            }
        }
Пример #3
0
        public ReportPane(Controller.Controller contr)
        {
            controller = contr;

            InitializeComponent();
            PaintGraphics();
        }
Пример #4
0
 static void Main(string[] args)
 {
     Repository<Student> repo = new Repository<Student>();
     Validator val = new Validator(repo);
     Controller.Controller ctrl = new Controller.Controller(repo, val);
     UI.Console cons = new UI.Console(ctrl);
 }
Пример #5
0
 public consoleForm(Controller.Controller controller)
 {
     InitializeComponent();;
     _controller         = controller;
     logTextBox.WordWrap = true;
     logTextBox.AppendText(_controller.Log);
 }
Пример #6
0
 public Console(Controller.Controller ctrl)
 {
     this.ctrl = ctrl;
     this.lessThanFiveObserver.Subscribe (this.ctrl);
     this.greaterOrEqualToFiveObserver.Subscribe (this.ctrl);
     this.run();
 }
Пример #7
0
 public Console(Controller.Controller ctrl)
 {
     this.ctrl = ctrl;
     this.lessThanFiveObserver.Subscribe(this.ctrl);
     this.greaterOrEqualToFiveObserver.Subscribe(this.ctrl);
     this.run();
 }
Пример #8
0
        //
        /// <summary>
        /// recive command from client and send to controller that translate the command and send to
        /// model to perfrom
        /// </summary>
        /// <param name="client"> the client that </param>
        /// <param name="controller">the controller that communicate betwen client  and servrer</param>
        public void HandleClient(TcpClient client, Controller.Controller controller)
        {
            new Task(() =>
            {
                while (true)
                {
                    try
                    {
                        //try accept message from client
                        string commandLine = reader.ReadString();
                        //if requestto close ,get out from loop
                        if (commandLine.Equals("close me"))
                        {
                            break;
                        }
                        //sent the command to controller to send to model to execute the command
                        string result = controller.ExecuteCommand(commandLine, cclient);
                        //response back to client
                        writer.Write(result);
                    }
                    catch
                    {
                        break;
                    }
                }

                client.Close();
            }).Start();
        }
Пример #9
0
 public CreateConference(Controller.Controller controller, ConferenceChair newChair)
 {
     InitializeComponent();
     this.controller = controller;
     controller.repository.ConferenceSet.Load();
     this.newChair = newChair;
 }
Пример #10
0
 public Simulator()
 {
     InitializeComponent();
     InitializeRefreshGuiProcess();
     _controller          = new AlgorithController(Render);
     DashBoard.Controller = _controller;
 }
Пример #11
0
        //a function that create a controller and pass to it the retured string of the input
        public void ihm()
        {
            Controller.Controller c = new Controller.Controller();
            string msg = getUserInput();

            c.lowerToUper(msg);
        }
Пример #12
0
        private void btnAceptarE_Click(object sender, EventArgs e)
        {
            String idestudiante        = txtId.Text;
            String codigoestudiante    = txtCodigo.Text;
            String nombreestudiante    = txtNombre.Text;
            String apellidoestudiante  = txtApellido.Text;
            String telefonoestudiante  = txtTelefono.Text;
            String direccionestudiante = txtDireccion.Text;
            String correoestudiante    = txtCorreo.Text;
            String rutafotoestudiante  = "0";

            modelo.Estudiante objE = new modelo.Estudiante(idestudiante, codigoestudiante, nombreestudiante, apellidoestudiante,
                                                           telefonoestudiante, direccionestudiante, correoestudiante, rutafotoestudiante);

            Controller.Controller objC = new Controller.Controller();
            String cod = txtCodigo.Text;
            bool   r   = objC.modificarEstudiante(objE, cod);

            if (r)
            {
                MessageBox.Show("Se ha modificado el estudiante correctamente");
            }
            else
            {
                MessageBox.Show("No se ha modificado el estudiante correctamente");
            }
        }
Пример #13
0
        public ParticipantWindow(Listener listener, Controller.Controller ctrl)
        {
            InitializeComponent();
            this.ctrl     = ctrl;
            this.listener = listener;
            this.Text     = listener.Username;

            var context   = this.ctrl.repository;
            var abstracts = context.AbstractSet.ToList();
            var authors   = new Dictionary <Abstract, String>();

            //filling the abstract gridView
            foreach (Abstract abs in abstracts)
            {
                var authorString = "";
                foreach (Author auth in abs.Authors)
                {
                    authorString += auth.Name + ",";
                }
                authorString = authorString.Remove(authorString.Length - 1);
                authors[abs] = authorString;
            }
            if (!(abstracts.Capacity == 0))
            {
                this.abstractsGridView.DataSource =
                    abstracts.Select(a => new { a.Id, a.Name, a.Keywords, a.Topics, a.Description, Authors = authors[a] }).ToList();
            }
            var sessions = context.SessionSet.ToList();
            //filling the session gridView
            var speakers = new Dictionary <Session, string>();

            foreach (Session ses in sessions)
            {
                var authorString = "";
                foreach (Author auth in ses.Speakers)
                {
                    authorString += auth.Name + ",";
                }
                authorString  = authorString.Remove(authorString.Length - 1);
                speakers[ses] = authorString;
            }
            var papers = new Dictionary <Session, String>();

            foreach (Session ses in sessions)
            {
                var paperString = "";
                foreach (Paper pap in ses.Papers)
                {
                    paperString += pap.Name + ",";
                }
                paperString = paperString.Remove(paperString.Length - 1);
                papers[ses] = paperString;
            }
            if (!(sessions.Capacity == 0))
            {
                this.sessionsGridView.DataSource =
                    sessions.Select(s => new { s.Id, s.Place, SessionChair = s.SessionChair.Name, s.Time, Speakers = speakers[s], Papers = papers[s] }).ToList();
            }
        }
Пример #14
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="conr">recive controller </param>

        public MazeModel(Controller.Controller conr)
        {
            Mazes         = new Dictionary <string, Maze>();
            games         = new Dictionary <string, Game>();
            Sol           = new Dictionary <string, SolutionDetails <Direction> >();
            clientInGames = new Dictionary <ICClientHandler, string>();
            controller    = conr;
        }
Пример #15
0
        static void Main(string[] args)
        {
            //pull data from the API
            InitializeDataFileXML.PullDataApi();

            //instantiate the controller
            Controller.Controller appController = new Controller.Controller();
        }
Пример #16
0
        private void DirectoryTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            ////Perform actions when SelectedItem changes
            DirInfo dir = e.NewValue as DirInfo;

            Controller.Controller controller = DataContext as Controller.Controller;

            controller.SelectedDirectory ??= dir;
        }
Пример #17
0
        public PlayerController(InputKeys inputKeys, Action <int, int, int> gameOverAction)
        {
            _inputKeys = inputKeys;

            GameModel = new TetrisModel(PlayerPrefs.GetInt("BoardWidth"), PlayerPrefs.GetInt("BoardHeight"));
            GameController = new Controller.Controller(GameModel);
            GameView = new TetrisView(GameModel, GameController);
            GameModel.GameOver += (sender, args) => gameOverAction(args.CollectedLinesCount, args.Score, args.Level);
        }
Пример #18
0
        public Form1()
        {
            InitializeComponent();
            first = new Controller.Controller();
            c     = first;

            locationLabel.Text = "";
            labelFound.Text    = "";
        }
        private void OpTimer_Tick(object sender, EventArgs e)
        {
            switch (operation)
            {
            case ProcessOp.Program:
                this.opTimer.Enabled = false;
                Controller.Controller mController = Controller.Controller.GetController();
                mController.ProgrammingProgress  += new ProgressEventHandler(MController_ProgrammingProgress);
                mController.ProgrammingCompleted += new EventHandler(MController_ProgrammingCompleted);
                mController.ProgrammingCanceled  += new EventHandler(MController_ProgrammingCanceled);

                try
                {
                    if (mController.Firmware == "2.0.1")
                    {
                        this.bClose.Enabled          = true;
                        this.pbProgramMoway.Image    = this.icons.Images[(int)ProcessState.Error];
                        this.lProgramMoway.ForeColor = Color.FromArgb(208, 0, 0);
                        this.lProgramMoway.Text      = Moway.Server.Processes.ProcessMessages.VERSION_ERROR;
                        return;
                    }
                    this.tProgramLimited.Enabled = true;
                    mController.ProgramMoway(this.hexFile);
                }
                catch (ControllerException ex)
                {
                    this.bClose.Enabled          = true;
                    this.pbProgramMoway.Image    = this.icons.Images[(int)ProcessState.Error];
                    this.lProgramMoway.ForeColor = Color.FromArgb(208, 0, 0);
                    switch (ex.Message)
                    {
                    case "File not found":
                        this.lProgramMoway.Text = ProcessMessages.FILE_NOT_FOUND;
                        break;

                    case "Moway disconnected":
                        this.lProgramMoway.Text = ProcessMessages.MOWAY_DISCONNECTED;
                        break;

                    case "Moway busy":
                        this.lProgramMoway.Text = ProcessMessages.MOWAY_BUSY;
                        break;

                    default:
                        this.lProgramMoway.Text = ProcessMessages.PROGRAMMOWAY_ERROR;
                        break;
                    }
                }
                break;

            case ProcessOp.Close:
                this.DialogResult = DialogResult.OK;
                this.Close();
                break;
            }
        }
Пример #20
0
        public HomeForm(Controller.Controller ctrl)
        {
            this.ctrl = ctrl;
            this.Text = "Real Estate Agency";
            this.Size = new Size(600, 600);
            this.CenterToScreen();

            this.addListView();
            this.addButtons();
        }
Пример #21
0
        public MainMenu(Controller.Controller ctrl)
        {
            InitializeComponent();
            controller  = ctrl;
            conferences = ctrl.repository.ConferenceSet;
            conferences.Load();

            this.ConferenceGrid.DataSource =
                conferences.Select(c => new { c.Name, c.StartDate, c.EndDate, Chair = c.ConferenceChair.Name }).ToList();
        }
Пример #22
0
        public HomeForm(Controller.Controller ctrl)
        {
            this.ctrl = ctrl;
            this.Text = "Real Estate Agency";
            this.Size = new Size(600, 600);
            this.CenterToScreen();

            this.addListView();
            this.addButtons();
        }
Пример #23
0
 //Uses the CurrentScene to attribute a Controller to CurrentController
 public static void LoadScene()
 {
     foreach (Controller.Controller c in Global.Controllers)
     {
         if (CurrentScene == c.GetType().Name)
         {
             CurrentController = c;
         }
     }
 }
Пример #24
0
        static void Main()
        {
            RepoInterface<Student> repo = new Repository<Student>();
            Validator val = new Validator(repo);
            Controller.Controller ctrl = new Controller.Controller(repo, val);
            ctrl.readFromFile("students.txt");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new HomeForm(ctrl));
        }
Пример #25
0
        public HomeForm(Controller.Controller ctrl)
        {
            this.ctrl = ctrl;
            this.Text = "Students Manager";
            this.Size = new Size(600, 600);
            this.CenterToScreen();

            this.addListView();
            this.addButtons();
            this.addComboBox();
        }
Пример #26
0
        public HomeForm(Controller.Controller ctrl)
        {
            this.ctrl = ctrl;
            this.Text = "Students Manager";
            this.Size = new Size(600, 600);
            this.CenterToScreen();

            this.addListView();
            this.addButtons();
            this.addComboBox();
        }
Пример #27
0
        public Form1()
        {
            //RedditAggregator.RedditAggregator.TrainModels();
            Controller.Controller _ = Controller.Controller.Instance;
            //now update all comments
            Comment.RepredictAll();

            InitializeComponent();
            subRedditList.Items.AddRange(subReddits.ToArray());
            FormClosed += Form1_FormClosed;
        }
Пример #28
0
 public PaperWindow(Paper pap, Controller.Controller ctrl)
 {
     InitializeComponent();
     this.ctrl           = ctrl;
     this.pap            = pap;
     this.nameLabel.Text = pap.Name;
     if (this.pap.Content == "")
     {
         this.uploadLabel.Text = "Uploaded";
     }
 }
Пример #29
0
 private void chooseLocationButton_Click(object sender, EventArgs e)
 {
     if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         locationLabel.Text = "Custom Location: " + folderBrowserDialog1.SelectedPath;
         c = new Controller.Controller(folderBrowserDialog1.SelectedPath);
         if (locationLabel.Right > this.Width)
         {
             locationLabel.Left = this.Width - locationLabel.Width - 20;
         }
     }
 }
Пример #30
0
        public AddStudentForm(Controller.Controller ctrl)
        {
            this.ctrl = ctrl;
            this.Size = new Size(600, 600);
            this.Text = "Add Student";
            this.CenterToScreen();

            this.addButtons();
            this.addComboBox();
            this.addTextBoxes();
            this.addLabels();
        }
Пример #31
0
        public AddStudentForm(Controller.Controller ctrl)
        {
            this.ctrl = ctrl;
            this.Size = new Size(600, 600);
            this.Text = "Add Student";
            this.CenterToScreen();

            this.addButtons();
            this.addComboBox();
            this.addTextBoxes();
            this.addLabels();
        }
Пример #32
0
        public TestGUI_Controller(Controller.Controller controller)
        {
            m_Controller         = controller;
            m_frmMain            = new TestGUI();
            m_frmMain.controller = this;

            //m_ppMain = new uiwPreviewPopup();
            //m_frmMain.Controls.Add(m_ppMain);
            //m_ppMain.BringToFront();
            m_ppMain = m_frmMain.uippMain;

            //run startup logic
            StartupLogic();
        }
Пример #33
0
        public TetrisView(TetrisModel model, Controller.Controller controller)
        {
            _model = model;
            _controller = controller;

            _model.MovementDone += OnMovementDone;
            _model.RotateDone += OnRotateDone;
            _model.ShapeAdded += OnShapeAdded;
            _model.LinesDestroyed += OnLinesDestroyed;
            _model.GameOver += OnGameOver;
            _model.ShapeDropping += OnShapeDropping;
            _model.ShapeIsAttachedAddListener(OnShapeIsAttached);
            _model.BlockIsAttachedAddListener(OnAttachedBlock);
        }
Пример #34
0
        internal void Init(Model.Model model, Controller.Controller controller, IElementProvider elementProvider)
        {
            this.controller      = controller;
            this.model           = model;
            this.elementProvider = elementProvider;

            this.Graph                      = new Graph(model);
            this.Graph.DrawGraph           += (sender, args) => this.DrawGraph();
            this.Graph.ElementAdded        += (sender, args) => this.ElementAdded?.Invoke(this, args);
            this.Graph.AddNewVertexControl += (sender, args) => this.AddNewVertexControl(args.DataVert);
            this.Graph.AddNewEdgeControl   += (sender, args) => this.AddNewEdgeControl(args.EdgeViewModel);

            this.InitGraphXLogicCore();
        }
Пример #35
0
        public GUI(Controller.Controller controller)
        {
            InitializeComponent();
            this.controller = controller;
            List <string> currencies  = controller.getCurrencies();
            List <string> investments = controller.getInvestments();

            for (int i = 0; i < currencies.Count; i++)
            {
                cmBoxCurrency.Items.Add(currencies.ElementAt(i));
            }
            for (int i = 0; i < investments.Count; i++)
            {
                cmBoxInvSystem.Items.Add(investments.ElementAt(i).Replace('_', ' '));
            }
        }
Пример #36
0
        /// <summary>
        /// Erstellt neues Controller-Objekt und ruft dessen StartProcess-Methode auf.
        /// Wenn die Methode eine message zurückgibt, wird Form2 mit der message aufgerufen.
        /// </summary>
        /// <param name="filePath_Model">Dateipfad im Typ string</param>
        /// <param name="filePath_Output">Ausgabepfad im Typ string</param>
        public void CreateController(string filePath_Model, string filePath_Output)
        {
            Controller.Controller controller = new Controller.Controller();
            string message = controller.StartProcess(filePath_Model, filePath_Output, out Datamodel.Datamodel dtm);

            if (message != null)
            {
                new Form2(message).ShowDialog();
                this.Show();
            }
            else if (dtm != null)
            {
                WritePrewiev(filePath_Output, dtm);
                Cursor = Cursors.Default;
            }
        }
Пример #37
0
        public MainGUI_Controller(Controller.Controller controller)
        {
            m_Controller         = controller;
            m_frmMain            = new MainGUI();
            m_frmMain.controller = this;

            //m_ppMain = new uiwPreviewPopup();
            //m_frmMain.Controls.Add(m_ppMain);
            //m_ppMain.BringToFront();
            m_ppSizeDimensions = m_frmMain.ppSizeDimensions;
            m_ppColor          = m_frmMain.ppColor;
            m_ppSpecial        = m_frmMain.ppSpecial;

            //run startup logic
            StartupLogic();
        }
Пример #38
0
        public void TestSerialization()
        {
            Project sampleProject = TestUtils.CreateSampleProject();

            Controller.Controller c       = new Controller.Controller(sampleProject);
            cmdDeletePIMAttribute command = new cmdDeletePIMAttribute(c);

            command.Set(sampleProject.SingleVersion.PIMSchema.PIMAttributes[0]);

            XDocument document = CommandSerializer.CreateEmptySerializationDocument();

            //ser.Serialize(command, rootElement);
            //ser.Serialize(command, rootElement);
            //ser.Serialize(command, rootElement);
            Assert.Inconclusive();
            //document.Save("TestCommandSerialization.xml");
        }
Пример #39
0
        SquareView[,] squares; /*!< Tableau a deux dimensions des vues des cases */

        #endregion Fields

        #region Constructors

        /*!
        * \fn MainGame()
        * \brief Constructeur standard de la vue du jeu
                * \return
        */
        public MainGame()
        {
            wplayer = new WMPLib.WindowsMediaPlayer();
            InitializeComponent();
            controller = new Controller.Controller(this);
            log = new LogView(this);
            App.wrapper.setObserver(this);
            InitializeTabs();
            InitializeGameGrid();
            InitializePlayersView();
            MouseMove += onShootMouseMove;
            MouseUp += onShootMouseUp;
            shootLine = new Line();
            ShowCurrentPlayer();
            animateBackground();

            var path = System.IO.Path.Combine(
                 System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
                , "sounds/theme.mp3");
            wplayer.URL = path;
            wplayer.controls.play();
            wplayer.PlayStateChange += new _WMPOCXEvents_PlayStateChangeEventHandler(player_PlayStateChange);
        }
Пример #40
0
        public HomeForm(Controller.Controller ctrl)
        {
            this.ctrl = ctrl;
            try
            {
                ctrl.readFromFile("transactions.txt");
            }
            catch (MyException ex)
            {
                MessageBox.Show(ex.getMessage());
            }

            if (this.ctrl.errorCounter > 0)
            {
                MessageBox.Show("No of errors: " + this.ctrl.errorCounter);
            }

            this.Text = "Real Estate Agency";
            this.Size = new Size(600, 600);
            this.CenterToScreen();

            this.addListView();
            this.addButtons();
        }
 private void registerButton_Click(object sender, EventArgs e)
 {
     Controller.Controller con = new Controller.Controller();
 }
Пример #42
0
 public Console(Controller.Controller ctrl)
 {
     this.ctrl = ctrl;
     this.run();
 }
Пример #43
0
Файл: Dal.cs Проект: TestJOD/t4
 //detta fungerar! Hurra!!
 public static void Main()
 {
     Controller.Controller c = new Controller.Controller();
     Dal d = new Dal();
     Console.WriteLine(d.TestarSql());
 }
Пример #44
0
 public DesktopAppMainForm()
 {
     InitializeComponent();
     DesktopApp.Controller.Controller controller = new Controller.Controller();
 }
Пример #45
0
 public FollowModeForm()
 {
     InitializeComponent();
     DesktopApp.Controller.Controller controller = new Controller.Controller();
 }
Пример #46
0
 public LogIn()
 {
     InitializeComponent();
     ct = new Controller.Controller();
 }