private void BtnShowView_Click(object sender, RoutedEventArgs e)
        {
            switch (((ComboBoxItem)cbViews.SelectedItem).Tag)
            {
            case "View1":
                View1 view1 = new View1();
                view1.Show();
                break;

            case "View2":
                View2 view2 = new View2(false);
                view2.Show();
                break;

            case "View3":
                View3 view3 = new View3();
                view3.Show();
                break;

            case "ucDemo":
            case "ucDemo2":
                MessageBox.Show("Los user controls no pueden salir en ventanas");
                break;
            }
        }
Beispiel #2
0
        public void AttributeBasedPresenterDiscoveryStrategy_GetBindings_SingleAttributeOnHostScopedToViewType()
        {
            // Arrange
            var strategy = new AttributeBasedPresenterDiscoveryStrategy();
            var hosts    = new [] { new Host1() };
            var view1    = new View1();
            var views    = new[] { view1 };

            // Act
            var results = strategy.GetBindings(hosts, views).ToArray();

            // Assert
            CollectionAssert.AreEqual(new[]
            {
                new PresenterDiscoveryResult
                (
                    new[] { view1 },
                    @"AttributeBasedPresenterDiscoveryStrategy:
- could not find a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleAttributeOnHostScopedToViewTypeWithSingleView+View1
- found a [PresenterBinding] attribute on host instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleAttributeOnHostScopedToViewTypeWithSingleView+Host1 (presenter type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleAttributeOnHostScopedToViewTypeWithSingleView+Presenter1, view type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleAttributeOnHostScopedToViewTypeWithSingleView+View1, binding mode: Default)",
                    new[]
                {
                    new PresenterBinding(typeof(Presenter1), typeof(View1), BindingMode.Default, new[] { view1 }),
                }
                )
            },
                                      results
                                      );
        }
Beispiel #3
0
        public void AttributeBasedPresenterDiscoveryStrategy_GetBindings_MultipleViewInstancesWithSharedPresenterOnHost()
        {
            // Arrange
            var strategy      = new AttributeBasedPresenterDiscoveryStrategy();
            var hosts         = new[] { new Host1() };
            var viewInstance1 = new View1();
            var viewInstance2 = new View1();
            var viewInstances = new[] { viewInstance1, viewInstance2 };

            // Act
            var results = strategy.GetBindings(hosts, viewInstances).ToArray();

            // Assert
            CollectionAssert.AreEqual(new[]
            {
                new PresenterDiscoveryResult
                (
                    new[] { viewInstance1, viewInstance2 },
                    @"AttributeBasedPresenterDiscoveryStrategy:
- could not find a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewInstancesWithSharedPresenterOnHost+View1
- found a [PresenterBinding] attribute on host instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewInstancesWithSharedPresenterOnHost+Host1 (presenter type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewInstancesWithSharedPresenterOnHost+Presenter1, view type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewInstancesWithSharedPresenterOnHost+IViewInterface1, binding mode: SharedPresenter)
- including 1 more view instances in the binding because the binding mode is SharedPresenter and they are compatible with the view type WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewInstancesWithSharedPresenterOnHost+IViewInterface1",
                    new[]
                {
                    new PresenterBinding(typeof(Presenter1), typeof(IViewInterface1), BindingMode.SharedPresenter, new[] { viewInstance1, viewInstance2 }),
                }
                )
            },
                                      results
                                      );
        }
