16‏/03‏/2012

Programme ( Oussaki School Soft ) برنامج من برمجتي

http://i.imgur.com/zfjp6.png
الحمد لله على إحسانه
والشكر له على توفيقه وامتنانه
وأشهد أن لا إله إلا الله وحده لا شريك له تعظيما لشانه
وأشهد أن محمدا عبده ورسوله الداعي إلى رضوانه
صلى الله عليه وعلى صحبه وإخوانه

وبعد :
السلام عليكم و رحمة الله تعالى و بركاته
أهلا بكم أحبتي في الله
طبتم وطاب بكم موضوعنا لهذا اليوم بإذن الله
أهلاً وسهلا بكم
+-----------------------------+
في هذا الموضوع سأضع مثال حول برامج المؤسسة البسيط ..Oussaki School Soft V1.0-
قمت ببرمجة هذا البرنامج بالــ Delphi XE و إستعملت قاعدة بيانات Absolute db
http://i.imgur.com/zfjp6.png
فكرة البرنامج : هو برنامج بسيط لتسير سير البيداغوجية في مؤسسة تربوية مزال قيد التطوير
أهم خصائصه تسير الشعب في المؤسسة و حجز نقاط التلاميد و عمل كشوف نقاط خاصة
لكل أستاد في مادته أو للتلاميذ

http://i.imgur.com/zfjp6.png


على بركة الله ..
أترككم مع بعض الصور من البرنامج
الواجهة الرئيسية للبرنامج




تسجيل معلومات تلميد جديد و هي واضحة جدا
الآن مع تسجيل تلميد في شعبة معينة حيث قمت بتحديد أن التلميد يدرس في شعبة واحدة في سنة دراسية معية
حيث لتسهيل التسجيل هناك أدوات بحث عن الشعب و التلاميذ كما توضح الصورة
http://i.imgur.com/zfjp6.png
نأتي الآن لأهم شيء إدارة الشعب و المستويات و الأفواج
من إظافة و حدف و إسناد المعاملات للمواد في كل شعبة
لإظافة شعبة جديدة في مستوى معين
ما عليك سوى كتابة إسمها و سيتم التحقق أتوماتيكيا من تواجدها مسبفا
و نختار المستوى ثم عدد الأفواج في الشعبة

و نختار المواد في الشعبة و معاملاتها كما يمكنك إظافة مادة في القائمة أو حدف مادة من المواد

و يمكن البحث عن شعبة و المواد المردسة فيها و معاملاتها
ننتقل لإدارة ألساتدة

و الصفحة الرئيسية لها كما يلي
http://i.imgur.com/zfjp6.png
نأتي لحجز نقاط فوج معين في مادة معينة
حيث يمكنك الحجز مباشرة على الجدول و يمكنك تصدير النتيجة إلى ملف
pdf و حمله معك أينما دهبت و كما يمكن طبع هادا الجدول الخاص بكشف النقاط
http://i.imgur.com/zfjp6.png
نأتي إلى Le Bulltin ههههه هنا المهزلة التي يخاف منها التلاميد
يمكنك حفظ كشف النقاط للتلميذ على شكل ملف pdf كما يمكنك طباعته

http://i.imgur.com/zfjp6.png
بقي بعض اإحصائيات البسيطة
http://i.imgur.com/zfjp6.png

