PROJET
continuous-integration/drone/push Build is failing Details

master
etudiant 2 years ago
parent 7852d2bd41
commit d6c84d1af1

@ -20,10 +20,11 @@ namespace CalculateurApp
// MainPage = new AppShell();
MainPage = new AppShell();
MainPage = new HomePage();
// MainPage = new HomePage();
}

@ -69,9 +69,6 @@
<Compile Update="View\MaquettePage.xaml.cs">
<DependentUpon>MaquettePage.xaml</DependentUpon>
</Compile>
<Compile Condition=" '$(EnableDefaultCompileItems)' == 'true' " Update="View\mqt.xaml.cs">
<DependentUpon>mqt.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>

@ -13,13 +13,13 @@
Padding="2"
RowSpacing="4"
ColumnSpacing="4">
<Entry Placeholder="Ajout de BLOC DANS LA MAQUETTE"
<Entry Placeholder="AJOUT DE BLOC DANS LA MAQUETTE"
Grid.Row="1" BackgroundColor="AliceBlue"
Text="{Binding Nom}"
x:Name="ajt"
TextColor="Black"
/>
<Button x:Name="Afer" Text="Modifier" Grid.Row="1" Grid.Column="1" HorizontalOptions="End" VerticalOptions="End" WidthRequest="80" Command="{Binding GetAllBlocCommand}" > </Button>
<Button
Command="{Binding AddCommand}"
Text="ajouter"
@ -42,7 +42,7 @@
Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:MaquetteViewModel}}, Path=DeleteCommand}"
CommandParameter="{Binding .}"
/>
<SwipeItem Text="AFFICHER" BackgroundColor="BlueViolet"></SwipeItem>
</SwipeItems>
</SwipeView.RightItems>
<Grid Padding="0">
@ -52,9 +52,31 @@
Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:MaquetteViewModel}}, Path=TapCommand}"
CommandParameter="{Binding .}" />
</Frame.GestureRecognizers>
<Grid Padding="10" ColumnSpacing="40">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label Text="{Binding Nom}"
FontSize="10" TextColor="Black"
FontSize="Header" TextColor="Black"
/>
<Label Text="{Binding MoyenneBloc}"
Grid.Row="1"
Grid.Column="2"
TextColor="Blue"
TextDecorations="Underline"
FontSize="Header"
/>
</Grid>
</Frame>
</Grid>
</SwipeView>

@ -9,7 +9,7 @@ public partial class HomePage : TabbedPage
private void Button_Clicked(object sender, EventArgs e)
{
Navigation.PushAsync(new BlockView());
Navigation.PushAsync(new MatiereView());
}
}

@ -12,10 +12,12 @@
RowSpacing="4"
ColumnSpacing="4">
<Entry Placeholder="Ajout de LA MAQUETTE"
<Entry Placeholder="veuillez saisir le nom de la maquette"
Grid.Row="1" BackgroundColor="AliceBlue"
Text="{Binding NomMaquette }"
TextColor="Black"
PlaceholderColor="Gray"
/>
<Button
Command="{Binding AddCommand}"
@ -28,25 +30,9 @@
>
</Button>
<Button Command="{Binding AddCommand}"
Text="Modifier"
Grid.Row="1"
Grid.Column="2"
HorizontalOptions="End"
VerticalOptions="End"
WidthRequest="85"></Button>
<!--<Button
Command=" {Binding GetAllMaquetteCommand}"
Text="afficher"
Grid.Row="2"
Grid.Column="1"
HorizontalOptions="Center"
VerticalOptions="Center"
WidthRequest="100">
</Button>-->
<CollectionView Grid.Row="3" Grid.ColumnSpan="1" ItemsSource="{Binding Items}" SelectionMode="None" BackgroundColor="White">
<CollectionView Grid.Row="3" Grid.ColumnSpan="1" ItemsSource="{Binding Items}" SelectionMode="None" BackgroundColor="AliceBlue" >
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="{x:Type model:MaquetteModel }">
<SwipeView>
@ -57,12 +43,7 @@
Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:PageAjoutMaquette}}, Path=DeleteCommand}"
CommandParameter="{Binding .}"
/>
<SwipeItem Text="AFFICHER"
BackgroundColor="BlueViolet"
Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:PageAjoutMaquette}},Path=GetAllMaquetteCommand}"
CommandParameter="{Binding .}"
></SwipeItem>
<SwipeItem Text="MODIFIER Bloc" BackgroundColor="Beige"></SwipeItem>
</SwipeItems>
</SwipeView.RightItems>
<Grid Padding="0">
@ -72,9 +53,30 @@
Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:PageAjoutMaquette}}, Path=TapCommand}"
CommandParameter="{Binding .}" />
</Frame.GestureRecognizers>
<Grid Padding="10" ColumnSpacing="40">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label Text="{Binding NomMaquette}"
FontSize="10" TextColor="Black"
FontSize="Header" TextColor="Black"
/>
<Label Text="{Binding moyenneMaquuete}"
Grid.Row="1"
Grid.Column="2"
FontSize="Header" TextColor="Red"
/>
</Grid>
</Frame>
</Grid>
</SwipeView>