Beispiel #4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string        connectionString = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString;
            SqlConnection connection       = new SqlConnection(connectionString);
            SqlCommand    komut            = new SqlCommand();

            connection.Open();
            komut.Connection  = connection;
            komut.CommandText = "select * from properties_estate";
            komut.ExecuteNonQuery();
            SqlDataReader dr = komut.ExecuteReader();

            SqlCommand     cmdSearch = new SqlCommand("Select * from properties_estate where city_area='" + TextBox1.Text + "' or rentORsell ='" + TextBox1.Text + "' or city_area ='" + DropDownList2.SelectedItem.Text + "' or rentORsell = '" + DropDownList1.SelectedItem.Text + "' ", connection);
            SqlDataAdapter da        = new SqlDataAdapter(cmdSearch);
            DataTable      dt        = new DataTable();

            da.Fill(dt);
            if (dt.Rows.Count == 0)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "RunCode", "javascript:alert('Sorry No Records Found with this Keyword.....');document.location.href='default.aspx';", true);
            }
            else
            {
                View1.DataSource = dt;
                View1.DataBind();
            }
        }
        public void AttributeBasedPresenterDiscoveryStrategy_GetBindings_MultipleViewInstancesWithSharedPresenterOnHost()
        {
            // Arrange
            var strategy = new AttributeBasedPresenterDiscoveryStrategy();
            var hosts = new[] { new Host1() };
            var viewInstance1 = new View1();
            var viewInstance2 = new View1();
            var viewInstances = new[] { viewInstance1, viewInstance2 };

            // Act
            var results = strategy.GetBindings(hosts, viewInstances).ToArray();

            // Assert
            CollectionAssert.AreEqual(new[]
                {
                    new PresenterDiscoveryResult
                    (
                        new[] {viewInstance1, viewInstance2},
                        @"AttributeBasedPresenterDiscoveryStrategy:
            - could not find a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewInstancesWithSharedPresenterOnHost+View1
            - found a [PresenterBinding] attribute on host instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewInstancesWithSharedPresenterOnHost+Host1 (presenter type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewInstancesWithSharedPresenterOnHost+Presenter1, view type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewInstancesWithSharedPresenterOnHost+IViewInterface1, binding mode: SharedPresenter)
            - including 1 more view instances in the binding because the binding mode is SharedPresenter and they are compatible with the view type WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewInstancesWithSharedPresenterOnHost+IViewInterface1",
                        new[]
                        {
                            new PresenterBinding(typeof(Presenter1), typeof(IViewInterface1), BindingMode.SharedPresenter, new[] {viewInstance1, viewInstance2}),
                        }
                    )
                },
                results
            );
        }