http://i.imgur.com/zfjp6.png
صورة للجداول المستعملة في قاعدة البيانات ↓
http://i.imgur.com/zfjp6.png
+
في إنتظار ملاحضاتكم
http://i.imgur.com/zfjp6.pnghttp://i.imgur.com/zfjp6.png
و صلنا للشيئ المهم كود سورس البرنامج //
الفورم 1
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, SkinTabs, SkinCtrls, DynamicSkinForm, SkinData, SkinMenus,
ImgList, Grids, DBGrids,Connection, StdCtrls, SkinBoxCtrls, SkinExCtrls,
DBCtrls, Mask, SkinGrids, spDBGrids, spSkinShellCtrls,Fonctions, spdbctrls,
DB, ABSMain, pngimage, ExtCtrls, spMessages, spDialogs, SkinHint,
sppngimagelist, jpeg, GIFImg, IdBaseComponent, IdCoder,
IdCoderQuotedPrintable, DBTables, AdvObj, BaseGrid, AdvGrid, TeEngine, Series,
TeeProcs, Chart;
type
TForm3 = class(TForm)
spSkinExPanel1: TspSkinExPanel;
spSkinButtonsBar2: TspSkinButtonsBar;
ImageList1: TImageList;
spSkinFrame1: TspSkinFrame;
spDynamicSkinForm1: TspDynamicSkinForm;
spSkinData1: TspSkinData;
spCompressedStoredSkin1: TspCompressedStoredSkin;
Open_Picture: TspSkinOpenPictureDialog;
spSkinMessage1: TspSkinMessage;
spSkinInputDialog1: TspSkinInputDialog;
PAGE: TspSkinPageControl;
Ajouter_Etudiant: TspSkinTabSheet;
In--oo--ion: TspSkinTabSheet;
spSkinGroupBox1: TspSkinGroupBox;
spSkinDBLookupComboBox1: TspSkinDBLookupComboBox;
spSkinLabel1: TspSkinLabel;
spSkinLabel2: TspSkinLabel;
spSkinDBLookupComboBox2: TspSkinDBLookupComboBox;
spSkinGroupBox3: TspSkinGroupBox;
Image1: TImage;
spSkinDBLookupComboBox3: TspSkinDBLookupComboBox;
Check_Num: TspSkinCheckRadioBox;
Check_Nom: TspSkinCheckRadioBox;
spSkinLabel3: TspSkinLabel;
spSkinLabel4: TspSkinLabel;
spSkinButton1: TspSkinButton;
spSkinLabel5: TspSkinLabel;
NGroupe: TspSkinDBLookupComboBox;
Niveau: TspSkinComboBoxEx;
NEtudiant: TspSkinDBEdit;
GestionBraches: TspSkinTabSheet;
spSkinGroupBox4: TspSkinGroupBox;
spSkinGroupBox5: TspSkinGroupBox;
spSkinGroupBox6: TspSkinGroupBox;
spSkinDBGrid4: TspSkinDBGrid;
spSkinScrollBar1: TspSkinScrollBar;
spSkinButton2: TspSkinButton;
Image3: TImage;
spSkinDBText1: TspSkinDBText;
spSkinHint1: TspSkinHint;
spPngImageList1: TspPngImageList;
Image4: TImage;
spSelectSkinDialog1: TspSelectSkinDialog;
spSkinMessage2: TspSkinMessage;
SaisieNote: TspSkinTabSheet;
spSkinGroupBox8: TspSkinGroupBox;
spSkinDBGrid2: TspSkinDBGrid;
spSkinGroupBox9: TspSkinGroupBox;
spSkinLabel12: TspSkinLabel;
spSkinDBLookupComboBox4: TspSkinDBLookupComboBox;
spSkinLabel13: TspSkinLabel;
spSkinDBLookupComboBox5: TspSkinDBLookupComboBox;
spSkinLabel15: TspSkinLabel;
spSkinDBLookupComboBox6: TspSkinDBLookupComboBox;
spSkinLabel16: TspSkinLabel;
spSkinDBLookupComboBox7: TspSkinDBLookupComboBox;
spSkinScrollBar3: TspSkinScrollBar;
spSkinGroupBox10: TspSkinGroupBox;
Intro: TspSkinTabSheet;
spSkinLabel19: TspSkinLabel;
spSkinComboBoxEx3: TspSkinComboBoxEx;
spSkinDBGrid3: TspSkinDBGrid;
spSkinLabel20: TspSkinLabel;
spSkinLabel21: TspSkinLabel;
Listedeseleves: TspSkinTabSheet;
spSkinDBGrid5: TspSkinDBGrid;
spSkinLabel18: TspSkinLabel;
Yeardbcombox: TspSkinComboBoxEx;
ChercheElev: TspSkinEdit;
spSkinDBEdit1: TspSkinDBEdit;
spSkinLabel22: TspSkinLabel;
spSkinGroupBox12: TspSkinGroupBox;
spSkinGroupBox7: TspSkinGroupBox;
spSkinDBGrid1: TspSkinDBGrid;
spSkinLabel7: TspSkinLabel;
spSkinLabel9: TspSkinLabel;
Branche: TspSkinDBLookupComboBox;
Image6: TImage;
spSkinComboBoxEx1: TspSkinComboBoxEx;
Image5: TImage;
spSkinGroupBox13: TspSkinGroupBox;
spSkinLabel8: TspSkinLabel;
spSkinEdit2: TspSkinEdit;
spSkinLabel10: TspSkinLabel;
spSkinComboBoxEx2: TspSkinComboBoxEx;
spSkinLabel11: TspSkinLabel;
Nbrgroupe: TspSkinSpinEdit;
spSkinGroupBox14: TspSkinGroupBox;
BrancheNomEdit: TspSkinEdit;
BrancheNom: TspSkinCheckRadioBox;
Image2: TImage;
spSkinDBNavigator1: TspSkinDBNavigator;
spSkinGroupBox11: TspSkinGroupBox;
spSkinGroupBox15: TspSkinGroupBox;
AdvStringGrid1: TAdvStringGrid;
spSkinButton4: TspSkinButton;
spSkinButton5: TspSkinButton;
spSkinGroupBox16: TspSkinGroupBox;
spSkinLabel6: TspSkinLabel;
spSkinLabel17: TspSkinLabel;
Cus_Date_N: TspSkinLabel;
spSkinLabel14: TspSkinLabel;
Cus_Adres: TspSkinMemo;
Cus_Date: TspSkinDateEdit;
Add_User: TspSkinXFormButton;
Cus_Nom: TspSkinEdit;
spSkinGroupBox2: TspSkinGroupBox;
DBImage2: TDBImage;
Cus_Prenom: TspSkinEdit;
spSkinButton6: TspSkinButton;
spSkinScrollBar2: TspSkinScrollBar;
Notes_Etudiant: TspSkinTabSheet;
spSkinGroupBox17: TspSkinGroupBox;
spSkinGroupBox18: TspSkinGroupBox;
spSkinDBLookupComboBox8: TspSkinDBLookupComboBox;
spSkinDBText2: TspSkinDBText;
Image7: TImage;
Edit1: TEdit;
AdvStringGrid2: TAdvStringGrid;
GetBulltin: TspSkinButton;
TrimesteAnnéScolaire: TspSkinGroupBox;
spSkinComboBoxEx4: TspSkinComboBoxEx;
spSkinComboBoxEx5: TspSkinComboBoxEx;
spSkinLabel23: TspSkinLabel;
spSkinLabel24: TspSkinLabel;
spSkinLabel25: TspSkinLabel;
spSkinLabel26: TspSkinLabel;
spSkinLabel27: TspSkinLabel;
spSkinLabel28: TspSkinLabel;
spSkinButton7: TspSkinButton;
spSkinLabel29: TspSkinLabel;
spSkinComboBoxEx6: TspSkinComboBoxEx;
AjouteProf: TspSkinTabSheet;
spSkinGroupBox19: TspSkinGroupBox;
spSkinLabel30: TspSkinLabel;
spSkinLabel31: TspSkinLabel;
spSkinLabel33: TspSkinLabel;
spSkinLabel34: TspSkinLabel;
spSkinComboBoxEx7: TspSkinComboBoxEx;
spSkinEdit1: TspSkinEdit;
spSkinEdit3: TspSkinEdit;
spSkinMemo1: TspSkinMemo;
spSkinLabel32: TspSkinLabel;
spSkinEdit4: TspSkinEdit;
spSkinButton8: TspSkinButton;
spSkinGroupBox20: TspSkinGroupBox;
spSkinLabel35: TspSkinLabel;
spSkinDBLookupComboBox9: TspSkinDBLookupComboBox;
spSkinLabel36: TspSkinLabel;
spSkinDBLookupComboBox10: TspSkinDBLookupComboBox;
spSkinLabel37: TspSkinLabel;
spSkinDBLookupComboBox11: TspSkinDBLookupComboBox;
spSkinLabel38: TspSkinLabel;
spSkinDBLookupComboBox12: TspSkinDBLookupComboBox;
spSkinDBLookupComboBox13: TspSkinDBLookupComboBox;
spSkinLabel39: TspSkinLabel;
spSkinButton9: TspSkinButton;
spSkinLabel40: TspSkinLabel;
spSkinLabel41: TspSkinLabel;
State: TspSkinTabSheet;
Chart1: TChart;
Series1: TBarSeries;
Series2: TBarSeries;
Button1: TButton;
procedure spSkinButtonsBar2Sections0Items0Click(Sender: TObject);
procedure spSkinButtonsBar2Sections0Items0DblClick(Sender: TObject);
procedure DBImage2Click(Sender: TObject);
procedure Add_UserClick(Sender: TObject);
procedure recherChange(Sender: TObject);
procedure NiveauChange(Sender: TObject);
procedure spSkinButton1Click(Sender: TObject);
procedure spSkinEdit2Change(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure spSkinButton2Click(Sender: TObject);
procedure spSkinComboBoxEx1Change(Sender: TObject);
procedure Image3Click(Sender: TObject);
procedure Image3MouseEnter(Sender: TObject);
procedure Image4MouseEnter(Sender: TObject);
procedure Image4Click(Sender: TObject);
procedure Image6Click(Sender: TObject);
procedure Image5Click(Sender: TObject);
procedure Image6MouseEnter(Sender: TObject);
procedure Image5MouseEnter(Sender: TObject);

procedure spSkinDBLookupComboBox4Change(Sender: TObject);
procedure spSkinDBGrid2KeyPress(Sender: TObject; var Key: Char);
procedure spSkinDBGrid3KeyPress(Sender: TObject; var Key: Char);
procedure spSkinDBLookupComboBox7Change(Sender: TObject);
procedure spSkinDBLookupComboBox5Change(Sender: TObject);
procedure spSkinDBLookupComboBox5Click(Sender: TObject);
procedure spSkinDBLookupComboBox6Change(Sender: TObject);
procedure spSkinComboBoxEx3Change(Sender: TObject);
procedure spSkinDBGrid3DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TspColumn; State: TGridDrawState);
procedure DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
Field: TField; State: TGridDrawState);
procedure ListedeselevesEnter(Sender: TObject);
procedure SaisieNoteEnter(Sender: TObject);
procedure spSkinDBLookupComboBox4Click(Sender: TObject);
procedure YeardbcomboxChange(Sender: TObject);
procedure ChercheElevChange(Sender: TObject);
procedure spSkinButtochartClick(Sender: TObject);
procedure AdvStringGrid1EditCellDone(Sender: TObject; ACol, ARow: Integer);
procedure spSkinButton4Click(Sender: TObject);
procedure spSkinButton5Click(Sender: TObject);
procedure YeardbcomboxClick(Sender: TObject);
procedure spSkinComboBoxEx3Click(Sender: TObject);
procedure spSkinDBLookupComboBox7Click(Sender: TObject);
procedure spSkinDBLookupComboBox6Click(Sender: TObject);
procedure AdvStringGrid1SelectCell(Sender: TObject; ACol, ARow: Integer;
var CanSelect: Boolean);
procedure spSkinButton6Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Edit1Change(Sender: TObject);
procedure Notes_EtudiantEnter(Sender: TObject);
procedure spSkinComboBoxEx4Change(Sender: TObject);
procedure spSkinComboBoxEx5Change(Sender: TObject);
procedure spSkinDBLookupComboBox8Change(Sender: TObject);
procedure GetBulltinClick(Sender: TObject);
procedure spSkinButton7Click(Sender: TObject);
procedure spSkinButton8Click(Sender: TObject);
procedure spSkinDBLookupComboBox9Change(Sender: TObject);
procedure spSkinDBLookupComboBox10Change(Sender: TObject);
procedure spSkinDBLookupComboBox10Click(Sender: TObject);
procedure spSkinButton9Click(Sender: TObject);
procedure spSkinButtonsBar2Sections0Items1Click(Sender: TObject);
procedure spSkinButtonsBar2Sections1Items0Click(Sender: TObject);
procedure spSkinButtonsBar2Sections2Items0Click(Sender: TObject);
procedure spSkinButtonsBar2Sections2Items1Click(Sender: TObject);
procedure spSkinButtonsBar2Sections3Items0Click(Sender: TObject);
procedure StateContextPopup(Sender: TObject; MousePos: TPoint;
var Handled: Boolean);
procedure StateEnter(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure spSkinButtonsBar2Sections4Items0Click(Sender: TObject);
procedure StateMouseEnter(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
filename:string;
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.Add_UserClick(Sender: TObject);
begin
GetSystemTime(DateEtHeure);



if (Cus_prenom.Text='')or (spSkinComboBoxEx6.Text = '') or (Cus_Nom.Text ='') or (Cus_Adres.Text = '') or (Cus_Date.text =' / / ') then
begin
if spSkinMessage1.MessageDlg('Remplis tous les case S.V.P ! ',mtInformation,mbOKCancel,0) = 1 then



end
else
begin
Connection.Form4.Ds_Etudiant.DataSet.Insert;


Connection.Form4.Ds_Etudiant.DataSet.FieldByName('Nom_Etud').AsString:=Cus_Nom.Text;
Connection.Form4.Ds_Etudiant.DataSet.FieldByName('Prenom_Etud').AsString:= Cus_Prenom.Text;
Connection.Form4.Ds_Etudiant.DataSet.FieldByName('Date_Naissance').Value:= Cus_Date.date;
Connection.Form4.Ds_Etudiant.DataSet.FieldByName('Adress').AsString := Cus_Adres.Text;
Connection.Form4.Ds_Etudiant.DataSet.FieldByName('Sexe').AsString := spSkinComboBoxEx6.Text;
if filename <> '' then
begin
TBlobField(Connection.Form4.Ds_Etudiant.DataSet.FieldByName('Photo')).
LoadFromFile(FileName);
end;
Connection.Form4.Ds_Etudiant.DataSet.post;
//Ds_User_EM_State.DataSet.FieldByName('Years').AsInteger := DateEtHeure.wYear;
//Ds_User_EM_State.DataSet.FieldByName('Mois').AsInteger := DateEtHeure.wMonth;
ShowMessage('Enregistrement avec succès !');
Cus_Adres.Text := '';
Cus_Nom.Text := '';
Cus_Prenom.Text := '';
Cus_Date.Clear;


end;


end;
procedure TForm3.AdvStringGrid1EditCellDone(Sender: TObject; ACol,
ARow: Integer);
begin
if (AdvStringGrid1.CellToReal(ACol,ARow) > 20.00 )or (AdvStringGrid1.CellToReal(ACol,ARow) < 0.00 ) then
begin
AdvStringGrid1.ClearRect(ACol,Arow,Acol,Arow);
spSkinButton4Click(Sender);
end;
if (ACol = 4) then
begin
if (AdvStringGrid1.CellToReal(ACol,ARow) >= 10 ) then
begin
AdvStringGrid1.ColorRect(Acol,Arow,ACol,Arow,54423);
end else
begin
if (AdvStringGrid1.CellToReal(ACol,ARow) < 10 ) and (AdvStringGrid1.CellToReal(ACol,ARow) >= 0 )then
begin
AdvStringGrid1.ColorRect(Acol,Arow,ACol,Arow,74433);


end;
end;
end;


spSkinButton5Click(Sender);


end;
procedure TForm3.AdvStringGrid1SelectCell(Sender: TObject; ACol, ARow: Integer;
var CanSelect: Boolean);
begin
if (ACol = 4) then
begin
if (AdvStringGrid1.CellToReal(ACol,ARow) >= 10 ) then
begin
AdvStringGrid1.ColorRect(Acol,Arow,ACol,Arow,54423);
end else
begin
if (AdvStringGrid1.CellToReal(ACol,ARow) < 10 ) and (AdvStringGrid1.CellToReal(ACol,ARow) >= 0 )then
begin
AdvStringGrid1.ColorRect(Acol,Arow,ACol,Arow,74433);


end;
end;
end;
end;
procedure TForm3.Button1Click(Sender: TObject);
var nbrBranche,NbrEleve,Nbrprof,nbr_Matiere:integer;
begin
nbrBranche := Form4.Liste_Braches.RecordCount;
NbrEleve := form4.Etudiant.RecordCount;
Nbrprof := form4.Professeur.RecordCount;
nbr_Matiere := form4.Matiere.RecordCount;


Series1.Clear;
Series1.AddXY(10, nbrBranche,'Nombre Branche');
Series1.AddXY(15, NbrEleve,'Nombre éléve');
Series1.AddXY(20, Nbrprof,'Nombre de Professeur');
Series1.AddXY(25, nbr_Matiere,'Nombre de matiere');


end;
procedure TForm3.ChercheElevChange(Sender: TObject);
begin
if Check_Num.Checked then
begin
if ChercheElev.Text <> '' then
begin
Connection.Form4.In--oo--ion_List_Eleve.Filter := 'NEtudiant ='+QuotedStr(ChercheElev.Text+'*');
Connection.Form4.In--oo--ion_List_Eleve.Filtered := true;


end else
begin
Connection.Form4.In--oo--ion_List_Eleve.Filtered := false;
end;
end;
if Check_Nom.Checked then
begin
if ChercheElev.Text <> '' then
begin
Connection.Form4.In--oo--ion_List_Eleve.Filter := 'Nom_Etud ='+QuotedStr(ChercheElev.Text+'*');
Connection.Form4.In--oo--ion_List_Eleve.Filtered := true;


end else
begin
Connection.Form4.In--oo--ion_List_Eleve.Filtered := false;
end;
end;
end;
procedure TForm3.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
Field: TField; State: TGridDrawState);
begin
if (field.AsInteger > 20) or (field.AsInteger<0) then
begin
spSkinMessage1.MessageDlg('La note est plus grande que 20 ! ',mtInformation,mbOKCancel,0);
field.Clear;
end;


end;
procedure TForm3.DBImage2Click(Sender: TObject);
begin
Open_Picture.Filter:='BMP|*.bmp';
if Open_Picture.Execute then
begin
DBImage2.Picture.LoadFromFile(Open_Picture.FileName);
filename := Open_Picture.FileName;
end;
end;
procedure TForm3.Edit1Change(Sender: TObject);
begin
if Edit1.Text <> '' then
begin
form4.Etudiant.Filter := 'Nom_Etud = '+QuotedStr(Edit1.Text+'*');
form4.Etudiant.Filtered := true;
end else
begin
form4.Etudiant.Filtered := false;
end;


end;
procedure TForm3.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Application.Terminate;
end;
procedure TForm3.GetBulltinClick(Sender: TObject);
var NBranche,NGroupe,Niveau,Cofficion,NMatiere,NEtudiant,SommeCoefficion:integer;
Devoire1,Devoire2,Exam,Moyyen,MoyyenGeneral,Somme:Double;
SommeGeneral:double;
i,j:integer;
MoyGen,Nom_Branche,Nom_Matiere:string;


begin
SommeCoefficion := 0;
SommeGeneral := 0;
Form4.D_Note_Bulltin.DataSet.First;
NEtudiant := Form4.D_Note_Bulltin.DataSet.FieldByName('NEtudiant').AsInteger;
AdvStringGrid2.RowCount := Form4.D_Note_Bulltin.DataSet.RecordCount+1;
AdvStringGrid2.RowHeaders.Insert(0,'Matiere');
Form4.Appartient.Filter := 'NEtudiant = '+QuotedStr(inttostr(NEtudiant)+'*')+' and years = '+
QuotedStr(spSkinComboBoxEx5.Text+'*');
Form4.Appartient.Filtered := true;
NBranche := Form4.Ds_Appartient.DataSet.FieldByName('NBranche').AsInteger;
NGroupe := Form4.Ds_Appartient.DataSet.FieldByName('NGroupe').AsInteger;
Niveau := Form4.Ds_Appartient.DataSet.FieldByName('Niveau').AsInteger;;
Form4.Appartient.Filtered := false;
Form4.Liste_Braches.Filter := 'NBranche = '+QuotedStr(inttostr(NBranche)+'*');
Form4.Liste_Braches.Filtered := true;
Nom_Branche := Form4.Ds_Liste_Braches.DataSet.FieldByName('Nom_Branche').AsString;;
Form4.Liste_Braches.Filtered := false;


for i := 1 to AdvStringGrid2.RowCount+1 do
begin
///NMatiere
NMatiere := Form4.D_Note_Bulltin.DataSet.FieldByName('NMatiere').AsInteger;
devoire1 := Form4.D_Note_Bulltin.DataSet.FieldByName('Devoire1').AsFloat;
devoire2 := Form4.D_Note_Bulltin.DataSet.FieldByName('Devoire2').AsFloat;
Exam := Form4.D_Note_Bulltin.DataSet.FieldByName('Exam').AsFloat;
/// Coefficion
///
Form4.coefficion.Filter := 'NBranche = '+QuotedStr(inttostr(NBranche)+'*')+' and Niveau = '+
QuotedStr(inttostr(Niveau)+'*')+' and NMatiere = '+QuotedStr(inttostr(NMatiere)+'*');
Form4.coefficion.Filtered := true;
Cofficion := Form4.DS_coefficion.DataSet.FieldByName('Cofficion').AsInteger;
Form4.coefficion.Filtered := false;
//Nom_Matiere
Form4.Nomsmatieres.Filter := 'NMatiere = '+QuotedStr(inttostr(NMatiere)+'*');
Form4.Nomsmatieres.Filtered := true;
Nom_Matiere := Form4.DNomsmatieres.DataSet.FieldByName('NomMatiere').AsString;
Form4.Nomsmatieres.Filtered := false;
AdvStringGrid2.RowHeaders.Insert(i,Nom_Matiere);
j := 1;
AdvStringGrid2.Cells[j,i] := FloatToStr(devoire1);
j := j+1;
AdvStringGrid2.Cells[j,i] := FloatToStr(devoire2);
j := j+1;
AdvStringGrid2.Cells[j,i] := FloatToStr(exam);
j := j+1;
AdvStringGrid2.Cells[j,i] := inttoStr(Cofficion);
j := j+1;
Moyyen := (((devoire1+devoire2)+(exam*2))/4);
AdvStringGrid2.Cells[j,i] := FloatToStr(Moyyen);
j := j+1;
Somme := (((devoire1+devoire2)+(exam*2))/4)*Cofficion;
AdvStringGrid2.Cells[j,i] := FloatToStr(Somme);
SommeCoefficion := SommeCoefficion+Cofficion;
SommeGeneral := SommeGeneral+Somme;


Form4.D_Note_Bulltin.DataSet.Next;
end;
AdvStringGrid2.RowCount := AdvStringGrid2.RowCount+1;
spSkinGroupBox18.Caption :='Branche : '+Nom_Branche +' et Niveau : '+inttostr(Niveau)+' et Groupe : '+inttostr(NGroupe);
MoyyenGeneral := SommeGeneral/SommeCoefficion;
spSkinLabel25.Caption := floattostr(SommeGeneral);
MoyGen := floattostr(MoyyenGeneral);
SetLength(MoyGen,5);
spSkinLabel26.Caption := MoyGen;
AdvStringGrid2.PrintSettings.TitleText := ' -| Bulltin de : '+spSkinDBLookupComboBox8.Text+' '
+spSkinDBText2.Caption+' Branche : '
+Nom_Branche +' Niveau : '+inttostr(Niveau)+' Groupe : '+inttostr(NGroupe)+' Trimeste N° : '
+spSkinComboBoxEx4.Text+' Année Scolaire : '+spSkinComboBoxEx5.Text+' leur moyenne est : ' +spSkinLabel26.Caption;
end;
procedure TForm3.Image3Click(Sender: TObject);
var s:string;
begin


s := spSkinInputDialog1.InputBox('Nouveau matiere ',
'Enter La Nom de la matiere :', '');
if(s <>'')then
begin
Connection.Form4.DS_LISTE_MATIERE.DataSet.insert;
Connection.Form4.DS_LISTE_MATIERE.DataSet.FieldByName('NomMatiere').AsString := s;
Connection.Form4.DS_LISTE_MATIERE .DataSet.Post;
end;
end;
procedure TForm3.Image3MouseEnter(Sender: TObject);
begin
spSkinHint1.ActivateHintEx2('Click ici pour','ajouter une matiere ! ',0,spPngImageList1);
end;
procedure TForm3.Image4Click(Sender: TObject);
begin
Connection.Form4.DS_coefficion.DataSet.First;
while not Connection.Form4.DS_coefficion.DataSet.eof do
begin
if Connection.Form4.DS_coefficion.DataSet.FieldByName('NMatiere').AsInteger =
Connection.Form4.DS_LISTE_MATIERE.DataSet.FieldByName('NMatiere').AsInteger
then
begin
Connection.Form4.DS_coefficion.DataSet.Delete;
end;
Connection.Form4.DS_coefficion.DataSet.Next;
end;


Connection.Form4.DS_LISTE_MATIERE.DataSet.Delete;
spSkinMessage1.MessageDlg('La suppression avec succes ! ',mtInformation,[mbok],0);


end;
procedure TForm3.Image4MouseEnter(Sender: TObject);
begin
spSkinHint1.ActivateHintEx2('Click ici pour','Suprrimmer Cette matiere ! ',0,spPngImageList1);


end;
procedure TForm3.Image5Click(Sender: TObject);
var Branche,j,Niveau:integer;
begin
if spSkinMessage1.MessageDlg('Vouler vous Supprimer Ce Niveau !',mtConfirmation,mbYesNo,0) = mryes then
begin
Branche := Form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger;
Niveau := strtoint(spSkinComboBoxEx1.Text);
Form4.DS_coefficion.DataSet.First;
Form4.DS_coefficion.DataSet.First;


for j := 1 to Form4.DS_coefficion.DataSet.RecordCount do
begin
if ((Form4.DS_coefficion.DataSet.FieldByName('NBranche').AsInteger = Branche) and
(Form4.DS_coefficion.DataSet.FieldByName('Niveau').AsInteger = Niveau)) then
begin
Form4.DS_coefficion.DataSet.Delete;
end;
Form4.DS_coefficion.DataSet.Next;
end;
Form4.Ds_Appartient.DataSet.First;
for j := 1 to Form4.Ds_Appartient.DataSet.RecordCount do
begin
if ((Form4.Ds_Appartient.DataSet.FieldByName('NBranche').AsInteger = Branche) and
(Form4.Ds_Appartient.DataSet.FieldByName('Niveau').AsInteger = Niveau)) then
begin
Form4.Ds_Appartient.DataSet.Delete;
end;
Form4.Ds_Appartient.DataSet.Next;
end;
form4.DLIST_GROUPE.DataSet.First;
for j := 1 to Form4.DLIST_GROUPE.DataSet.RecordCount do
begin
if ((Form4.DLIST_GROUPE.DataSet.FieldByName('NBranche').AsInteger = Branche) and
(Form4.DLIST_GROUPE.DataSet.FieldByName('Niveau').AsInteger = Niveau)) then
begin
Form4.DLIST_GROUPE.DataSet.Delete;
end;
Form4.DLIST_GROUPE.DataSet.Next;
end;
end;
end;
procedure TForm3.Image5MouseEnter(Sender: TObject);
begin
spSkinHint1.ActivateHintEx2('Click ici pour','Suprrimmer Ce Niveau Dans Cette Branche ! ',0,spPngImageList1);
end;
procedure TForm3.Image6Click(Sender: TObject);
var i,j:integer;
begin
if spSkinMessage1.MessageDlg('Vouler vous Supprimer Cette Branche',mtConfirmation,mbYesNo,0) = mryes then
begin
i := Form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger;
Form4.DS_coefficion.DataSet.First;


for j := 1 to Form4.DS_coefficion.DataSet.RecordCount do
begin
if Form4.DS_coefficion.DataSet.FieldByName('NBranche').AsInteger = i then
begin
Form4.DS_coefficion.DataSet.Delete;
end;
Form4.DS_coefficion.DataSet.Next;
end;


Form4.Ds_Appartient.DataSet.First;
for j := 1 to Form4.Ds_Appartient.DataSet.RecordCount do
begin
if Form4.Ds_Appartient.DataSet.FieldByName('NBranche').AsInteger = i then
begin
Form4.Ds_Appartient.DataSet.Delete;
end;
Form4.Ds_Appartient.DataSet.Next;
end;
form4.DLIST_GROUPE.DataSet.First;
for j := 1 to Form4.DLIST_GROUPE.DataSet.RecordCount do
begin
if Form4.DLIST_GROUPE.DataSet.FieldByName('NBranche').AsInteger = i then
begin
Form4.DLIST_GROUPE.DataSet.Delete;
end;
Form4.DLIST_GROUPE.DataSet.Next;
end;
Form4.Ds_Liste_Braches.DataSet.Delete;
end;


end;
procedure TForm3.Image6MouseEnter(Sender: TObject);
begin
spSkinHint1.ActivateHintEx2('Click ici pour','Suprrimmer Cette Branche ! ',0,spPngImageList1);


end;
procedure TForm3.ListedeselevesEnter(Sender: TObject);
begin


form4.TestQuery.Close;
form4.TestQuery.Open;
if (spSkinComboBoxEx3.Text <> '') and (spSkinDBLookupComboBox7.Text <> '') then
begin
form4.TestQuery.Filtered := false;
form4.TestQuery.Filter := 'NTrimeste = '+QuotedStr(spSkinComboBoxEx3.Text+'*')+'and NMatiere = '+QuotedStr(inttostr(Form4.DataSource1.DataSet.FieldByName('NMatiere').AsInteger)+'*');
form4.TestQuery.Filtered := true;
end else
begin
form4.TestQuery.Filtered := false;
end;
end;
procedure TForm3.spSkinButton1Click(Sender: TObject);
var YearNext:string;
begin


if( (spSkinDBLookupComboBox1.Text <>'')and(NGroupe.Text <>'')and(Niveau.Text <>''))then
begin
if DejaInscriCetteAnne(Connection.Form4.Ds_Appartient,strtoint(NEtudiant.Text)) = false then
begin


Connection.Form4.Ds_Appartient.DataSet.Insert;
YearNext := inttostr(strtoint(FormatDateTime('yyyy',Now))+1);
Connection.Form4.Ds_Appartient.DataSet.FieldByName('Years').AsString := FormatDateTime('yyyy',Now)+'/'+YearNext;
Connection.Form4.Ds_Appartient.DataSet.FieldByName('NBranche').AsInteger := spSkinDBLookupComboBox1.KeyValue;
Connection.Form4.Ds_Appartient.DataSet.FieldByName('NEtudiant').AsInteger := StrToInt(NEtudiant.Text);
Connection.Form4.Ds_Appartient.DataSet.FieldByName('NGroupe').AsInteger := StrToInt(NGroupe.Text);
Connection.Form4.Ds_Appartient.DataSet.FieldByName('Niveau').AsInteger := strtoint(Niveau.Text);
Connection.Form4.Ds_Appartient.DataSet.Post;
Initial_Note_Pour_Etudiant(Form4.DS_coefficion,Form4.Ds_Note,spSkinDBLookupComboBox1.KeyValue,strtoint(Niveau.Text),StrToInt(NEtudiant.Text));
form4.Branche_P_Note.Active := false;
form4.Branche_P_Note.Active := true;
spSkinMessage1.MessageDlg('Etudiant Bien Inscri ! ',mtInformation,[mbok],0);


end else
begin
spSkinMessage1.MessageDlg('Etudiant deja inscrire Cette année ! ',mtInformation,[mbok],0);
end;
end else
begin
spSkinMessage1.MessageDlg('Remplis tous les case S.V.P ! ',mtInformation,mbYesNo,0);
end;
end;
procedure TForm3.spSkinButton2Click(Sender: TObject);
var i,j:integer;
YearNext:string;
begin
YearNext := inttostr(strtoint(FormatDateTime('yyyy',Now))+1);
if( (spSkinEdit2.Text <>'')and(spSkinComboBoxEx2.Text <>'')and(Nbrgroupe.Text <>''))then
begin
if(BracheExist(Connection.Form4.Ds_Liste_Braches,spSkinEdit2.Text) = true)then
begin
i := Connection.Form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger;
Connection.Form4.Ds_List_NMatiere.DataSet.First;
if(NiveauinBrancheExist(Connection.Form4.Ds_List_NMatiere,i,strtoint(spSkinComboBoxEx2.Text)))then
begin
spSkinMessage1.MessageDlg('Cette Branche dans ce niveau deja exist ! ',mtInformation,[mbok],0);
end else
begin
Connection.Form4.DS_LISTE_MATIERE.DataSet.First;
while Not Connection.Form4.DS_LISTE_MATIERE.DataSet.Eof do
begin
if Connection.Form4.DS_LISTE_MATIERE.DataSet.FieldByName('State').AsBoolean = True then
begin
Connection.Form4.DS_LISTE_MATIERE.dataset.Edit;
Connection.Form4.DS_LISTE_MATIERE.DataSet.FieldByName('State').Clear;
Connection.Form4.DS_LISTE_MATIERE.dataset.Post;
Connection.Form4.Ds_List_NMatiere.DataSet.Insert;
Connection.Form4.Ds_List_NMatiere.DataSet.FieldByName('Cofficion').AsInteger :=
Connection.Form4.DS_LISTE_MATIERE.DataSet.FieldByName('Cof').AsInteger;
Connection.Form4.Ds_List_NMatiere.DataSet.FieldByName('NBranche').AsInteger := i;
Connection.Form4.Ds_List_NMatiere.DataSet.FieldByName('NMatiere').AsInteger:=
Connection.Form4.DS_LISTE_MATIERE.DataSet.FieldByName('NMatiere').asinteger;
Connection.Form4.Ds_List_NMatiere.DataSet.FieldByName('Niveau').AsInteger := strtoint(spSkinComboBoxEx2.Text);
Connection.Form4.Ds_List_NMatiere.DataSet.Post;
end;
Connection.Form4.DS_LISTE_MATIERE.DataSet.Edit;
Connection.Form4.DS_LISTE_MATIERE.DataSet.FieldByName('Cof').Clear;
Connection.Form4.DS_LISTE_MATIERE.DataSet.Post;
Connection.Form4.DS_LISTE_MATIERE.DataSet.Next;
end;
for j := 1 to strtoint(Nbrgroupe.Text) do
begin
Connection.Form4.DLIST_GROUPE.DataSet.Insert;
Connection.Form4.DLIST_GROUPE.DataSet.FieldByName('NBranche').AsInteger := i;
Connection.Form4.DLIST_GROUPE.DataSet.FieldByName('NGroupe').AsInteger := j;
Connection.Form4.DLIST_GROUPE.DataSet.FieldByName('Niveau').AsInteger :=
strtoint(spSkinComboBoxEx2.Text);
Connection.Form4.DLIST_GROUPE.DataSet.FieldByName('Years').AsString :=
FormatDateTime('yyyy',Now)+'/'+YearNext;
Connection.Form4.DLIST_GROUPE.DataSet.post;
end;
end; // ENDIF


end else
begin
Connection.Form4.Ds_Insc_Branche.DataSet.Insert;
Connection.Form4.Ds_Insc_Branche.DataSet.FieldByName('Nom_Branche').AsString := spSkinEdit2.Text;
Connection.Form4.Ds_Insc_Branche.DataSet.Post;
Connection.Form4.Ds_Insc_Branche.DataSet.Last;
Connection.Form4.DS_LISTE_MATIERE.DataSet.First;
while Not Connection.Form4.DS_LISTE_MATIERE.DataSet.Eof do
begin
if Connection.Form4.DS_LISTE_MATIERE.DataSet.FieldByName('State').AsBoolean = True then
begin
Connection.Form4.DS_LISTE_MATIERE.dataset.Edit;
Connection.Form4.DS_LISTE_MATIERE.DataSet.FieldByName('State').Clear;
Connection.Form4.DS_LISTE_MATIERE.dataset.Post;
Connection.Form4.Ds_List_NMatiere.DataSet.Insert;
Connection.Form4.Ds_List_NMatiere.DataSet.FieldByName('Cofficion').AsInteger :=
Connection.Form4.DS_LISTE_MATIERE.DataSet.FieldByName('Cof').AsInteger;
Connection.Form4.Ds_List_NMatiere.DataSet.FieldByName('NBranche').AsInteger :=
Connection.Form4.Ds_Insc_Branche.DataSet.FieldByName('NBranche').Asinteger;
Connection.Form4.Ds_List_NMatiere.DataSet.FieldByName('NMatiere').AsInteger:=
Connection.Form4.DS_LISTE_MATIERE.DataSet.FieldByName('NMatiere').asinteger;
Connection.Form4.Ds_List_NMatiere.DataSet.FieldByName('Niveau').AsInteger := strtoint(spSkinComboBoxEx2.Text);
Connection.Form4.Ds_List_NMatiere.DataSet.Post;
end;
Connection.Form4.DS_LISTE_MATIERE.DataSet.Edit;
Connection.Form4.DS_LISTE_MATIERE.DataSet.FieldByName('Cof').Clear;
Connection.Form4.DS_LISTE_MATIERE.DataSet.Post;
Connection.Form4.DS_LISTE_MATIERE.DataSet.Next;
end;
for j := 1 to strtoint(Nbrgroupe.Text) do
begin
Connection.Form4.DLIST_GROUPE.DataSet.Insert;
Connection.Form4.DLIST_GROUPE.DataSet.FieldByName('NBranche').AsInteger :=
Connection.Form4.Ds_Insc_Branche.DataSet.FieldByName('NBranche').Asinteger;
Connection.Form4.DLIST_GROUPE.DataSet.FieldByName('NGroupe').AsInteger := j;
Connection.Form4.DLIST_GROUPE.DataSet.FieldByName('Niveau').AsInteger :=
strtoint(spSkinComboBoxEx2.Text);
Connection.Form4.DLIST_GROUPE.DataSet.FieldByName('Years').AsString :=
FormatDateTime('yyyy',Now)+'/'+YearNext;
Connection.Form4.DLIST_GROUPE.DataSet.post;
end;
end; // ENDIF
end else
begin
spSkinMessage1.MessageDlg('Remplis tous les case S.V.P ! ',mtInformation,[mbok],0);
end;
end;
procedure TForm3.spSkinButtochartClick(Sender: TObject);
begin


PAGE.ActivePage := Listedeseleves;
end;
procedure TForm3.spSkinButton4Click(Sender: TObject);
var i,j:integer;
exam,devoire1,devoir2,Moy:Double;
NGroupe,Niveau,NProf,NBranche,NMatiere:integer;
NomProf,Prenom_Prof:string;
begin
NGroupe := strtoint( spSkinDBLookupComboBox6.Text);
NBranche := Form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger;
Niveau := strtoint(spSkinDBLookupComboBox5.Text);
NMatiere := Form4.DataSource1.DataSet.FieldByName('NMatiere').AsInteger;
form4.Etudier.Filtered := false;
form4.Etudier.Filter := 'NBranche = '+QuotedStr(inttostr(NBranche)+'*')+' and NMatiere = '+QuotedStr(inttostr(NMatiere)+'*')
+' and Niveau = '+QuotedStr(inttostr(Niveau)+'*')+' and NGroupe = '+QuotedStr(inttostr(NGroupe)+'*')+
' and Years = '+QuotedStr(Yeardbcombox.Text+'*');
form4.Etudier.Filtered := true;
NProf := form4.Etudier.FieldByName('NProf').AsInteger;
form4.Etudier.Filtered := false;
form4.Professeur.Filter := 'NProf = '+QuotedStr(inttostr(NProf)+'*');
form4.Etudier.Filtered := true;
NomProf := form4.Professeur.FieldByName('Prof_Nom').AsString;
Prenom_Prof := form4.Professeur.FieldByName('Prof_Prenom').AsString;
form4.Etudier.Filtered := false;


spSkinLabel41.Caption := NomProf + ' '+ Prenom_Prof;
Form4.Ds_Branche_p_Note.DataSet.First;
AdvStringGrid1.RowCount := Form4.Ds_Branche_p_Note.DataSet.RecordCount+1;
AdvStringGrid1.RowHeaders.Insert(0,'Nom/Prenom');
for i := 1 to AdvStringGrid1.RowCount+1 do
begin
AdvStringGrid1.RowHeaders.Insert(i,Form4.Ds_Branche_p_Note.DataSet.FieldByName('Nom_Etud').AsString+
' '+Form4.Ds_Branche_p_Note.DataSet.FieldByName('Prenom_Etud').AsString);
j := 1;
devoire1 := Form4.ds_Note_etudiant.DataSet.FieldByName('Devoire1').AsFloat;
AdvStringGrid1.Cells[j,i] := FloatToStr(devoire1);
j := j+1;
devoir2 := Form4.ds_Note_etudiant.DataSet.FieldByName('Devoire2').AsFloat;
AdvStringGrid1.Cells[j,i] := FloatToStr(devoir2);
j := j+1;
exam := Form4.ds_Note_etudiant.DataSet.FieldByName('Exam').AsFloat;
AdvStringGrid1.Cells[j,i] := FloatToStr(exam);
j := j+1;
moy := ((devoire1+devoir2)+(exam*2))/4;
AdvStringGrid1.Cells[j,i] := FloatToStr(moy);


Form4.Ds_Branche_p_Note.DataSet.Next;
end;
AdvStringGrid1.RowCount := AdvStringGrid1.RowCount+1;
end;
procedure TForm3.spSkinButton5Click(Sender: TObject);
var i,j:integer;
exam,devoire1,devoir2,Moy:Double;
begin
Form4.Ds_Branche_p_Note.DataSet.First;


for i := 1 to Form4.Ds_Branche_p_Note.DataSet.RecordCount do
begin
Form4.ds_Note_etudiant.DataSet.Edit;
j := 1;
devoire1 := StrToFloat(AdvStringGrid1.Cells[j,i]);
Form4.ds_Note_etudiant.DataSet.FieldByName('Devoire1').AsFloat := devoire1;
j := j+1;
devoir2 := StrToFloat(AdvStringGrid1.Cells[j,i]);
Form4.ds_Note_etudiant.DataSet.FieldByName('Devoire2').AsFloat := devoir2;
j := j+1;
exam := StrToFloat(AdvStringGrid1.Cells[j,i]);
Form4.ds_Note_etudiant.DataSet.FieldByName('Exam').AsFloat := exam;
j := j+1;
moy := ((devoire1+devoir2)+(exam*2))/4;
AdvStringGrid1.Cells[j,i] := FloatToStr(moy);


Form4.ds_Note_etudiant.DataSet.Post;
Form4.Ds_Branche_p_Note.DataSet.Next;
end;


end;
procedure TForm3.spSkinButton6Click(Sender: TObject);
begin


AdvStringGrid1.RowCount := AdvStringGrid1.RowCount -1;
AdvStringGrid1.PrintSettings.TitleText := ' - Fiche notes de : '+spSkinDBLookupComboBox5.Text+' '+spSkinDBLookupComboBox4.Text+' '+spSkinDBLookupComboBox6.Text+' / Dans la matiere : '+spSkinDBLookupComboBox7.Text+'/ Du Trimeste N° :'+spSkinComboBoxEx3.Text
+' Avec le Professeur : '+spSkinLabel41.Caption;
AdvStringGrid1.Print;
AdvStringGrid1.RowCount := AdvStringGrid1.RowCount +1;
end;
procedure TForm3.spSkinButton7Click(Sender: TObject);
begin


AdvStringGrid2.Print;


end;
procedure TForm3.spSkinButton8Click(Sender: TObject);
begin
if (spSkinEdit3.Text='')or (spSkinEdit1.Text = '') or (spSkinComboBoxEx7.Text ='') or (spSkinMemo1.Text = '') or (spSkinEdit4.text ='') then
begin
spSkinMessage1.MessageDlg('Remplis tous les case S.V.P ! ',mtInformation,[mbOk],0);


end
else
begin


if (Not Connection.Form4.DProfesseur.DataSet.Locate('Prof_Nom',spSkinEdit3.Text,[]) )
and (Not Connection.Form4.DProfesseur.DataSet.Locate('Prof_Prenom',spSkinEdit3.Text,[])) then
begin
Connection.Form4.DProfesseur.DataSet.Insert;
Connection.Form4.DProfesseur.DataSet.FieldByName('Prof_Nom').AsString:=spSkinEdit3.Text;
Connection.Form4.DProfesseur.DataSet.FieldByName('Prof_Prenom').AsString:= spSkinEdit1.Text;
Connection.Form4.DProfesseur.DataSet.FieldByName('Email').AsString:= spSkinEdit4.Text;
Connection.Form4.DProfesseur.DataSet.FieldByName('Adresse').AsString := spSkinMemo1.Text;
Connection.Form4.DProfesseur.DataSet.FieldByName('Sexe').AsString := spSkinComboBoxEx7.Text;


Connection.Form4.DProfesseur.DataSet.post;
ShowMessage('Enregistrement avec succès !');
spSkinEdit3.Text := '';
spSkinEdit1.Text := '';
spSkinEdit4.Text := '';
spSkinMemo1.Clear;
end else
begin
spSkinMessage1.MessageDlg('Ce Prof deja exist ! ',mtInformation,[mbOk],0);
end;
end;


end;
procedure TForm3.spSkinButton9Click(Sender: TObject);
var YearNext,year:string;


begin
if (spSkinDBLookupComboBox9.Text <>'') and (spSkinDBLookupComboBox10.Text <> '')
and (spSkinDBLookupComboBox11.Text <> '') and (spSkinDBLookupComboBox12.Text <> '') then
begin
YearNext := inttostr(strtoint(FormatDateTime('yyyy',Now))+1);
year := FormatDateTime('yyyy',Now)+'/'+YearNext;
if form4.Etudier.Locate('NBranche',spSkinDBLookupComboBox9.KeyValue,[]) and
form4.Etudier.Locate('Niveau',strtoint(spSkinDBLookupComboBox10.Text),[]) and
form4.Etudier.Locate('NGroupe',strtoint(spSkinDBLookupComboBox11.Text),[]) and
form4.Etudier.Locate('NMatiere',spSkinDBLookupComboBox12.KeyValue,[]) and
form4.Etudier.Locate('Years',year,[])
then
begin
ShowMessage('Deja Etudier !');
end else
begin
form4.Etudier.Insert;
form4.Etudier.FieldByName('NBranche').Value := spSkinDBLookupComboBox9.KeyValue;
form4.Etudier.FieldByName('Niveau').AsInteger := strtoint(spSkinDBLookupComboBox10.Text);
form4.Etudier.FieldByName('NGroupe').AsInteger := strtoint(spSkinDBLookupComboBox11.Text);
form4.Etudier.FieldByName('NMatiere').Value := spSkinDBLookupComboBox12.KeyValue;
form4.Etudier.FieldByName('Years').Value := year;
form4.Etudier.FieldByName('NProf').AsInteger := Form4.DProfesseur.DataSet.FieldByName('NProf').AsInteger ;
form4.Etudier.Post;
ShowMessage('C Bon !' );
end;
end else
begin
ShowMessage('choisie tous les cases !' );
end;
end;
procedure TForm3.spSkinButtonsBar2Sections0Items0Click(Sender: TObject);
begin
PAGE.ActivePage := Ajouter_Etudiant;
end;
procedure TForm3.spSkinButtonsBar2Sections0Items0DblClick(Sender: TObject);
begin
PAGE.ActivePage := Ajouter_Etudiant;
end;


procedure TForm3.spSkinButtonsBar2Sections0Items1Click(Sender: TObject);
begin
PAGE.ActivePage := In--oo--ion;
end;
procedure TForm3.spSkinButtonsBar2Sections1Items0Click(Sender: TObject);
begin
PAGE.ActivePage := AjouteProf;
end;
procedure TForm3.spSkinButtonsBar2Sections2Items0Click(Sender: TObject);
begin
page.ActivePage := SaisieNote;
end;
procedure TForm3.spSkinButtonsBar2Sections2Items1Click(Sender: TObject);
begin
page.ActivePage := Notes_Etudiant;
end;
procedure TForm3.spSkinButtonsBar2Sections3Items0Click(Sender: TObject);
begin
page.ActivePage := GestionBraches;


end;
procedure TForm3.spSkinButtonsBar2Sections4Items0Click(Sender: TObject);
begin
page.ActivePage := State;
end;
procedure TForm3.spSkinComboBoxEx1Change(Sender: TObject);
begin
Connection.Form4.ABSQuery1.Filtered := false;
Connection.Form4.ABSQuery1.Filter := 'Niveau ='+QuotedStr(spSkinComboBoxEx1.Text+'*');
Connection.Form4.ABSQuery1.Filtered := true;
end;
procedure TForm3.spSkinComboBoxEx3Change(Sender: TObject);
begin
if (spSkinDBLookupComboBox7.Text <> '') and (spSkinComboBoxEx3.Text <> '')and (Yeardbcombox.Text <>'') then
begin
form4.Note_etudiant.Filter := 'NMatiere = '+QuotedStr(form4.DataSource1.DataSet.FieldByName('Nmatiere').AsString+'*')+
' and NTrimeste = '+QuotedStr(spSkinComboBoxEx3.Text+'*')+' and Years = '+QuotedStr(Yeardbcombox.Text+'*');
form4.Note_etudiant.Filtered := true;
end else
begin
form4.Note_etudiant.Filtered := false;
end;
end;
procedure TForm3.spSkinComboBoxEx3Click(Sender: TObject);
begin
if (spSkinDBLookupComboBox6.Text <> '')and(spSkinDBLookupComboBox5.Text <> '')and
(spSkinDBLookupComboBox4.Text <> '')and (Yeardbcombox.Text <>'')and
(spSkinDBLookupComboBox7.Text <> '') and (spSkinComboBoxEx3.Text <> '') then
begin
spSkinButton4Click(Sender);
end;
end;
procedure TForm3.spSkinComboBoxEx4Change(Sender: TObject);
begin
if (spSkinComboBoxEx4.Text <> '')and(spSkinComboBoxEx5.Text <> '') then
begin
form4.Note_Bulltin.Filter := 'NTrimeste = '+QuotedStr(spSkinComboBoxEx4.Text+'*')+' and Years = '+
QuotedStr(spSkinComboBoxEx5.Text+'*') ;
form4.Note_Bulltin.Filtered := true;
end else
begin
form4.Note_Bulltin.Filtered := false;
end;
if (spSkinComboBoxEx4.Text <> '')and(spSkinComboBoxEx5.Text <> '') and (spSkinDBLookupComboBox8.Text <> '') then
begin
GetBulltinClick(Sender);
end;


end;
procedure TForm3.spSkinComboBoxEx5Change(Sender: TObject);
begin
if (spSkinComboBoxEx4.Text <> '')and(spSkinComboBoxEx5.Text <> '') then
begin
form4.Note_Bulltin.Filter := 'NTrimeste = '+QuotedStr(spSkinComboBoxEx4.Text+'*')+' and Years = '+
QuotedStr(spSkinComboBoxEx5.Text+'*') ;
form4.Note_Bulltin.Filtered := true;
end else
begin
form4.Note_Bulltin.Filtered := false;
end;


if (spSkinComboBoxEx4.Text <> '')and(spSkinComboBoxEx5.Text <> '') and (spSkinDBLookupComboBox8.Text <> '') then
begin
GetBulltinClick(Sender);
end;


end;
procedure TForm3.spSkinDBGrid2KeyPress(Sender: TObject; var Key: Char);
begin
if spSkinDBLookupComboBox7.Text <> '' then
begin
form4.Note_etudiant.Filter := 'NMatiere = '+QuotedStr(form4.DataSource1.DataSet.FieldByName('Nmatiere').AsString+'*');
form4.Note_etudiant.Filtered := true;
end else
begin
form4.Note_etudiant.Filtered := false;
end;
end;
procedure TForm3.spSkinDBGrid3DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TspColumn; State: TGridDrawState);
var Moy:Double;
begin
if (Column.Field.AsFloat >20) or(Column.Field.AsFloat <0) then
begin
Column.Field.Clear;
end;
if Column.Field.AsFloat >= 10 then
begin
spSkinDBGrid3.Font.Color := clRed;
spSkinDBGrid3.Canvas.Brush.Color := 54423;
end else
begin
if (Column.Field.AsFloat < 10) and ( not Column.Field.IsNull) then
begin
spSkinDBGrid3.Canvas.Brush.Color := 74433;
end else
begin
spSkinDBGrid3.Canvas.Brush.Color := clGray;
end;
end;


