Exemplo n.º 1
0
        private void SubmitButtonClicked(object sender, RoutedEventArgs e)
        {
            sp = new Shared.ScientificProduction(TypeBox.Text, TitleBox.Text, ContentBox.Text);

            var mainWindow = (Application.Current.MainWindow as MainWindow);

            try
            {
                string result = mainWindow.PublishingObject.PublishScientificProductionAndNotify(this.sp, mainWindow.User.Profile);
                if (result == "done")
                {
                    Productions productions = (((mainWindow.MainFrame as Frame).Content as Pages.Dash).ProfileFrame.Content as Pages.Profile).productions;
                    productions.CreateAndPlaceProductionCard(this.sp);

                    Frame productionsFrame = (((mainWindow.MainFrame as Frame).Content as Pages.Dash).ProfileFrame.Content as Pages.Profile).ProductionsFrame;
                    ReturnBackIfAvailable(productionsFrame);
                }
                else
                {
                    MessageBox.Show(result);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Exemplo n.º 2
0
        public ProductionCard(Shared.ScientificProduction sp)
        {
            InitializeComponent();

            Type.Content  = sp.Type;
            Title.Content = sp.Title;
        }
Exemplo n.º 3
0
        public void CreateAndPlaceProductionCard(Shared.ScientificProduction sp)
        {
            ProductionCard productionCard = new Assets.ProductionCard(sp);

            TransformToColumnAndRow();

            this.Grid.Children.Add(productionCard);
            Grid.SetColumn(productionCard, CurrentColumn);
            Grid.SetRow(productionCard, CurrentRow);
        }