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

master
Mamadou Elaphi ARAFA 3 years ago
parent 10d7d165a0
commit 05264cc464

@ -13,7 +13,7 @@ namespace CalculateurApp
MainPage = new NavigationPage(new HomePage()); MainPage = new NavigationPage(new HomePage());
//MainPage = new AppShell(BlocViewModel c); //MainPage = new AppShell(BlocViewModel c);
// MainPage = new Maquette (); // MainPage = new Maquette ();
// MainPage = new MatNote(); // MainPage = new Start();
} }
} }

@ -53,6 +53,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\BSN\Bussness.csproj" />
<ProjectReference Include="..\CalculateurEF\CalculateurEF.csproj" />
<ProjectReference Include="..\ClassCalculateurMoyenne\ClassCalculateurMoyenne.csproj" /> <ProjectReference Include="..\ClassCalculateurMoyenne\ClassCalculateurMoyenne.csproj" />
</ItemGroup> </ItemGroup>

@ -9,8 +9,7 @@
<Grid
<!--<Grid
Padding="10" Padding="10"
RowSpacing="60" RowSpacing="60"
ColumnSpacing="6"> ColumnSpacing="6">
@ -24,9 +23,11 @@
</Grid.ColumnDefinitions > </Grid.ColumnDefinitions >
<Frame Grid.Row="0" BackgroundColor="Black"></Frame> <Frame Grid.Row="0" BackgroundColor="Black"></Frame>
<Frame Grid.Row="1" BackgroundColor="Yellow"></Frame> <Frame Grid.Row="1" BackgroundColor="Yellow"></Frame>
<Button Text=" afficher UE"></Button>
</Grid>--> <BoxView Grid.Row="0" BackgroundColor="Red"></BoxView>
<ScrollView > <BoxView Grid.Row="1" BackgroundColor="AliceBlue"></BoxView>
</Grid>
<!--<ScrollView >
<VerticalStackLayout Spacing="10" > <VerticalStackLayout Spacing="10" >
<Label Text="rouf"></Label> <Label Text="rouf"></Label>
<Frame> <Frame>
@ -36,6 +37,6 @@
</Frame> </Frame>
</VerticalStackLayout> </VerticalStackLayout>
</ScrollView> </ScrollView>-->
</ContentPage> </ContentPage>

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

@ -45,28 +45,13 @@
CommandParameter="{Binding .}" /> CommandParameter="{Binding .}" />
</Frame.GestureRecognizers> </Frame.GestureRecognizers>
<Label Text="{Binding Nom}" <Label Text="{Binding Nom}"
FontSize="10" TextColor="Black" /> FontSize="10" TextColor="Black"
/>
</Frame> </Frame>
</Grid> </Grid>
</SwipeView> </SwipeView>
</DataTemplate> </DataTemplate>
</CollectionView.ItemTemplate> </CollectionView.ItemTemplate>
</CollectionView> </CollectionView >
<CollectionView>
</CollectionView>
<!--//<Label Text="Liste des UE dans la Bloc X " Grid.Row="3" VerticalOptions="Center" HorizontalOptions="Start"></Label>-->
<CollectionView Grid.Row="3" VerticalOptions="Center" HorizontalOptions="Start" ItemsSource="{Binding Items}" SelectionMode="None" >
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="{x:Type model:BlocModel }">
<Label Text="{Binding Nom}" Grid.Row="3" VerticalOptions="Center" HorizontalOptions="Start"
FontSize="10" TextColor="Black" />
</DataTemplate>
</CollectionView.ItemTemplate></CollectionView>
</Grid> </Grid>
</ContentPage> </ContentPage>