spSkinDBGrid3.DefaultDrawColumnCell(rect,datacol,column,State);
Moy := ((Form4.ds_Note_etudiant.DataSet.FieldByName('Devoire1').AsInteger + Form4.ds_Note_etudiant.DataSet.FieldByName('Devoire2').AsInteger)
+ (Form4.ds_Note_etudiant.DataSet.FieldByName('Exam').AsInteger*2)) / 4;
spSkinLabel21.Caption := FloatToStr(moy);
end;
procedure TForm3.spSkinDBGrid3KeyPress(Sender: TObject; var Key: Char);
begin
form4.ABSQuery3.ReadOnly := true;
end;
procedure TForm3.spSkinDBLookupComboBox10Change(Sender: TObject);
begin
if (spSkinDBLookupComboBox9.Text <> '')and (spSkinDBLookupComboBox10.Text <> '') then
begin
form4.ABSQuery1.Filter := 'Niveau = '+QuotedStr(spSkinDBLookupComboBox10.Text+'*');
form4.ABSQuery1.Filtered := true;
end else
begin
form4.ABSQuery1.Filtered := false;
end;
if (spSkinDBLookupComboBox9.Text <> '')and (spSkinDBLookupComboBox10.Text <> '') then
begin
Connection.Form4.GroupePour_Filtre.Filter := 'NBranche = '+QuotedStr(inttostr(Connection.form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger)+'*')
+'and Niveau ='+QuotedStr(spSkinDBLookupComboBox10.Text+'*');
Connection.Form4.GroupePour_Filtre.Filtered := true;
end else
begin
Connection.Form4.GroupePour_Filtre.Filtered := false;
end;
end;
procedure TForm3.spSkinDBLookupComboBox10Click(Sender: TObject);
begin
Connection.Form4.GroupePour_Filtre.Filter := 'NBranche = '+
QuotedStr(inttostr(Connection.form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger)+'*');
Connection.Form4.GroupePour_Filtre.Filtered := true;
end;
procedure TForm3.spSkinDBLookupComboBox4Change(Sender: TObject);
var j :integer;
begin
if (spSkinDBLookupComboBox4.Text <> '')and (spSkinDBLookupComboBox5.Text <> '') then
begin
form4.ABSQuery1.Filter := 'Niveau = '+QuotedStr(spSkinDBLookupComboBox5.Text+'*');
form4.ABSQuery1.Filtered := true;
end else
begin
form4.ABSQuery1.Filtered := false;
end;
if spSkinDBLookupComboBox4.Text <> '' then
begin
j := Form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger;
form4.GroupePour_Filtre.Filtered := false;
form4.GroupePour_Filtre.Filter := 'NBranche = '+QuotedStr(inttostr(j)+'*');
form4.GroupePour_Filtre.Filtered := true;
end;