Beispiel #6
0
        public void AttributeBasedPresenterDiscoveryStrategy_GetBindings_SingleViewWithMultipleAttributes()
        {
            // Arrange
            var strategy = new AttributeBasedPresenterDiscoveryStrategy();
            var hosts    = new object[0];
            var view1    = new View1();
            var views    = new [] { view1 };

            // Act
            var results = strategy.GetBindings(hosts, views).ToArray();

            // Assert
            CollectionAssert.AreEqual(new[]
            {
                new PresenterDiscoveryResult
                (
                    new[] { view1 },
                    @"AttributeBasedPresenterDiscoveryStrategy:
- found a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleViewWithMultipleAttributes+View1 (presenter type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleViewWithMultipleAttributes+Presenter1, view type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleViewWithMultipleAttributes+View1, binding mode: Default)
- found a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleViewWithMultipleAttributes+View1 (presenter type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleViewWithMultipleAttributes+Presenter2, view type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleViewWithMultipleAttributes+View1, binding mode: Default)",
                    new[]
                {
                    new PresenterBinding(typeof(Presenter1), typeof(View1), BindingMode.Default, new[] { view1 }),
                    new PresenterBinding(typeof(Presenter2), typeof(View1), BindingMode.Default, new[] { view1 }),
                }
                )
            },
                                      results
                                      );
        }
        public void AttributeBasedPresenterDiscoveryStrategy_GetBindings_SingleViewWithMultipleAttributes()
        {
            // Arrange
            var strategy = new AttributeBasedPresenterDiscoveryStrategy();
            var hosts = new object[0];
            var view1 = new View1();
            var views = new [] { view1 };

            // Act
            var results = strategy.GetBindings(hosts, views).ToArray();

            // Assert
            CollectionAssert.AreEqual(new[]
                {
                    new PresenterDiscoveryResult
                    (
                        new[] {view1},
                        @"AttributeBasedPresenterDiscoveryStrategy:
            - found a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleViewWithMultipleAttributes+View1 (presenter type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleViewWithMultipleAttributes+Presenter1, view type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleViewWithMultipleAttributes+View1, binding mode: Default)
            - found a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleViewWithMultipleAttributes+View1 (presenter type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleViewWithMultipleAttributes+Presenter2, view type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleViewWithMultipleAttributes+View1, binding mode: Default)",
                        new[]
                        {
                            new PresenterBinding(typeof(Presenter1), typeof(View1), BindingMode.Default, new[] {view1}),
                            new PresenterBinding(typeof(Presenter2), typeof(View1), BindingMode.Default, new[] {view1}),
                        }
                    )
                },
                results
            );
        }
        public void AttributeBasedPresenterDiscoveryStrategy_GetBindings_SingleViewWithNoAttribute()
        {
            // Arrange
            var strategy = new AttributeBasedPresenterDiscoveryStrategy();
            var hosts = new object[0];
            var view1 = new View1();
            var views = new [] { view1 };

            // Act
            var results = strategy.GetBindings(hosts, views).ToArray();

            // Assert
            CollectionAssert.AreEqual(new[]
                {
                    new PresenterDiscoveryResult
                    (
                        new[] {view1},
                        @"AttributeBasedPresenterDiscoveryStrategy:
            - could not find a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleViewWithNoAttribute+View1",
                        new PresenterBinding[0]
                    )
                },
                results
            );
        }
        public void AttributeBasedPresenterDiscoveryStrategy_GetBindings_SingleViewWithNoAttribute()
        {
            // Arrange
            var strategy = new AttributeBasedPresenterDiscoveryStrategy();
            var hosts    = new object[0];
            var view1    = new View1();
            var views    = new [] { view1 };

            // Act
            var results = strategy.GetBindings(hosts, views).ToArray();

            // Assert
            CollectionAssert.AreEqual(new[]
            {
                new PresenterDiscoveryResult
                (
                    new[] { view1 },
                    @"AttributeBasedPresenterDiscoveryStrategy:
- could not find a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleViewWithNoAttribute+View1",
                    new PresenterBinding[0]
                )
            },
                                      results
                                      );
        }
        public void AttributeBasedPresenterDiscoveryStrategy_GetBindings_SingleAttributeOnHostScopedToViewInterface()
        {
            // Arrange
            var strategy = new AttributeBasedPresenterDiscoveryStrategy();
            var hosts = new [] { new Host1() };
            var view1 = new View1();
            var views = new[] { view1 };

            // Act
            var results = strategy.GetBindings(hosts, views).ToArray();

            // Assert
            CollectionAssert.AreEqual(new[]
                {
                    new PresenterDiscoveryResult
                    (
                        new[] {view1},
                        @"AttributeBasedPresenterDiscoveryStrategy:
            - could not find a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleAttributeOnHostScopedToViewInterfaceWithSingleView+View1
            - found a [PresenterBinding] attribute on host instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleAttributeOnHostScopedToViewInterfaceWithSingleView+Host1 (presenter type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleAttributeOnHostScopedToViewInterfaceWithSingleView+Presenter1, view type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_SingleAttributeOnHostScopedToViewInterfaceWithSingleView+IViewInterface1, binding mode: Default)",
                        new[]
                        {
                            new PresenterBinding(typeof(Presenter1), typeof(IViewInterface1), BindingMode.Default, new[] {view1}),
                        }
                    )
                },
                results
            );
        }
Beispiel #11
0
    public View GetView()
    {
        View1 view = new View1();

        view.Property3 = Property3.ToString();
        Setup(view);
        return(view);
    }
 private void YesBtn_Click(object sender, EventArgs e)
 {
     GameOverBox.Visible = false;
     View1.model.grade   = 0;
     View1.input         = USERINPUT.RESTART;
     View1.timer.Start();
     View1.Invalidate();
 }
