Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Frischling
Beruf: Informationstechnischer Assistent Fachrichtung AE, 2. Jahr
C#-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
<UserControl x:Class="Webinterface.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="210" d:DesignWidth="220" Loaded="UserControl_Loaded"> <Grid x:Name="grd_main" Background="White"> <Grid.RowDefinitions> <RowDefinition Height="4*" /> <RowDefinition Height="2*" /> <RowDefinition Height="14*" /> </Grid.RowDefinitions> <Grid Name="grd_nav" Grid.Row="0"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="2*" /> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Button Name="btn_la" Grid.Column="0" Grid.Row="0" Content="<" Margin="12, 6, 12, 6" Click="btn_la_Click"/> <Button Name="btn_ra" Grid.Column="2" Grid.Row="0" Content=">" Margin="12, 6, 12, 6" Click="btn_ra_Click" /> </Grid> <Grid Grid.Row="1" Name="grd_week"> <Grid.RowDefinitions> <RowDefinition /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <TextBlock Grid.Row="0" Grid.Column="0" Text="Mo" HorizontalAlignment="Center" VerticalAlignment="Center" /> <TextBlock Grid.Row="0" Grid.Column="1" Text="Di" HorizontalAlignment="Center" VerticalAlignment="Center" /> <TextBlock Grid.Row="0" Grid.Column="2" Text="Mi" HorizontalAlignment="Center" VerticalAlignment="Center" /> <TextBlock Grid.Row="0" Grid.Column="3" Text="Do" HorizontalAlignment="Center" VerticalAlignment="Center" /> <TextBlock Grid.Row="0" Grid.Column="4" Text="Fr" HorizontalAlignment="Center" VerticalAlignment="Center" /> <TextBlock Grid.Row="0" Grid.Column="5" Text="Sa" HorizontalAlignment="Center" VerticalAlignment="Center" /> <TextBlock Grid.Row="0" Grid.Column="6" Text="So" HorizontalAlignment="Center" VerticalAlignment="Center" /> </Grid> <Grid Grid.Row="2" Name="grd_btns"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> </Grid> </Grid> </UserControl> |
C#-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.Globalization; //Service-Namespace using Webinterface.DBService; namespace Webinterface { public partial class MainPage : UserControl { private DateTime dat; private DateTime tempdat; private TextBlock mon; private Button btn; private DBClient db; public MainPage() { InitializeComponent(); } private void UserControl_Loaded(object sender, RoutedEventArgs e) { dat = new DateTime(); dat = DateTime.Today; db = new DBClient(); Refresh(); } private void btn_la_Click(object sender, RoutedEventArgs e) { if ((int)dat.Month > 1) dat = new DateTime(dat.Year, (int)dat.Month - 1, dat.Day); else dat = new DateTime((int)dat.Year - 1, (int)dat.Month + 11, dat.Day); Refresh(); } private void btn_ra_Click(object sender, RoutedEventArgs e) { if ((int)dat.Month < 12) dat = new DateTime(dat.Year, (int)dat.Month + 1, dat.Day); else dat = new DateTime((int)dat.Year + 1, (int)dat.Month - 11, dat.Day); Refresh(); } private void Refresh() { //Monatsanzeige grd_nav.Children.Remove(mon); mon = new TextBlock(); mon.Text = MonthToString(dat) + " " + dat.Year.ToString(); grd_nav.Children.Add(mon); Grid.SetColumn(mon, 1); mon.HorizontalAlignment = HorizontalAlignment.Center; mon.VerticalAlignment = VerticalAlignment.Center; //Buttons tempdat = new DateTime(dat.Year, dat.Month, 1); int max = DateTime.DaysInMonth(dat.Year, dat.Month); grd_btns.Children.Clear(); int k = (int)tempdat.DayOfWeek; if (k == 0) k = 7; k -= 1; int cou = 0; for (int i = 0; i < 6 && cou < max; ++i) { for (int j = 0; (j + k) < 7 && cou < max; ++j) { btn = new Button(); btn.Content = cou + 1; grd_btns.Children.Add(btn); Grid.SetRow(btn, i); Grid.SetColumn(btn, j + k); cou++; } k = 0; } db.Lese_Buchungen_MonatAsync(dat); db.Lese_Buchungen_MonatCompleted += new EventHandler<Lese_Buchungen_MonatCompletedEventArgs>(db_Lese_Buchungen_MonatCompleted); } private static string MonthToString(DateTime date) { switch ((int)date.Month) { case 1: return "Januar"; case 2: return "Februar"; case 3: return "März"; case 4: return "April"; case 5: return "Mai"; case 6: return "Juni"; case 7: return "Juli"; case 8: return "August"; case 9: return "September"; case 10: return "Oktober"; case 11: return "November"; case 12: return "Dezember"; default: throw new ArgumentOutOfRangeException("(int)<Instanzname>.Month muss zwischen 1 und 12 liegen."); } } private void db_Lese_Buchungen_MonatCompleted(object sender, Lese_Buchungen_MonatCompletedEventArgs e) { for (int i = 0; i < DateTime.DaysInMonth(dat.Year, dat.Month); i++) { Button tempbtn; Color col = new Color(); DateTime tempdat = new DateTime(dat.Year, dat.Month, i+1); tempbtn = grd_btns.Children[i] as Button; if (tempdat.DayOfWeek.Equals(DayOfWeek.Saturday) || tempdat.DayOfWeek.Equals(DayOfWeek.Sunday)) { col.A = 255; col.R = 255; col.G = 120; col.B = 120; } else if (e.Result[i]) { col.A = 255; col.R = 130; col.G = 200; col.B = 255; } else if(!e.Result[i]) { col.A = 255; col.R = 100; col.G = 255; col.B = 100; } tempbtn.Background = new SolidColorBrush(col); } } } } |
C#-Quelltext |
|
1 2 |
[OperationContract] List<bool> Lese_Buchungen_Monat (DateTime dat); |
Frischling
Beruf: Informationstechnischer Assistent Fachrichtung AE, 2. Jahr
Frischling
Beruf: Informationstechnischer Assistent Fachrichtung AE, 2. Jahr
Frischling
Beruf: Informationstechnischer Assistent Fachrichtung AE, 2. Jahr
C#-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="MetadataBehavior"> <!-- Legen Sie den Wert unten auf "false" fest, um die Veröffentlichung von Metadateninformationen zu vermeiden, und entfernen Sie den Metadatenendpunkt oben vor der Bereitstellung. --> <serviceMetadata httpGetEnabled="true"/> <!-- Damit in Fehlern Ausnahmedetails zum Debuggen angezeigt werden, legen Sie den Wert unten auf "true" fest. Legen Sie ihn vor der Bereitstellung auf "false" fest, um die Veröffentlichung von Ausnahmeinformationen zu vermeiden. --> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> <services> <service behaviorConfiguration="MetadataBehavior" name="DB.DB"> <endpoint binding="basicHttpBinding" bindingConfiguration="" name="httpEndpoint" contract="DB.IDB" /> <host> <baseAddresses> <add baseAddress="http://localhost:9000/DB" /> </baseAddresses> </host> </service> </services> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration> |
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »verrueckt1993« (26.02.2011, 14:59)
Werbeanzeige