if (spSkinDBLookupComboBox6.Text <> '')and(spSkinDBLookupComboBox5.Text <> '')and (spSkinDBLookupComboBox4.Text <> '')and (Yeardbcombox.Text <>'') then
begin
Connection.Form4.Branche_P_Note.Filter := 'NBranche = '+QuotedStr(inttostr(Connection.form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger)+'*')
+'and Niveau ='+QuotedStr(spSkinDBLookupComboBox5.Text+'*')
+'and NGroupe ='+QuotedStr(spSkinDBLookupComboBox6.Text+'*')+' and years = '+QuotedStr(Yeardbcombox.Text+'*');
Connection.Form4.Branche_P_Note.Filtered := true;
end else
begin
Connection.Form4.Insc_Niveau.Filtered := false;
end;
// if (spSkinDBLookupComboBox6.Text <> '')and(spSkinDBLookupComboBox5.Text <> '')and (spSkinDBLookupComboBox4.Text <> '') then
// begin
//form4.ABSQuery2.Close;
//form4.ABSQuery2.SQL.Text := 'select * from Note,Etudiant,Appartient where Appartient.NBranche = '+
//inttostr(Form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger)+' and Appartient.Niveau = '+
//spSkinDBLookupComboBox5.Text+' and Appartient.NGroupe = '
//+spSkinDBLookupComboBox6.Text+' and Appartient.NEtudiant = Note.NEtudiant and Note.NMatiere = '
//+inttostr(Form4.DataSource1.DataSet.FieldByName('NMatiere').AsInteger)+' and Note.NEtudiant = Etudiant.NEtudiant ';
// form4.ABSQuery2.Open;