Beispiel #13
0
        static void Main(string[] args)
        {
            Model      model      = new Model(args);
            View1      view       = new View1();
            Controller controller = new Controller(model, view);

            controller.KorisnikovUnos();
            Console.ReadLine();
        }
Beispiel #14
0
        private void menuExportImage_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog _saveFileDialog = new SaveFileDialog();

            if (_saveFileDialog.ShowDialog() == true)
            {
                View1.Export(_saveFileDialog.FileName);
            }
        }
        public void Create_ShouldReturnInstanceWhenViewInstanceIsASuperTypeOfThePresenterSignature()
        {
            var factory      = BuildFactory();
            var viewInstance = new View1();

            var presenter = factory.Create(typeof(BasicPresenter), typeof(View1), viewInstance);

            Assert.IsInstanceOfType(presenter, typeof(BasicPresenter));
        }
        public void Create_ShouldReturnInstance()
        {
            var factory      = BuildFactory();
            var viewInstance = new View1();

            var presenter = factory.Create(typeof(BasicPresenter), typeof(IView), viewInstance);

            Assert.IsInstanceOfType(presenter, typeof(BasicPresenter));
        }
Beispiel #17
0
        private void btnRaise_Click(object sender, System.EventArgs e)
        {
            var parts = (BindingList <Part>)bsTestXML.DataSource;

            foreach (var part in parts)
            {
                part.percentAdd += 10;
            }
            View1.RefreshData();
        }
        public void Create_ShouldReturnDistinctInstanceForEachCall()
        {
            var factory      = BuildFactory();
            var viewInstance = new View1();

            var presenter1 = factory.Create(typeof(BasicPresenter), typeof(IView), viewInstance);
            var presenter2 = factory.Create(typeof(BasicPresenter), typeof(IView), viewInstance);

            Assert.IsFalse(ReferenceEquals(presenter1, presenter2));
        }
Beispiel #19
0
        static void Main(string[] args)
        {
            Model m  = new Model();
            View1 v1 = new View1(m);
            View2 v2 = new View2(m);

            for (int i = 0; i < 10; ++i)
            {
                m.setValue(i);
            }

            System.Console.Read();
        }
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new View1();
     selectionView.SetSelection(new object[] {
         ((View1)DataContext).Items.GetItemAt(3),
         ((View1)DataContext).Items.GetItemAt(5),
         ((View1)DataContext).Items.GetItemAt(23),
         ((View1)DataContext).Items.GetItemAt(24),
         ((View1)DataContext).Items.GetItemAt(56)
     });
     this.DG.SelectionView = selectionView;
 }
Beispiel #21
0
        public void Initialize()
        {
            IRegion leftRegion = _regionManager.Regions[RegionNames.LeftRegion];
            var view1 = new View1();
            leftRegion.Add( view1 );

            IRegion documentRegion = _regionManager.Regions[RegionNames.DocumentRegion];
            var view2 = new View2();
            documentRegion.Add(view2);

            IRegion bottomRegion = _regionManager.Regions[RegionNames.BottomRegion];
            var view3 = new View3();
            bottomRegion.Add(view3);
        }
Beispiel #22
0
        private void gridLookUpEdit1_EditValueChanged(object sender, EventArgs e)
        {
            DataRow row = View1.GetFocusedDataRow( );

            if (row == null)
            {
                return;
            }

            //if ( gridLookUpEdit1 . EditValue == null || string . IsNullOrEmpty ( gridLookUpEdit1 . EditValue . ToString ( ) ) )
            //    return;
            //if ( gridLookUpEdit1 . EditValue != null && partTable . Select ( "idx='" + gridLookUpEdit1 . EditValue . ToString ( ) + "'" ) . Length > 0 )
            //    textBox5 . Text = partTable . Select ( "idx='" + gridLookUpEdit1 . EditValue . ToString ( ) + "'" ) [ 0 ] [ "GS10" ] . ToString ( );
            textBox5.Text = row ["GS10"].ToString( );
        }