@ -7,6 +7,7 @@
xmlns:model="clr-namespace:ClassCalculateurMoyenne;assembly=ClassCalculateurMoyenne"
Title="MatiereView"
Loaded="ContentPage_Loaded">
<Grid RowDefinitions="100 ,Auto,*"
ColumnDefinitions=".225*,.225*"
Padding="10"
@ -16,7 +17,7 @@
>
<Label Text=" Note:" VerticalOptions="Center" HorizontalOptions="Center" WidthRequest="150" ></Label>
<Entry Text="{Binding ma.Note}" Placeholder="note" HorizontalOptions="End"
<Entry Text="{Binding Note}" Placeholder="note" HorizontalOptions="End"
VerticalOptions="Center" WidthRequest="60" ></Entry>
<Label Grid.Column="2" Text="/" HorizontalOptions="Center"
VerticalOptions="Center" WidthRequest="60"></Label>
@ -24,8 +25,8 @@
VerticalOptions="Center"></Label>
<Label Text="coefficent" Grid.Row="1"
VerticalOptions="Center" HorizontalOptions="Center" WidthRequest="150"></Label>
<Entry Grid.Row="1" Text="{Binding ma.Coef}"
VerticalOptions="Center" HorizontalOptions="End" WidthRequest="60" ></Entry>
<Entry Grid.Row="1" Text="{Binding Coef}" IsEnabled="True" Placeholder="COEFFICIENT"
VerticalOptions="Center" HorizontalOptions="End" WidthRequest="60"/>
<Label Text="Nom de la Matiere" Grid.Row="1" Grid.Column="2" HorizontalOptions="Center"></Label>
<Entry Grid.Column="3" Placeholder="nom" Grid.Row="1" Text="{Binding Nommatiere}" HorizontalOptions="End">
@ -79,8 +80,9 @@
<Label Grid.Column="2"
Grid.Row="1"
Text="{Binding Note}"
TextColor="Blue"
FontAttributes="Bold" />
FontAttributes="Bold"
TextColor="Red"/>
<Label Grid.Column="3"
Grid.Row="1"
Text="20"
@ -91,6 +93,7 @@
Text="{Binding Coef}"
TextColor="Blue"
FontAttributes="Bold" />
</Grid>
</Frame>
</Grid>

@ -28,7 +28,6 @@
Placeholder="coef"
WidthRequest="60"
Grid.Row="1"
HorizontalOptions="Center"
VerticalOptions="Center"
BackgroundColor="AliceBlue"
@ -88,8 +87,13 @@
<Label Grid.Column="3"
Grid.Row="1"
Text="{Binding Coefficient}"
TextColor="Blue"
TextColor="Red"
FontAttributes="Bold" />
<Label Text="{Binding MoyenneUe}"
Grid.Row="1"
Grid.Column="4"
FontSize="10" TextColor="Blue"
/>
</Grid>
</Frame>