// end;
end;
procedure TForm3.spSkinDBLookupComboBox4Click(Sender: TObject);
begin
if (spSkinDBLookupComboBox6.Text <> '')and(spSkinDBLookupComboBox5.Text <> '')and (spSkinDBLookupComboBox4.Text <> '')and (Yeardbcombox.Text <>'') then
begin
Connection.Form4.Branche_P_Note.Filter := 'NBranche = '+QuotedStr(inttostr(Connection.form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger)+'*')
+'and Niveau ='+QuotedStr(spSkinDBLookupComboBox5.Text+'*')
+'and NGroupe ='+QuotedStr(spSkinDBLookupComboBox6.Text+'*')+' and years = '+QuotedStr(Yeardbcombox.Text+'*');
Connection.Form4.Branche_P_Note.Filtered := true;
end else
begin
Connection.Form4.Insc_Niveau.Filtered := false;
end;
end;
procedure TForm3.spSkinDBLookupComboBox5Change(Sender: TObject);
begin


if (spSkinDBLookupComboBox4.Text <> '') then
begin
Connection.Form4.GroupePour_Filtre.Filter := 'NBranche = '+QuotedStr(inttostr(Connection.form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger)+'*')
+'and Niveau ='+QuotedStr(spSkinDBLookupComboBox5.Text+'*');
Connection.Form4.GroupePour_Filtre.Filtered := true;
end else
begin
Connection.Form4.GroupePour_Filtre.Filtered := false;
end;