Beispiel #23
0
        private void cbb_runner_SelectedValueChanged(object sender, EventArgs e)
        {
            View1 ga = new View1();

            RegistrationIDs = cbb_runner.SelectedValue.ToString();
            runes           = cbb_runner.Text.ToString();
            ga = db.View1s.SingleOrDefault(x => x.Runnerss == runes);
            if (ga == null)
            {
            }
            else
            {
                lb_name.Text = ga.CharityName.ToString();
            }
        }
        public void Release_ShouldCallDisposeIfThePresenterImplementsIDisposable()
        {
            var factory      = BuildFactory();
            var viewInstance = new View1();
            var presenter1   = factory.Create(typeof(DisposablePresenter), typeof(IView), viewInstance);

            var disposed = false;

            ((DisposablePresenter)presenter1).DisposeCallback =
                () => disposed = true;

            factory.Release(presenter1);

            Assert.IsTrue(disposed);
        }
Beispiel #25
0
        public void Draw()
        {
            //3D Drawing
            BillboardTextVisual3D txt1;
            LinesVisual3D         linesVisual;
            PointsVisual3D        pointsVisual;
            Point3DCollection     pts = new Point3DCollection();

            View1.Children.Clear();

            foreach (HeadLossCalc i in lstHeadLossCalcs)
            {
                Point3D p1 = new Point3D(i.Node1.X, i.Node1.Y, i.Node1.Z);
                pts.Add(p1);
                Point3D p2 = new Point3D(i.Node2.X, i.Node2.Y, i.Node2.Z);
                pts.Add(p2);
                txt1          = new BillboardTextVisual3D();
                txt1.Text     = i.ElementId.ToString();
                txt1.Position = new Point3D((i.Node1.X + i.Node2.X) / 2, (i.Node1.Y + i.Node2.Y) / 2, (i.Node1.Z + i.Node2.Z) / 2);
                View1.Children.Add(txt1);
            }

            GridLinesVisual3D grid = new GridLinesVisual3D();

            grid.Length        = 50000;
            grid.Width         = 50000;
            grid.MajorDistance = 10000;
            grid.MinorDistance = 1000;
            grid.Visible       = true;
            grid.Thickness     = 10;
            View1.Children.Add(grid);

            pointsVisual = new PointsVisual3D {
                Color = Colors.Red, Size = 4
            };
            pointsVisual.Points = pts;
            View1.Children.Add(pointsVisual);
            linesVisual = new LinesVisual3D {
                Color = Colors.Blue
            };
            linesVisual.Points    = pts;
            linesVisual.Thickness = 2;
            View1.Children.Add(linesVisual);
            View1.ZoomExtents(10);
        }
Beispiel #26
0
        public FrmMain()
        {
            InitializeComponent();
            btnPre.Click    += btnPre_Click;
            btnNext.Click   += btnNext_Click;
            btnCancel.Click += btnCancel_Click;

            view1      = new View1();
            view1.Dock = DockStyle.Fill;
            PanelMain.Controls.Add(view1);

            view2      = new View2();
            view2.Dock = DockStyle.Fill;
            PanelMain.Controls.Add(view2);

            view3            = new View3();
            view3.Assemblies = view1.FileInfos;
            view3.Dock       = DockStyle.Fill;
            PanelMain.Controls.Add(view3);
        }
Beispiel #27
0
        public static void Main()
        {
            bool   configIsValid  = true;
            string filepathConfig = @"C:\Users\FSommer\source\repos\BHS-Corrugated\TesteWorklflow\config.xml";
            Config g = new Config();

            try
            {
                g.ReadConfig(filepathConfig);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                configIsValid = false;
            }

            if (configIsValid)
            {
                DataWpaAdapter myAdapter    = new DataWpaAdapter();
                FileDispatcher myDispatcher = new FileDispatcher(g);

                myDispatcher.Init();
                myDispatcher.DecodeCompleted += myAdapter.UpdateData;


                //Console.WriteLine("test start second threat");bbbbcacbc


                testing.Test app = new testing.Test();

                View1 mainView = new View1();

                mainView.DataContext = myAdapter;
                mainView.Show();

                app.Run(mainView);
            }
        }
 void ReleaseDesignerOutlets()
 {
     if (View1 != null)
     {
         View1.Dispose();
         View1 = null;
     }
     if (View2 != null)
     {
         View2.Dispose();
         View2 = null;
     }
     if (View3 != null)
     {
         View3.Dispose();
         View3 = null;
     }
     if (View4 != null)
     {
         View4.Dispose();
         View4 = null;
     }
 }