@ -4,11 +4,12 @@
xmlns:viewmodel="clr-namespace:CalculateurApp.ViewModel" xmlns:viewmodel="clr-namespace:CalculateurApp.ViewModel"
xmlns:model="clr-namespace:ClassCalculateurMoyenne;assembly=ClassCalculateurMoyenne" xmlns:model="clr-namespace:ClassCalculateurMoyenne;assembly=ClassCalculateurMoyenne"
x:Class="CalculateurApp.View.Start" x:Class="CalculateurApp.View.Start"
x:DataType="viewmodel:BlocViewModel"
Title="StartPage" Title="StartPage"
BarTextColor="LightSalmon" BarTextColor="LightSalmon"
SelectedTabColor="DarkRed" SelectedTabColor="DarkRed"
UnselectedTabColor="DarkKhaki"> UnselectedTabColor="DarkKhaki">
<ContentPage Title=" Blocs " IconImageSource="mamoyenne.png" x:DataType="viewmodel:BlocViewModel"> <ContentPage Title=" Blocs " IconImageSource="mamoyenne.png" >
<Grid RowDefinitions="100 ,Auto,*" <Grid RowDefinitions="100 ,Auto,*"
ColumnDefinitions=".75*,.25*" ColumnDefinitions=".75*,.25*"
Padding="10" Padding="10"
@ -26,22 +27,18 @@
Placeholder="coef" Placeholder="coef"
WidthRequest="60" WidthRequest="60"
Grid.Row="1" Grid.Row="1"
HorizontalOptions="Center" HorizontalOptions="Center"
VerticalOptions="Center" VerticalOptions="Center"
BackgroundColor="AliceBlue" BackgroundColor="AliceBlue"
Text="{Binding ue.Coefficient}"> Text="{Binding ue.Coefficient}">
</Entry> </Entry>
<!--<Label Text="{Binding Nom}"></Label>
<Button Text="go" Command="{Binding GoBackCommand}"></Button>-->
<Button <Button
Command="{Binding AddCommand}" Command="{Binding AddCommand}"
Text="Add" Text="Add"
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1">
>
</Button> </Button>
<Button Text=" Delete" Grid.Row="1" HorizontalOptions="End" VerticalOptions="End" Command="{Binding DeleteCommand }"></Button>
<CollectionView Grid.Row="2" Grid.ColumnSpan="2" ItemsSource="{Binding Items}" > <CollectionView Grid.Row="2" Grid.ColumnSpan="2" ItemsSource="{Binding Items}" >
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate x:DataType="{x:Type model:UE }"> <DataTemplate x:DataType="{x:Type model:UE }">
@ -56,49 +53,43 @@
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label Grid.Row="1" <Label Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Text="{Binding Intitulé}" Text="{Binding Intitulé}"
FontAttributes="None" FontAttributes="None"
VerticalOptions="End" VerticalOptions="End"/>
/>
<Label Grid.Column="3" <Label Grid.Column="3"
Grid.Row="1" Grid.Row="1"
Text="{Binding Coefficient}" Text="{Binding Coefficient}"
TextColor="Blue" TextColor="Blue"
FontAttributes="Bold" /> FontAttributes="Bold" />
<!--// <Button Text="DELETE"></Button>-->
</Grid> </Grid>
</SwipeView> </SwipeView>
<!--<SwipeView>
<SwipeView.RightItems>
<SwipeItems>
<SwipeItem Text="Delete"
BackgroundColor="Red"
Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:BlocViewModel}}, Path=DeleteCommand}"
CommandParameter="{Binding .}"
/>
</SwipeItems>
</SwipeView.RightItems>
<Grid Padding="0">-->
<!--<Frame>
<Frame.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:BlocViewModel}}, Path=TapCommand}"
CommandParameter="{Binding .}"/>
</Frame.GestureRecognizers>
<Label Text="{Binding Intitulé}"
FontSize="10" TextColor="Black" />
</Frame>
</Grid>
</SwipeView>-->
</DataTemplate> </DataTemplate>
</CollectionView.ItemTemplate> </CollectionView.ItemTemplate>
</CollectionView> </CollectionView>
</Grid> </Grid>
</ContentPage> </ContentPage>
<!--<ContentPage Title="ue" IconImageSource="mamoyenne.png" x:DataType="viewmodel:UeViewModel" > <!--<ContentPage Title="ue" IconImageSource="mamoyenne.png" x:DataType="viewmodel:UeViewModel" >
<Frame Margin="10,0,10,0" VerticalOptions="center"> <Frame Margin="10,0,10,0" VerticalOptions="center">
<Grid RowDefinitions="100 ,auto,*" <Grid RowDefinitions="100 ,auto,*"