if (spSkinDBLookupComboBox6.Text <> '')and(spSkinDBLookupComboBox5.Text <> '')and (spSkinDBLookupComboBox4.Text <> '')and (Yeardbcombox.Text <>'') then
begin
Connection.Form4.Branche_P_Note.Filter := 'NBranche = '+QuotedStr(inttostr(Connection.form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger)+'*')
+'and Niveau ='+QuotedStr(spSkinDBLookupComboBox5.Text+'*')
+'and NGroupe ='+QuotedStr(spSkinDBLookupComboBox6.Text+'*')+' and years = '+QuotedStr(Yeardbcombox.Text+'*');
Connection.Form4.Branche_P_Note.Filtered := true;
end else
begin
Connection.Form4.Branche_P_Note.Filtered := false;
end;
if (spSkinDBLookupComboBox6.Text <> '')and(spSkinDBLookupComboBox5.Text <> '')and
(spSkinDBLookupComboBox4.Text <> '')and (Yeardbcombox.Text <>'')and
(spSkinDBLookupComboBox7.Text <> '') and (spSkinComboBoxEx3.Text <> '') then
begin
spSkinButton4Click(Sender);
end;
end;
procedure TForm3.spSkinDBLookupComboBox5Click(Sender: TObject);
var j :integer;
begin
if (spSkinDBLookupComboBox6.Text <> '')and(spSkinDBLookupComboBox5.Text <> '')and (spSkinDBLookupComboBox4.Text <> '')and (Yeardbcombox.Text <>'') then
begin
Connection.Form4.Branche_P_Note.Filter := 'NBranche = '+QuotedStr(inttostr(Connection.form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger)+'*')
+'and Niveau ='+QuotedStr(spSkinDBLookupComboBox5.Text+'*')
+'and NGroupe ='+QuotedStr(spSkinDBLookupComboBox6.Text+'*')+' and years = '+QuotedStr(Yeardbcombox.Text+'*');
Connection.Form4.Branche_P_Note.Filtered := true;
end else
begin
Connection.Form4.Insc_Niveau.Filtered := false;
end;
if (spSkinDBLookupComboBox4.Text <> '')and (spSkinDBLookupComboBox5.Text <> '') then
begin
form4.ABSQuery1.Filter := 'Niveau = '+QuotedStr(spSkinDBLookupComboBox5.Text+'*');
form4.ABSQuery1.Filtered := true;
end else
begin
form4.ABSQuery1.Filtered := false;
end;
if spSkinDBLookupComboBox4.Text <> '' then
begin
j := Form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger;
form4.GroupePour_Filtre.Filtered := false;
form4.GroupePour_Filtre.Filter := 'NBranche = '+QuotedStr(inttostr(j)+'*');
form4.GroupePour_Filtre.Filtered := true;
end;
if (spSkinDBLookupComboBox6.Text <> '')and(spSkinDBLookupComboBox5.Text <> '')and
(spSkinDBLookupComboBox4.Text <> '')and (Yeardbcombox.Text <>'')and
(spSkinDBLookupComboBox7.Text <> '') and (spSkinComboBoxEx3.Text <> '') then
begin
spSkinButton4Click(Sender);
end;