Beispiel #29
0
        public void charly(int id, string name)
        {
            View1 V = db.View1s.Single(x => x.RegistrationId == id && x.Runnerss == name);

            charly_name = V.CharityName;
        }
 public void single_charily(string rune)
 {
     View1 sg_charily = db.View1s.Where(x => x.Runnerss == rune).SingleOrDefault();
     //rID = sg_charily.CharityId;
     // name = sg_charily.CharityName.ToString(); ;
 }
Beispiel #31
0
        // Create a simple table with a row of two clickable,
        // readonly headers and a row with a single column, which
        // is the 'container' to which we'll be adding controls.
        protected override void CreateChildControls()
        {
            // Always start with a clean form
            Controls.Clear();

            // Create a table using the control's declarative properties
            Table t = new Table();

            t.CellSpacing = 1;
            t.BorderStyle = BorderStyle;
            t.Width       = this.Width;
            t.Height      = this.Height;

            // Create the header row
            TableRow tr = new TableRow();

            tr.HorizontalAlign = HorizontalAlign.Center;
            tr.BackColor       = Color.LightBlue;

            // Create the first cell in the header row
            TableCell tc = new TableCell();

            tc.Text  = "View 1";
            tc.Width = new Unit("50%");
            tr.Cells.Add(tc);

            // Create the second cell in the header row
            tc       = new TableCell();
            tc.Text  = "View 2";
            tc.Width = new Unit("50%");
            tr.Cells.Add(tc);

            t.Rows.Add(tr);

            // Create the second row for content
            tr = new TableRow();
            tr.HorizontalAlign = HorizontalAlign.Center;

            // This cell represents our content 'container'
            tc            = new TableCell();
            tc.ColumnSpan = 2;

            // Add the current view content to the cell
            // at run-time
            if (!DesignMode)
            {
                Control containerControl = new Control();
                switch (CurrentView)
                {
                case 0:
                    if (View1 != null)
                    {
                        View1.InstantiateIn(containerControl);
                    }
                    break;

                case 1:
                    if (View2 != null)
                    {
                        View2.InstantiateIn(containerControl);
                    }
                    break;
                }

                tc.Controls.Add(containerControl);
            }

            tr.Cells.Add(tc);

            t.Rows.Add(tr);

            // Add the finished table to the Controls collection
            Controls.Add(t);
        }
Beispiel #32
0
 protected override void OnInitialize()
 {
     this.view = this.AttachView <View1>();
     base.OnInitialize();
 }