@ -10,15 +10,11 @@ using System.Threading.Tasks;
namespace CalculateurApp.ViewModel namespace CalculateurApp.ViewModel
{ {
// [QueryProperty("Nom", "Nom")] [QueryProperty("Nom", "Nom")]
public partial class BlocViewModel:ObservableObject public partial class BlocViewModel:ObservableObject
{ {
[RelayCommand]
async Task GoBack()
{
await Shell.Current.GoToAsync("..");
}
public BlocModel blocModel { get; set; } public BlocModel blocModel { get; set; }
public UE ue { get; set; } public UE ue { get; set; }
public BlocViewModel() public BlocViewModel()
@ -54,54 +50,16 @@ namespace CalculateurApp.ViewModel
} }
} }
[RelayCommand]
async Task GoBack()
//[RelayCommand] {
//async Task Tap(String s) await Shell.Current.GoToAsync("..");
//{ }
// await Shell.Current.GoToAsync($"{nameof(UE)}?Nom={s}");
//}
} }
// public ObservableCollection<BlocModel> blcs { get; set; }
// public BlocViewModel()
// {
// Items = new ObservableCollection<string>();
// }
// [ObservableProperty]
// ObservableCollection<int> item;
// [RelayCommand]
// public void FillData()
// {
// blcs = new ObservableCollection<BlocModel>
// {
// new BlocModel()
// {
// id=0,
// },
// new BlocModel()
// {
// id=1,
// },
// new BlocModel()
// {
// id=2,
// },
// new BlocModel()
// {
// id=3,
// },
// new BlocModel()
// {
// id=4,
// },
// };
//ckkkkkkkk}
} }

@ -1,4 +1,6 @@
using CalculateurApp.View; using BSN;
using CalculateurApp.View;
using CalculateurEF.Context;
using ClassCalculateurMoyenne; using ClassCalculateurMoyenne;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Input;
@ -24,8 +26,10 @@ namespace CalculateurApp.ViewModel
} }
[ObservableProperty] [ObservableProperty]
ObservableCollection<BlocModel> items; ObservableCollection<BlocModel> items;
[ObservableProperty] [ObservableProperty]
string nom; string nom;
[RelayCommand] [RelayCommand]
void Add() void Add()
{ {
@ -44,11 +48,19 @@ namespace CalculateurApp.ViewModel
Items.Remove(bl); Items.Remove(bl);
} }
} }
[RelayCommand] [RelayCommand]
async Task Tap(String s) async Task Tap(String s)
{ {
await Shell.Current.GoToAsync($"{nameof(BlocModel)}?Nom={s}"); await Shell.Current.GoToAsync($"{nameof(BlocModel)}?Nom={s}");
} }
[RelayCommand]
public void GetAllUE()
{
// var result=Manager
}
} }
} }

@ -10,17 +10,13 @@ using System.Threading.Tasks;
namespace CalculateurApp.ViewModel namespace CalculateurApp.ViewModel
{ {
// [QueryProperty("Nom", "Nom")] [QueryProperty("Nom", "Nom")]
public partial class UeViewModel:ObservableObject public partial class UeViewModel:ObservableObject
{ {
//[ObservableProperty] //[ObservableProperty]
//string nom; //string nom;
//[RelayCommand]
//async Task GoBack()
//{
// await Shell.Current.GoToAsync("..");
//}
public UE u { get; set; } public UE u { get; set; }
public Matiere ma { get; set; } public Matiere ma { get; set; }
@ -67,6 +63,11 @@ namespace CalculateurApp.ViewModel
Items.Remove(bl); Items.Remove(bl);
} }
} }
[RelayCommand]
async Task GoBack()
{
await Shell.Current.GoToAsync("..");
}
} }

@ -9,8 +9,9 @@ namespace CalculateurEF.Entities
public class BlocEntity public class BlocEntity
{ {
#region Propriétés #region Propriétés
public List<UEentity> ue;
public int Id { get; set; } public int Id { get; set; }
public string Nom { get; set; } public string Nom;
//public ICollection<UEentity> ue { get; set; } //public ICollection<UEentity> ue { get; set; }

@ -12,5 +12,6 @@ namespace CalculateurEF.Entities
public long id { get; set; } public long id { get; set; }
public int Note { get; set; } public int Note { get; set; }
public int Coef { get; set; } public int Coef { get; set; }
} }
} }