end;
procedure TForm3.spSkinDBLookupComboBox6Change(Sender: TObject);
begin


if (spSkinDBLookupComboBox6.Text <> '')and(spSkinDBLookupComboBox5.Text <> '')and (spSkinDBLookupComboBox4.Text <> '')and (Yeardbcombox.Text <>'') then
begin
Connection.Form4.Branche_P_Note.Filter := 'NBranche = '+QuotedStr(inttostr(Connection.form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger)+'*')
+'and Niveau ='+QuotedStr(spSkinDBLookupComboBox5.Text+'*')
+'and NGroupe ='+QuotedStr(spSkinDBLookupComboBox6.Text+'*')+' and years = '+QuotedStr(Yeardbcombox.Text+'*');
Connection.Form4.Branche_P_Note.Filtered := true;
end else
begin
Connection.Form4.Insc_Niveau.Filtered := false;
end;
end;
procedure TForm3.spSkinDBLookupComboBox6Click(Sender: TObject);
begin
if (spSkinDBLookupComboBox6.Text <> '')and(spSkinDBLookupComboBox5.Text <> '')and
(spSkinDBLookupComboBox4.Text <> '')and (Yeardbcombox.Text <>'')and
(spSkinDBLookupComboBox7.Text <> '') and (spSkinComboBoxEx3.Text <> '') then
begin
spSkinButton4Click(Sender);
end;
end;
procedure TForm3.spSkinDBLookupComboBox7Change(Sender: TObject);
begin
if (spSkinDBLookupComboBox7.Text <> '') and (spSkinComboBoxEx3.Text <> '')and (Yeardbcombox.Text <>'') then
begin
form4.Note_etudiant.Filter := 'NMatiere = '+QuotedStr(form4.DataSource1.DataSet.FieldByName('Nmatiere').AsString+'*')+
' and NTrimeste = '+QuotedStr(spSkinComboBoxEx3.Text+'*')+' and Years = '+QuotedStr(Yeardbcombox.Text+'*');
form4.Note_etudiant.Filtered := true;
end else
begin
form4.Note_etudiant.Filtered := false;
end;

end;
procedure TForm3.spSkinDBLookupComboBox7Click(Sender: TObject);
begin
if (spSkinDBLookupComboBox6.Text <> '')and(spSkinDBLookupComboBox5.Text <> '')and
(spSkinDBLookupComboBox4.Text <> '')and (Yeardbcombox.Text <>'')and
(spSkinDBLookupComboBox7.Text <> '') and (spSkinComboBoxEx3.Text <> '') then
begin
spSkinButton4Click(Sender);
end;
end;
procedure TForm3.spSkinDBLookupComboBox8Change(Sender: TObject);
begin
if (spSkinComboBoxEx4.Text <> '')and(spSkinComboBoxEx5.Text <> '') then
begin
form4.Note_Bulltin.Filter := 'NTrimeste = '+QuotedStr(spSkinComboBoxEx4.Text+'*')+' and Years = '+
QuotedStr(spSkinComboBoxEx5.Text+'*') ;
form4.Note_Bulltin.Filtered := true;
end else
begin
form4.Note_Bulltin.Filtered := false;
end;
if (spSkinComboBoxEx4.Text <> '')and(spSkinComboBoxEx5.Text <> '') and (spSkinDBLookupComboBox8.Text <> '') then
begin
GetBulltinClick(Sender);
end;
end;
procedure TForm3.spSkinDBLookupComboBox9Change(Sender: TObject);
var j :integer;
begin
if (spSkinDBLookupComboBox9.Text <> '')and (spSkinDBLookupComboBox10.Text <> '') then
begin
form4.ABSQuery1.Filter := 'Niveau = '+QuotedStr(spSkinDBLookupComboBox10.Text+'*');
form4.ABSQuery1.Filtered := true;
end else
begin
form4.ABSQuery1.Filtered := false;
end;


if spSkinDBLookupComboBox9.Text <> '' then
begin
j := Form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger;
form4.GroupePour_Filtre.Filtered := false;
form4.GroupePour_Filtre.Filter := 'NBranche = '+QuotedStr(inttostr(j)+'*');
form4.GroupePour_Filtre.Filtered := true;
end;



end;
procedure TForm3.NiveauChange(Sender: TObject);
begin
if Niveau.Text <> '' then
begin
Connection.Form4.Insc_Niveau.Filter := 'Niveau ='+QuotedStr(Niveau.Text+'*');
Connection.Form4.Insc_Niveau.Filtered := true;
end else
begin
Connection.Form4.Insc_Niveau.Filtered := false;
end;
if (spSkinDBLookupComboBox6.Text <> '')and(spSkinDBLookupComboBox5.Text <> '')and
(spSkinDBLookupComboBox4.Text <> '')and (Yeardbcombox.Text <>'')and
(spSkinDBLookupComboBox7.Text <> '') and (spSkinComboBoxEx3.Text <> '') then
begin
spSkinButton4Click(Sender);
end;


end;
procedure TForm3.Notes_EtudiantEnter(Sender: TObject);
var YearFirst,YearNext:string;


begin
form4.Ds_Appartient.DataSet.First;
YearFirst := '';
spSkinComboBoxEx5.ItemsEx.Clear;
while not form4.Ds_Appartient.DataSet.eof do
begin
YearNext := form4.Ds_Appartient.DataSet.FieldByName('years').AsString;
if YearFirst <> YearNext then
begin
YearFirst := form4.Ds_Appartient.DataSet.FieldByName('years').AsString;
spSkinComboBoxEx5.ItemsEx.Add.Caption := YearNext;


end;
form4.Ds_Appartient.DataSet.Next;
end;
end;
procedure TForm3.SaisieNoteEnter(Sender: TObject);
var YearFirst,YearNext:string;


begin
form4.Ds_Appartient.DataSet.First;
YearFirst := '';
Yeardbcombox.ItemsEx.Clear;
while not form4.Ds_Appartient.DataSet.eof do
begin
YearNext := form4.Ds_Appartient.DataSet.FieldByName('years').AsString;
if YearFirst <> YearNext then
begin
YearFirst := form4.Ds_Appartient.DataSet.FieldByName('years').AsString;
Yeardbcombox.ItemsEx.Add.Caption := YearNext;


end;
form4.Ds_Appartient.DataSet.Next;
end;
end;
procedure TForm3.recherChange(Sender: TObject);
begin
if BrancheNom.Checked then
begin
if BrancheNomEdit.Text <> '' then
begin
Connection.Form4.Liste_Braches.Filter := 'Nom_Branche ='+QuotedStr(BrancheNomEdit.Text+'*');
Connection.Form4.Liste_Braches.Filtered := true;