@ -43,6 +43,10 @@ public partial class BlocViewModel:ObservableObject,IQueryAttributable
ue = new UE();
}
[ObservableProperty]
double moyenneUE;
[ObservableProperty]
ObservableCollection<UE> items;
[ObservableProperty]
@ -73,14 +77,6 @@ public partial class BlocViewModel:ObservableObject,IQueryAttributable
[RelayCommand]
async Task Tapp(UE ue)
{
// await Shell.Current.GoToAsync($"{nameof(UE)}?Nom={s}");
//manager.SelecteBlocModel =blocModel;
//var parametre = new Dictionary<string, Object>
//{
// {"ue",blocModel}
//};
//await Shell.Current.GoToAsync($"{nameof(UeView)}",parametre);
manager.SelectedUe = ue;
var parametre = new Dictionary<string, Object>

@ -76,7 +76,6 @@ namespace CalculateurApp.ViewModel
var o = await manager.GetAllBloc();
}
}
[RelayCommand]

@ -33,8 +33,10 @@ namespace CalculateurApp.ViewModel
try
{
GEtAllMatiere();
ma = new Matiere();
}
catch (Exception ex)
{
@ -49,23 +51,21 @@ namespace CalculateurApp.ViewModel
set => SetProperty(ma.Nommatiere, value, ma, (u, v) => u.Nommatiere=v);
}
[ObservableProperty]
ObservableCollection<Matiere> items;
[ObservableProperty]
int coefficient;
private string coef;
[ObservableProperty]
int note;
private string note;
[RelayCommand]
async void Add()
{
Matiere m = new Matiere(ma.Note, ma.Nommatiere, ma.Coef);
Matiere m = new Matiere( int.Parse( Note), Nommatiere, int.Parse(Coef));
Items.Add(m);
await manager.AddMatiereUe(manager.SelectedUe, m);
}
[RelayCommand]
async void Delete(Matiere bl)
@ -92,20 +92,12 @@ namespace CalculateurApp.ViewModel
}
public void ApplyQueryAttributes(IDictionary<string, object> query)
{
var Ue = query["matiere"] as UE;
var MATList = Ue.Matieres;
ma.IDUEForeignKey = Ue.Id;
//var bloc = query["ue"] as BlocModel;
//var ueList = bloc.ue;
//ue.IDForeignKey = bloc.Id;
}
}
}

@ -12,6 +12,7 @@ namespace CalculateurEF.Entities
#region Propriétés
public int Id { get; set; }
public string Nom { get; set; }
public ICollection<UEentity> UeEntityId { get; set; } = new List<UEentity>();
public int IDMaquetteFrk