@ -14,6 +14,7 @@ namespace CalculateurEF.Entities
public int Coefficient { get; set; } public int Coefficient { get; set; }
public string intitulé { get; set; } public string intitulé { get; set; }
public ICollection<MatiereEntity> mat { get; set; } public ICollection<MatiereEntity> mat { get; set; }
public List<MatiereEntity> matiere;
public UEentity() public UEentity()

@ -13,21 +13,40 @@ namespace CalculateurMapping
{ {
public class BlocDbDataManager : IDataManager<BlocModel> public class BlocDbDataManager : IDataManager<BlocModel>
{ {
public Task<bool> Add(BlocModel data) public async Task<bool> Add(BlocModel data)
{ {
throw new NotImplementedException(); bool resultat = false;
using (var context = new CalculContext())
{
BlocEntity entity = new BlocEntity
{
Nom = data.Getnom(),
};
for (int i = 0; i < data.ue.Count; i++)
{
UEentity uEentity = new UEentity
{
intitulé = data.ue[i].Intitulé
};
context.Bloc.Add(entity);
await context.SaveChangesAsync();
resultat = true;
}
return resultat;
}
} }
public async Task<bool> Delete(BlocModel bloc) public async Task<bool> Delete(BlocModel bloc)
{ {
//bool result = false; bool result = false;
//using (var context = new CalculContext()) using (var context = new CalculContext())
//{ {
// BlocEntity entity = context.Bloc.Find(bloc.Nom); BlocEntity entity = context.Bloc.Find(bloc.Nom);
// context.Bloc.Remove(entity); context.Bloc.Remove(entity);
// result = await context.SaveChangesAsync() > 0; result = await context.SaveChangesAsync() > 0;
//} }
return true; return true;
} }
@ -50,7 +69,6 @@ namespace CalculateurMapping
{ {
return await context.Bloc.Where(e => e.Nom == name).Select(e => new BlocModel return await context.Bloc.Where(e => e.Nom == name).Select(e => new BlocModel
( (
e.Nom, e.Nom,
e.ue.Select(j => new UE(j.intitulé)).ToArray() e.ue.Select(j => new UE(j.intitulé)).ToArray()
)).FirstOrDefaultAsync(); )).FirstOrDefaultAsync();

@ -54,39 +54,59 @@ namespace CalculateurMapping
return result; return result;
} }
public async Task<IEnumerable<MaquetteModel>> GetAll() //public async Task<IEnumerable<MaquetteModel>> GetAll()
{
//using (var context = new CalculContext())
//{ //{
// return await context.Maquettes.Select(e => new MaquetteModel // using (var context = new CalculContext())
// (e.Id, // {
// e.NomMaquette, // return await context.Maquettes.Select(I => new MaquetteModel
// e.Bloc.Select(u => // (
// I.Id,
// I.NomMaquette,
// I.Bloc.Select(u =>
// u.ue.Select(uee => new UE(uee.Id, uee.Coefficient, uee.intitulé, // u.ue.Select(uee => new UE(uee.Id, uee.Coefficient, uee.intitulé,
// uee.mat.Select(ma => new Matiere(ma.id, ma.Note,ma.Nommatiere,ma.Coef)).ToArray() // uee.mat.Select(ma => new Matiere(ma.id, ma.Note,ma.Nommatiere,ma.Coef)).ToArray()
// )).ToList() // )).ToList()
// ), // ),
// e.Bloc.Select(j => new BlocModel(j.Nom)).ToArray() // I.Bloc.Select(j => new BlocModel(j.Nom)).ToArray()
// )).ToListAsync(); // )).ToListAsync();
//} // }
return null; // return null;
// }
public async Task<IEnumerable<MaquetteModel>> GetAll()
{
using (var context = new CalculContext())
{
List<MaquetteModel> maquettes = new List<MaquetteModel>();
foreach (var item in await context.Maquettes.ToListAsync())
maquettes.Add(new MaquetteModel(item.Id, item.NomMaquette));
return maquettes;
}
} }
public async Task<MaquetteModel> GetDataWithName(string name) public async Task<MaquetteModel> GetDataWithName(string name)
{ {
using (var context = new CalculContext())
{
MaquetteModel _mqt = null;
var query = await context.Maquettes.FirstOrDefaultAsync(n => n.NomMaquette == name);
_mqt = new MaquetteModel(query.Id, query.NomMaquette);
return _mqt;
}
}
//using (var context = new CalculContext()) //using (var context = new CalculContext())
//{ //{
// return await context.Maquettes.Where(e => e.NomMaquette == name).Select(e => new MaquetteModel // return await context.Maquettes.Where(e => e.NomMaquette == name).Select(e => new MaquetteModel
// ( // (
// // e.Id, //e.Id,
// //e.NomMaquette, //e.NomMaquette,
// //e.Bloc.Select(u => u.ue).ToList(), //e.Bloc.Select(u => u.ue).ToList(),
// //e.Bloc.Select(j => new BlocModel(j.Nom)).ToArray() //e.Bloc.Select(j => new BlocModel(j.Nom)).ToArray()
// )).FirstOrDefaultAsync(); // )).FirstOrDefaultAsync();
//} //}
return null;
}
public async Task<bool> Update(MaquetteModel data) public async Task<bool> Update(MaquetteModel data)
{ {

@ -1,5 +1,6 @@
using BSN; using BSN;
using CalculateurEF.Context; using CalculateurEF.Context;
using CalculateurEF.Entities;
using ClassCalculateurMoyenne; using ClassCalculateurMoyenne;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System; using System;
@ -12,14 +13,34 @@ namespace CalculateurMapping
{ {
public class MatiereDbDataManager : IDataManager<Matiere> public class MatiereDbDataManager : IDataManager<Matiere>
{ //Maping entre la classe Matier et MatiereEntity { //Maping entre la classe Matier et MatiereEntity
public Task<bool> Add(Matiere data) public async Task<bool> Add(Matiere data)
{ {
throw new NotImplementedException(); bool result = false;
using (var context = new CalculContext())
{
MatiereEntity entity = new MatiereEntity
{
Nommatiere = data.GetNommatiere(),
};
context.matier.Add(entity);
await context.SaveChangesAsync();
result = true;
return result;
}
} }
public Task<bool> Delete(Matiere data) public async Task<bool> Delete(Matiere mat)
{ {
throw new NotImplementedException(); bool result = false;
using (var Context = new CalculContext())
{
MatiereEntity entity = Context.matier.Find(mat.GetNommatiere());
Context.matier.Remove(entity);
result = await Context.SaveChangesAsync() > 0;
}
return result;
} }
public async Task<IEnumerable<Matiere>> GetAll() public async Task<IEnumerable<Matiere>> GetAll()
@ -27,7 +48,7 @@ namespace CalculateurMapping
using (var context = new CalculContext()) using (var context = new CalculContext())
{ {
return await context.matier.Select(e => new Matiere return await context.matier.Select(e => new Matiere
( e.id, (e.id,
e.Note, e.Note,
e.Nommatiere, e.Nommatiere,
e.Coef e.Coef
@ -40,9 +61,21 @@ namespace CalculateurMapping
throw new NotImplementedException(); throw new NotImplementedException();
} }
public Task<bool> Update(Matiere data) public async Task<bool> Update(Matiere mat)
{ {
throw new NotImplementedException(); bool result = false;
using (var context = new CalculContext())
{
MatiereEntity entity = context.matier?.Find(mat.Id);
if (entity != null)
{
entity.Nommatiere = mat.Nommatiere;
result = await context.SaveChangesAsync() > 0;
}
return result;
}
} }
} }
} }

@ -1,8 +1,12 @@
using BSN; using BSN;
using CalculateurEF.Context;
using CalculateurEF.Entities;
using ClassCalculateurMoyenne; using ClassCalculateurMoyenne;
using Microsoft.EntityFrameworkCore;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection.Metadata;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -10,19 +14,55 @@ namespace CalculateurMapping
{ {
public class UeDbDataManager : IDataManager<UE> public class UeDbDataManager : IDataManager<UE>
{ {
public Task<bool> Add(UE data) public async Task<bool> Add(UE data)
{ {
throw new NotImplementedException(); bool resultat = false;
using (var context = new CalculContext())
{
UEentity entity = new UEentity
{
intitulé = data.GetIntitulé(),
};
for (int i = 0; i < data.Matieres.Count; i++)
{
MatiereEntity matiereEntity = new MatiereEntity
{
Nommatiere = data.Matieres[i].Nommatiere
};
context.Ue.Add(entity);
await context.SaveChangesAsync();
resultat = true;
}
return resultat;
}
} }
public Task<bool> Delete(UE data) public async Task<bool> Delete(UE data)
{ {
throw new NotImplementedException(); bool result = false;
using (var context = new CalculContext())
{
UEentity entity = context.Ue.Find(data.Intitulé);
context.Ue.Remove(entity);
result = await context.SaveChangesAsync() > 0;
}
return true;
} }
public Task<IEnumerable<UE>> GetAll() public async Task<IEnumerable<UE>> GetAll()
{ {
throw new NotImplementedException(); using (var context = new CalculContext())
{
return await context.Ue.Select(e => new UE
(
e.Id,
e.Coefficient,
e.intitulé,
e.matiere.Select(j => new Matiere(j.Nommatiere)).ToArray()
)).ToListAsync();
}
} }
public Task<UE> GetDataWithName(string name) public Task<UE> GetDataWithName(string name)
@ -30,9 +70,20 @@ namespace CalculateurMapping
throw new NotImplementedException(); throw new NotImplementedException();
} }
public Task<bool> Update(UE data) public async Task<bool> Update(UE data)
{ {
throw new NotImplementedException(); bool result = false;
using (var context = new CalculContext())
{
UEentity entity = context.Ue.Find(data.Id);
entity.intitulé = data.Intitulé;
entity.matiere = data.Matieres.Select(j => new MatiereEntity
{
Nommatiere = j.Nommatiere,
}).ToList();
result = await context.SaveChangesAsync() > 0;
}
return result;
} }
} }
} }

@ -49,6 +49,11 @@ namespace ClassCalculateurMoyenne
{ {
} }
public string Getnom()
{
return Getnom();
}
private IEnumerable<UE> Ajouterue(params UE[] ues) private IEnumerable<UE> Ajouterue(params UE[] ues)
{ {
List<UE> result = new(); List<UE> result = new();
@ -90,7 +95,6 @@ namespace ClassCalculateurMoyenne
return true; return true;
return false; return false;
} }
public bool Equals(BlocModel other) public bool Equals(BlocModel other)
{ {
return Equals(other.Nom); return Equals(other.Nom);
@ -103,5 +107,9 @@ namespace ClassCalculateurMoyenne
if (GetType() != obj.GetType()) return false; if (GetType() != obj.GetType()) return false;
return Equals(obj as BlocModel); return Equals(obj as BlocModel);
} }
public override int GetHashCode()
{
return Nom.GetHashCode();
}
} }
} }

@ -82,6 +82,7 @@ namespace ClassCalculateurMoyenne
return false; return false;
} }
} }
public bool ajouteBloc(BlocModel b) public bool ajouteBloc(BlocModel b)
{ {
@ -96,6 +97,10 @@ namespace ClassCalculateurMoyenne
} }
} }
public override int GetHashCode()
{
return NomMaquette.GetHashCode();
}
private bool IsExiste(BlocModel b) private bool IsExiste(BlocModel b)
{ {

@ -14,10 +14,18 @@ namespace ClassCalculateurMoyenne
public string Nommatiere { get; set; } public string Nommatiere { get; set; }
public int Note { get; set; } public int Note { get; set; }
public int Coef { get; set; } public int Coef { get; set; }
public Matiere() public string GetNommatiere()
{
return GetNommatiere();
}
private void SetNomMaquette(string value)
{ {
this.Nommatiere = value;
} }
public Matiere(long id ,int note, string nommatiere, int coef) public Matiere(long id ,int note, string nommatiere, int coef)
{ {
Id = id; Id = id;
@ -30,6 +38,11 @@ namespace ClassCalculateurMoyenne
{ {
Nommatiere = nommatiere; Nommatiere = nommatiere;
} }
public Matiere()
{
}
public override string ToString() public override string ToString()
{ {
return $"{Nommatiere},{Note},{Coef}"; return $"{Nommatiere},{Note},{Coef}";

@ -11,7 +11,10 @@ namespace ClassCalculateurMoyenne
private int coefficient; private int coefficient;
[ObservableProperty] [ObservableProperty]
private string intitulé; private string intitulé;
public string GetIntitulé()
{
return GetIntitulé();
}
public UE ( long id, int coefficient, string intitulé,params Matiere[] matieres) public UE ( long id, int coefficient, string intitulé,params Matiere[] matieres)
{ {

Loading…
Cancel
Save