end else
begin
Connection.Form4.Liste_Braches.Filtered := false;
end;
end;
end;
procedure TForm3.spSkinEdit2Change(Sender: TObject);
begin
if(BracheExist(Connection.Form4.Ds_Liste_Braches,spSkinEdit2.Text) = true)then
begin
spSkinMessage1.MessageDlg('Cette Branche deja exist ! ',mtInformation,[mbOk],0);
end;


end;


procedure TForm3.StateContextPopup(Sender: TObject; MousePos: TPoint;
var Handled: Boolean);
begin
Chart1.Series[1].ValueMarkText[1] := 'Hello' ;
end;
procedure TForm3.StateEnter(Sender: TObject);
begin
Button1Click(Sender);
end;
procedure TForm3.StateMouseEnter(Sender: TObject);
begin
Button1Click(Sender);
end;
//procedure TForm3.spSkinListBox1ListBoxClick(Sender: TObject);
//var i:integer;
//begin
//Connection.Form4.Ds_List_NMatiere.DataSet.first;
//i:=0;
// while(i <> spSkinListBox1.ItemIndex)do
// begin
// Connection.Form4.Ds_List_NMatiere.DataSet.Next;
// i := i+1;
// end;
//end;
procedure TForm3.Timer1Timer(Sender: TObject);
begin
//GETNomMatiere(spSkinListBox1,Connection.Form4.Ds_List_NMatiere,Connection.Form4.Ds_List_NomMatiere);
//Timer1.Enabled := false;
end;
procedure TForm3.YeardbcomboxChange(Sender: TObject);
begin
if (spSkinDBLookupComboBox7.Text <> '') and (spSkinComboBoxEx3.Text <> '')and (Yeardbcombox.Text <>'') then
begin
form4.Note_etudiant.Filter := 'NMatiere = '+QuotedStr(form4.DataSource1.DataSet.FieldByName('Nmatiere').AsString+'*')+
' and NTrimeste = '+QuotedStr(spSkinComboBoxEx3.Text+'*')+' and Years = '+QuotedStr(Yeardbcombox.Text+'*');
form4.Note_etudiant.Filtered := true;
end else
begin
form4.Note_etudiant.Filtered := false;
end;


if (spSkinDBLookupComboBox6.Text <> '')and(spSkinDBLookupComboBox5.Text <> '')and (spSkinDBLookupComboBox4.Text <> '')and (Yeardbcombox.Text <>'') then
begin
Connection.Form4.Branche_P_Note.Filter := 'NBranche = '+QuotedStr(inttostr(Connection.form4.Ds_Liste_Braches.DataSet.FieldByName('NBranche').AsInteger)+'*')
+'and Niveau ='+QuotedStr(spSkinDBLookupComboBox5.Text+'*')
+'and NGroupe ='+QuotedStr(spSkinDBLookupComboBox6.Text+'*')+' and years = '+QuotedStr(Yeardbcombox.Text+'*');
Connection.Form4.Branche_P_Note.Filtered := true;
end else
begin
Connection.Form4.Insc_Niveau.Filtered := false;
end;

end;


procedure TForm3.YeardbcomboxClick(Sender: TObject);
var i:integer;
begin
if (spSkinDBLookupComboBox6.Text <> '')and(spSkinDBLookupComboBox5.Text <> '')and
(spSkinDBLookupComboBox4.Text <> '')and (Yeardbcombox.Text <>'')and
(spSkinDBLookupComboBox7.Text <> '') and (spSkinComboBoxEx3.Text <> '') then
begin
spSkinButton4Click(Sender);
for i := 1 to AdvStringGrid1.RowCount-2 do
begin
AdvStringGrid1.SelectCells(4,1,4,i);
end;
end;
end;

end.
http://i.imgur.com/zfjp6.png
-- # وصلة ممنوعة 1778 # --S
unit Fonctions;
interface
uses
Windows, Messages,math, SysUtils, Variants, Classes,DB,
ABSMain,spTrayIcon,Controls ,Dialogs,ExtCtrls,StdCtrls,forms,SkinBoxCtrls;
var
DateEtHeure : TSystemTime;
sYear : String;
procedure GETNomMatiere(List:TspSkinListBox;Nmatiere:TDataSource;NomMatiere:TDataSource);
-- # وصلة ممنوعة 1778 # -- DejaInscriCetteAnne(Tab:TDataSource;NEtudiant:Integer):Boolean;
-- # وصلة ممنوعة 1778 # -- BracheExist(Tab:TDataSource;Nom_Branche:string):Boolean;
-- # وصلة ممنوعة 1778 # -- NiveauinBrancheExist(Tab:TDataSource;NumBranche:integer;Niveau:integer):Boolean;
procedure InsertBranche(Branche:TDataSource;Cof:TDataSource;Matiere:TDataSource;Nom:string;Niveau:integer);
procedure Initial_Note_Pour_Etudiant(Cof,Note:TDataSource;NB,NIV,NE:Integer);
implementation
procedure Initial_Note_Pour_Etudiant(Cof,Note:TDataSource;NB,NIV,NE:Integer);
var
i:integer;
YearNext:string;
begin
YearNext := inttostr(strtoint(FormatDateTime('yyyy',Now))+1);
cof.DataSet.First;
while not cof.DataSet.Eof do
begin
if (cof.DataSet.FieldByName('NBranche').AsInteger = NB) and (cof.DataSet.FieldByName('Niveau').AsInteger = NIV )then
begin
for i := 1 to 3 do
begin
Note.DataSet.Insert;
Note.DataSet.FieldByName('NMatiere').AsInteger := cof.DataSet.FieldByName('NMatiere').AsInteger;
Note.DataSet.FieldByName('NEtudiant').AsInteger := NE;
Note.DataSet.FieldByName('NTrimeste').AsInteger := i;
Note.DataSet.FieldByName('Years').AsString := FormatDateTime('yyyy',Now)+'/'+YearNext;
Note.DataSet.Post;
end;
end;
cof.DataSet.Next;
end;
end;

procedure InsertBranche(Branche:TDataSource;Cof:TDataSource;Matiere:TDataSource;Nom:string;Niveau:integer);
begin
Branche.DataSet.Open;
Matiere.DataSet.Open;
cof.DataSet.Open;
Branche.DataSet.Insert;
Branche.DataSet.FieldByName('Nom_Branche').AsString := nom;
Branche.DataSet.Post;
Branche.DataSet.Last;
Matiere.DataSet.First;
while Not Matiere.DataSet.Eof do
begin
if Matiere.DataSet.FieldByName('State').AsBoolean = True then
begin
Matiere.dataset.Edit;
Matiere.DataSet.FieldByName('State').AsBoolean := false;
Matiere.dataset.Post;
cof.DataSet.Insert;
cof.DataSet.FieldByName('Cofficion').AsInteger := Matiere.DataSet.FieldByName('Cof').AsInteger;
cof.DataSet.FieldByName('NBranche').AsInteger := Branche.DataSet.FieldByName('NBranche').Asinteger;
cof.DataSet.FieldByName('NMatiere').AsInteger:= Matiere.DataSet.FieldByName('NMatiere').asinteger;
cof.DataSet.FieldByName('Niveau').AsInteger := Niveau;
cof.DataSet.Post;
end;
Matiere.DataSet.Edit;
Matiere.DataSet.FieldByName('Cof').AsInteger := 0;
Matiere.DataSet.Post;
Matiere.DataSet.Next;
end;
end;
procedure GETNomMatiere(List:TspSkinListBox;Nmatiere:TDataSource;NomMatiere:TDataSource);
var num:integer;
b:Boolean;
Nom:string;
begin
Nmatiere.DataSet.First;
List.Clear;
while(Not Nmatiere.DataSet.Eof)do
begin
num := Nmatiere.DataSet.FieldByName('NMatiere').AsInteger;
b := false;
NomMatiere.DataSet.First;
while(not NomMatiere.DataSet.Eof) and (b = false) do
begin
if(NomMatiere.DataSet.FieldByName('NMatiere').AsInteger = num)then
begin
b := true;
Nom := NomMatiere.DataSet.FieldByName('NomMatiere').AsString;
List.Items.Add(Nom);
end;
NomMatiere.DataSet.Next;
end;
Nmatiere.DataSet.Next;
end;
Nmatiere.DataSet.First;
end;

-- # وصلة ممنوعة 1778 # -- DejaInscriCetteAnne(Tab:TDataSource;NEtudiant:Integer):Boolean;
var b:Boolean;
var YearNext:string;
begin
tab.DataSet.First;
b:=false;
YearNext := inttostr(strtoint(FormatDateTime('yyyy',Now))+1);
while (not tab.DataSet.eof)and (b=false) do
begin
if((tab.DataSet.FieldByName('NEtudiant').AsInteger = NEtudiant) and (tab.DataSet.FieldByName('Years').AsString = FormatDateTime('yyyy',Now)+'/'+YearNext) )then
begin
b := true;
end else
begin
Tab.DataSet.Next;
end;
end;
Result := b;
end;
-- # وصلة ممنوعة 1778 # -- BracheExist(Tab:TDataSource;Nom_Branche:string):Boolean;
var b:Boolean;
begin
tab.DataSet.First;
b:=false;
while (not tab.DataSet.eof)and (b=false) do
begin
if((tab.DataSet.FieldByName('Nom_Branche').Asstring = Nom_Branche) )then
begin
b := true;
end else
begin
Tab.DataSet.Next;
end;
end;
Result := b;
end;

-- # وصلة ممنوعة 1778 # -- NiveauinBrancheExist(Tab:TDataSource;NumBranche:integer;Niveau:integer):Boolean;
var b:Boolean;
begin
tab.DataSet.First;
b:=false;
while (not tab.DataSet.eof)and (b=false) do
begin
if((tab.DataSet.FieldByName('NBranche').AsInteger = NumBranche)and(tab.DataSet.FieldByName('Niveau').Asinteger = Niveau) )then
begin
b := true;
end else
begin
Tab.DataSet.Next;
end;
end;
Result := b;
end;
end.
http://i.imgur.com/zfjp6.png

..

أرجو أن يكون الموضوع قد أعجبكم و تكونو قد إستمتعتم و لو بالشيئ البسيط
الى اللقاء مع موضوع آخر ..
تحياتي للجميع
أخوكم أسامة Oussaki
زخرف مواضيعك بهذه الفواصل الحلوة المميزة مجموعة خطوط عربية مبهرة 

[ضروري الدخول]
نأتي الى الختام



1 commentaires:

  1. السلام عليكم و رحمة الله تعالى و بركاته
    الله يبارك الله يوفق

    ردحذف