Beispiel #33
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        for (int i = 1; i <= 23; i++)
        {
            string temp = "RadioButton" + i;

            RadioButton rad = new RadioButton();
            rad = (RadioButton)View1.FindControl(temp);
            if (rad.Checked == true)
            {
                Session["b"] = rad.Text;
            }
        }



        for (int j = 24; j <= 47; j++)
        {
            string temp = "RadioButton" + j;

            RadioButton rad = new RadioButton();
            rad = (RadioButton)View2.FindControl(temp);
            if (rad.Checked == true)
            {
                Session["c"] = rad.Text;
            }
        }


        for (int k = 48; k <= 61; k++)
        {
            string temp = "RadioButton" + k;

            RadioButton rad = new RadioButton();
            rad = (RadioButton)View3.FindControl(temp);
            if (rad.Checked == true)
            {
                Session["d"] = rad.Text;
            }
        }


        for (int k = 62; k <= 77; k++)
        {
            string temp = "RadioButton" + k;

            RadioButton rad = new RadioButton();
            rad = (RadioButton)View4.FindControl(temp);
            if (rad.Checked == true)
            {
                Session["e"] = rad.Text;
            }
        }

        for (int k = 78; k <= 85; k++)
        {
            string temp = "RadioButton" + k;

            RadioButton rad = new RadioButton();
            rad = (RadioButton)View5.FindControl(temp);
            if (rad.Checked == true)
            {
                Session["f"] = rad.Text;
            }
        }


        for (int k = 86; k <= 91; k++)
        {
            string temp = "RadioButton" + k;

            RadioButton rad = new RadioButton();
            rad = (RadioButton)View6.FindControl(temp);
            if (rad.Checked == true)
            {
                Session["g"] = rad.Text;
            }
        }



        Response.Redirect("http://localhost:49347/volcania/CustomizedBooking.aspx");
    }
        public override void UpdateData()
        {
            base.UpdateData();

            BackgroundContainer?.SetBackgroundColor(ColorConstants.BackroundContent);

            View1?.SetBackgroundColor(ColorConstants.SelectorHome);
            View2?.SetBackgroundColor(ColorConstants.SelectorHome);
            View3?.SetBackgroundColor(ColorConstants.SelectorHome);
            View4?.SetBackgroundColor(ColorConstants.SelectorHome);
            View5?.SetBackgroundColor(ColorConstants.SelectorHome);
            View6?.SetBackgroundColor(ColorConstants.SelectorHome);
            View7?.SetBackgroundColor(ColorConstants.SelectorHome);
            View8?.SetBackgroundColor(ColorConstants.SelectorHome);

            ImageQR?.SetImageFromResource(DrawableConstants.QRBlurryIcon);

            if (ImageScan != null)
            {
                ImageScan.Visibility = ViewState.Visible;
                ImageScan?.SetImageFromResource(DrawableConstants.QRWaitIcon);
            }

            if (ConfirmTableText != null)
            {
                ConfirmTableText.Click -= ConfirmTableText_Click;
                ConfirmTableText.Click += ConfirmTableText_Click;

                ConfirmTableText.Text = RCode.ConfirmTable.ToUpperInvariant();
                ConfirmTableText.SetBackgroundColor(ColorConstants.BlackColor);
                ConfirmTableText.SetSelectedColor(ColorConstants.WhiteColor.SelectorTransparence(ColorConstants.Procent50));
                ConfirmTableText.SetTextColor(ColorConstants.WhiteColor);
                ConfirmTableText.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
            }

            if (TitleText != null)
            {
                TitleText.Text = RCode.QrCode;
                TitleText.SetTextColor(ColorConstants.WhiteColor);
                TitleText.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size18);
            }

            if (TableNrText != null)
            {
                TableNrText.Text = RCode.TableNo;
                TableNrText.SetTextColor(ColorConstants.WhiteColor);
                TableNrText.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size18);
            }

            if (TableNrValueText != null)
            {
                TableNrValueText.Visibility = ViewState.Invisible;

                TableNrValueText.Text = string.Empty;
                TableNrValueText.SetTextColor(ColorConstants.SelectorHome);
                TableNrValueText.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size36);
            }

            if (ImageQR.IsNull())
            {
                return;
            }
            ImageQR.Click -= ImageQR_Click;
            ImageQR.Click += ImageQR_Click;
        }
        public void ViewWithProxyController() {
            var view = new View1();
            var controller = new Controller1();

            Assert.IsNull(view.Controller);
            UipUtil.SetController(view, controller, false);
            Assert.IsNotNull(view.Controller);

            Assert.IsFalse(controller.DoneSomething);
            view.DoSomething();
            Assert.IsTrue(controller.DoneSomething);
        }
 private void LandButton_Click(object sender, EventArgs e)
 {
     View1.input = USERINPUT.LAND;
     View1.Invalidate();
 }