@ -12,6 +12,7 @@ namespace CalculateurEF.Entities
{
public long Id { get; set; }
public int Coefficient { get; set; }
public string intitulé { get; set; }
public ICollection<MatiereEntity> mat { get; set; }=
new List<MatiereEntity> ();

@ -10,8 +10,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace CalculateurEF.Migrations
{
[DbContext(typeof(CalculContext))]
[Migration("20221211125750_Migrations")]
partial class Migrations
[Migration("20221225120546_Migrationcalcule")]
partial class Migrationcalcule
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -28,6 +28,10 @@ namespace CalculateurEF.Migrations
b.Property<int>("IDMaquetteFrk")
.HasColumnType("INTEGER");
b.Property<string>("MoyenneBloc")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Nom")
.IsRequired()
.HasColumnType("TEXT");
@ -56,7 +60,7 @@ namespace CalculateurEF.Migrations
modelBuilder.Entity("CalculateurEF.Entities.MatiereEntity", b =>
{
b.Property<long>("id")
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
@ -73,7 +77,7 @@ namespace CalculateurEF.Migrations
b.Property<int>("Note")
.HasColumnType("INTEGER");
b.HasKey("id");
b.HasKey("Id");
b.HasIndex("IDUEForeignKey");
@ -96,6 +100,9 @@ namespace CalculateurEF.Migrations
.IsRequired()
.HasColumnType("TEXT");
b.Property<double>("moyenneUe")
.HasColumnType("REAL");
b.HasKey("Id");
b.HasIndex("IDForeignKey");

@ -5,7 +5,7 @@
namespace CalculateurEF.Migrations
{
/// <inheritdoc />
public partial class Migrations : Migration
public partial class Migrationcalcule : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
@ -30,6 +30,7 @@ namespace CalculateurEF.Migrations
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Nom = table.Column<string>(type: "TEXT", nullable: false),
MoyenneBloc = table.Column<string>(type: "TEXT", nullable: false),
IDMaquetteFrk = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
@ -50,6 +51,7 @@ namespace CalculateurEF.Migrations
Id = table.Column<long>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Coefficient = table.Column<int>(type: "INTEGER", nullable: false),
moyenneUe = table.Column<double>(type: "REAL", nullable: false),
intitulé = table.Column<string>(type: "TEXT", nullable: false),
IDForeignKey = table.Column<int>(type: "INTEGER", nullable: false)
},
@ -68,7 +70,7 @@ namespace CalculateurEF.Migrations
name: "matier",
columns: table => new
{
id = table.Column<long>(type: "INTEGER", nullable: false)
Id = table.Column<long>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Nommatiere = table.Column<string>(type: "TEXT", nullable: false),
Note = table.Column<int>(type: "INTEGER", nullable: false),
@ -77,7 +79,7 @@ namespace CalculateurEF.Migrations
},
constraints: table =>
{
table.PrimaryKey("PK_matier", x => x.id);
table.PrimaryKey("PK_matier", x => x.Id);
table.ForeignKey(
name: "FK_matier_Ue_IDUEForeignKey",
column: x => x.IDUEForeignKey,

@ -25,6 +25,10 @@ namespace CalculateurEF.Migrations
b.Property<int>("IDMaquetteFrk")
.HasColumnType("INTEGER");
b.Property<string>("MoyenneBloc")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Nom")
.IsRequired()
.HasColumnType("TEXT");
@ -53,7 +57,7 @@ namespace CalculateurEF.Migrations
modelBuilder.Entity("CalculateurEF.Entities.MatiereEntity", b =>
{
b.Property<long>("id")
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
@ -70,7 +74,7 @@ namespace CalculateurEF.Migrations
b.Property<int>("Note")
.HasColumnType("INTEGER");
b.HasKey("id");
b.HasKey("Id");
b.HasIndex("IDUEForeignKey");
@ -93,6 +97,9 @@ namespace CalculateurEF.Migrations
.IsRequired()
.HasColumnType("TEXT");
b.Property<double>("moyenneUe")
.HasColumnType("REAL");
b.HasKey("Id");
b.HasIndex("IDForeignKey");

@ -8,6 +8,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
@ -63,9 +64,10 @@ namespace CalculateurMapping
List<BlocModel> blocModels = new List<BlocModel>();
using (var context = new TContext())
{
var maq = await context.Maquettes.Include(m => m.Bloc)
var maq = await context.Maquettes.Include(m => m.Bloc).ThenInclude(
x => x.UeEntityId).ThenInclude(y => y.mat)
.SingleOrDefaultAsync(x => x.Id == maquetteModel.Id);
if (maq == null) return new List<BlocModel>();
foreach (var e in maq.Bloc)
@ -75,6 +77,9 @@ namespace CalculateurMapping
Id = e.Id,
Nom = e.Nom,
IDMaquetteFrk = e.IDMaquetteFrk,
MoyenneBloc = moyenneBloc(e.UeEntityId.Select(
u => new UE(u.Id, u.Coefficient, u.intitulé, 0, u.mat.Select(m => new Matiere(m.Note, m.Nommatiere, m.Coef)).ToArray())
).ToList())
});
}
return blocModels.AsEnumerable<BlocModel>();
@ -83,6 +88,27 @@ namespace CalculateurMapping
}
public static double moyenneBloc(List<UE> ues)
{
double moyennebolcs = 0;
int Coefs = 0;
double moyennecoefficier=0;
if (ues.Count > 0)
{
for(int u = 0; u < ues.Count; u++)
{
ues[u].MoyenneUe = UeDbDataManager<CalculContext>.moyennneUE(ues[u].Matieres.ToList());
Coefs += ues[u].Coefficient;
moyennecoefficier += ues[u].MoyenneUe * ues[u].Coefficient;
}
moyennebolcs = moyennecoefficier / Coefs;
}
return moyennebolcs;
}
public async Task<List<BlocModel>> GetAll()
{ //getAll
using (var context = new TContext())
@ -95,26 +121,7 @@ namespace CalculateurMapping
)).ToListAsync();
return temp;
}
}//getUEdansblc
//public async Task<List<UE>> GetAllUEBloc(int id)
//{
// List<UE> ls=new List<UE>();
// using (var context = new TContext())
// {
// var temp = context.Bloc.Where(x=>x.Id==id).Select(e => e.UeEntityId).ToList();
// foreach (var item in temp)
// {
// foreach (var i in item)
// {
// UE ue = new UE(i.Id, i.Coefficient, i.intitulé, i.mat.Select(m => new Matiere(m.id, m.Note, m.Nommatiere, m.Coef)).ToArray());
// ls.Add(ue);
// }
// }
// return ls;
// }
//}
}
public async Task<BlocModel> GetDataWithName(string name)
{
@ -145,22 +152,7 @@ namespace CalculateurMapping
return result;
}
//public async Task<bool> AddUEBloc(UE data,int blocId)
//{//addUedansbloc
// bool resultat = false;
// using (var context = new TContext())
// {
// UEentity entity = new UEentity
// {
// intitulé = data.Intitulé,
// IDForeignKey = blocId,
// };
// context.Ue.Add(entity);
// await context.SaveChangesAsync();
// resultat = true;
// return resultat;
// }
//}
public async Task<bool> AddUeBloc(BlocModel bloc, UE uE)
{
bool result = false;

@ -69,15 +69,8 @@ namespace CalculateurMapping
}
}
//delete maquette
public async Task<bool> Delete(MaquetteModel maquette)
{
@ -143,15 +136,99 @@ namespace CalculateurMapping
using (var context = new TContext())
{
List<MaquetteModel> maquettes = new List<MaquetteModel>();
foreach (var item in context.Maquettes.Include(m => m.Bloc))
{
// Console.WriteLine(item);
maquettes.Add(new MaquetteModel(item.Id, item.NomMaquette,new List<UE>(),item.Bloc.Select(b=>new BlocModel(b.Nom)).ToList()));
foreach (var item in context.Maquettes.
Include(m => m.Bloc).
ThenInclude(x=>x.UeEntityId).
ThenInclude(y => y.mat).ToList())
{
maquettes.Add(new MaquetteModel
(
item.Id,
item.NomMaquette,
MoyenneMaquette(
item.Bloc.Select
(
m => new BlocModel
(
m.Nom,
m.Id,
m.UeEntityId.Select
(
u =>
new UE
(
u.Id,
u.Coefficient,
u.intitulé,
0,
u.mat.Select
(m => new Matiere
(
m.Note,
m.Nommatiere,
m.Coef
)
)
.ToArray()
)
).ToArray()
)
).ToList()
)
));
}
return maquettes;
}
}
public double MoyenneMaquette(List<BlocModel> blocModels)
{
double Moyennetotal = 0;
double MoyenneMaquette = 0;
int nbrbloc = 0;
if (blocModels.Count > 0)
{
for(int i = 0; i < blocModels.Count; i++)
{
blocModels[i].MoyenneBloc = BlocDbDataManager<CalculContext>.moyenneBloc(blocModels[i].UEs.ToList());
MoyenneMaquette += blocModels[i].MoyenneBloc;
}
Moyennetotal = MoyenneMaquette / blocModels.Count;
}return Moyennetotal;
}
}
}

