public HomeController() { photosWebModel = new PhotosWebModel(configModel.OutputDirectory); string outputdirPath = configModel.OutputDirectory; imageWebModel = new ImageWebModel(outputdirPath); }
// GET: First/Details public ActionResult ImageWeb() { students = GetStudents(); ImageWebModel model = new ImageWebModel(students); return(View(model)); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); ImageWebModel model = ImageWebModel.GetModel(); CommandsController cc = new CommandsController(model); ComunicationClient client = ComunicationClient.GetClient(8000); client.CommandReceived += delegate(object senderObj, CommandReceivedEventArgs args) { JsonCommand jCommand = args.JsonCommand; cc.ExecuteCommand(jCommand.CommandID, jCommand.Args, jCommand.JsonData); }; try { client.ConnectToServer(); client.sendCommand((int)CommandsEnum.GetConfigCommand, null); client.sendCommand((int)CommandsEnum.LogsCommand, null); } catch { Console.WriteLine("failed to connect to server"); } }
// GET: First/ImageWeb public ActionResult ImageWeb() { ImageWebModel model = new ImageWebModel(); model.NumPhotos = new PhotosModel().NumPhotos; model.Students = students; return(View(model)); }
/// <summary> /// photo controller constructor /// </summary> public PhotoController() { photoModel = new PhotoModel(); logModel = new LogModel(); configModel = new ConfigModel(); imageWebModel = new ImageWebModel(); NumOfPicture = photoModel.getNumber(); }
public CommandsController(ImageWebModel model) { this.commands = new Dictionary <int, ICommand>(); this.commands.Add((int)CommandsEnum.GetConfigCommand, new GetAppConfigCommand(model)); this.commands.Add((int)CommandsEnum.LogsCommand, new GetLogsCommand(model)); this.commands.Add((int)CommandsEnum.LogCommand, new LogCommand(model)); this.commands.Add((int)CommandsEnum.RemoveDirCommand, new RemoveDirCommand(model)); }
/// <summary> /// Returns the view of the image web /// </summary> /// <returns> view of the image web</returns> // GET: First public ActionResult ImageWeb() { List <ImageWebModel.Student> studentsList = ImageWebModel.LoadText(); ImageWebModel iWM = ImageWebModel.Instance; ViewBag.status = iWM.GetServiceStatus(); int numOfPics = iWM.GetNumOfPics(); if (numOfPics == -1) { ViewBag.numOfPhotos = "Error occurred, Couldn't get the output directory from the service"; } else { ViewBag.numOfPhotos = iWM.GetNumOfPics(); } return(View(studentsList)); }
public GetLogsCommand(ImageWebModel model) { this.model = model; }
public RemoveDirCommand(ImageWebModel model) { this.model = model; }
// GET: Home public ActionResult Index() { imageWebModel = new ImageWebModel(WebClient.GetInstance(), outputDir); return(View(imageWebModel)); }
public ImageWebViewController() { model = ImageWebModel.GetModel(); }
public GetAppConfigCommand(ImageWebModel model) { this.model = model; }
public LogCommand(ImageWebModel model) { this.model = model; }
public PhotosViewController() { model = ImageWebModel.GetModel(); }
public DeletePhotoViewController() { model = ImageWebModel.GetModel(); }