@ -95,8 +95,11 @@ namespace CalculateurMapping
e.Id,
e.Coefficient,
e.intitulé,
e.mat.Select(j => new Matiere(j.Nommatiere)).ToArray()
moyennneUE(e.mat.Select(m => new Matiere(m.Note, m.Nommatiere, m.Coef)).ToList()),
e.mat.Select(j => new Matiere(j.Note,j.Nommatiere,j.Coef)).ToArray()
)).ToListAsync();
}
}
public Task<UE> GetDataWithName(string name)
@ -125,9 +128,12 @@ namespace CalculateurMapping
List<UE> ls=new List<UE>();
using (var context = new TContext())
{
var BLC = await context.Bloc.Include(m => m.UeEntityId)
var BLC = await context.Bloc.Include(
x => x.UeEntityId).ThenInclude(y => y.mat)
.SingleOrDefaultAsync(x => x.Id == bloc.Id);
if (BLC == null) return new List<UE>();
foreach (var e in BLC.UeEntityId)
{
@ -137,6 +143,8 @@ namespace CalculateurMapping
Intitulé = e.intitulé,
Coefficient=e.Coefficient,
IDForeignKey = e.IDForeignKey,
MoyenneUe= moyennneUE(e.mat.Select(m => new Matiere(m.Note, m.Nommatiere, m.Coef)).ToList()),
// Matieres = e.mat.Select(j => new Matiere(j.Note, j.Nommatiere, j.Coef)).ToArray()
});
}
@ -144,5 +152,25 @@ namespace CalculateurMapping
return ls;
}
public static double moyennneUE(List<Matiere> matieres )
{
//(note *coef)+()+......./sum coef
double moyenne = 0;
int coefs=0;//sum de coef
double notecoefficiees = 0;//somme des notes *coefs
if (matieres.Count > 0)
{
for(int m=0; m< matieres.Count; m++)
{
coefs += matieres[m].Coef;
notecoefficiees += matieres[m].Note * matieres[m].Coef;
}
moyenne = notecoefficiees / coefs;
}
return moyenne;
}
}
}

@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace StubCalculateur.Stub
{
public class StubMatiere: IDataManager<Matiere>
public class StubMatiere: IMatiereDbManager
{
private List<Matiere> listMatieres = new List<Matiere>();
@ -67,5 +67,10 @@ namespace StubCalculateur.Stub
{
throw new NotImplementedException();
}
public Task<IEnumerable<Matiere>> GetAllMatiereUE(UE ue)
{
throw new NotImplementedException();
}
}
}

@ -13,6 +13,8 @@ namespace ClassCalculateurMoyenne
{
[ObservableProperty]
private string nom;
public double MoyenneBloc { get; set; }
public int IDMaquetteFrk { get; set; }
public string GetNom()
{
@ -55,6 +57,16 @@ namespace ClassCalculateurMoyenne
ue = new ReadOnlyCollection<UE>(ues);
}
//public BlocModel(string nombloc, int id, List<UE> Ux,)
//{
// Id = id;
// nom = nombloc;
// ues.AddRange(Ux);
// ue = new ReadOnlyCollection<UE>(ues);
//}
public BlocModel( List<UE> Ux)
{
@ -67,6 +79,7 @@ namespace ClassCalculateurMoyenne
nom = nombloc;
}
public BlocModel(string nombloc, int id, UE[] uEs)
{
nom = nombloc;

@ -17,6 +17,7 @@ namespace ClassCalculateurMoyenne
}
private string nomMaquette;
public double moyenneMaquuete { get; set; }
public string NomMaquette
{
@ -55,14 +56,22 @@ namespace ClassCalculateurMoyenne
public MaquetteModel(int id, string nomMaquette, List<UE> u, List<BlocModel> blc)
public MaquetteModel(int id, string nomMaquette, double moyennemkt, List<BlocModel> blc)
{
Id = id;
NomMaquette = nomMaquette;
UES = u.AsReadOnly();
moyenneMaquuete = moyennemkt;
BLOCS = new ReadOnlyCollection<BlocModel>(blocs);
blocs.AddRange(blc);
}
public MaquetteModel(int id, string nomMaquette, double moyennemkt)
{
Id = id;
NomMaquette = nomMaquette;
moyenneMaquuete = moyennemkt;
}
public MaquetteModel(List<UE> u, List<BlocModel> blocs)
{

@ -11,6 +11,12 @@ namespace ClassCalculateurMoyenne
private int coefficient;
[ObservableProperty]
private string intitulé;
[ObservableProperty]
private double moyenneUe;
public void setMoyenne(double value)
{
moyenneUe = value;
}
public int IDForeignKey { get; set; }
@ -29,11 +35,12 @@ namespace ClassCalculateurMoyenne
intitulé = value;
}
public UE ( long id, int coefficient, string intitulé,params Matiere[] matieres)
public UE ( long id, int coefficient, string intitulé,double moyennege,params Matiere[] matieres)
{
Id = id;
Coefficient = coefficient;
Intitulé = intitulé;
moyenneUe = moyennege;
Matieres = new ReadOnlyCollection<Matiere>(matieres);
}
@ -50,6 +57,11 @@ namespace ClassCalculateurMoyenne
setIntitulé( intitulé);
}
public UE() { }
public UE(int coefficient, string intitulé,double moyennege) {
Coefficient = coefficient;
Intitulé = intitulé;
moyenneUe = moyennege; }
public UE(string intitulé, int coefficient)

Loading…
Cancel
Save