mouhamad2009
2013-02-10, 12:58
من سشرح لي هده بتفصيل الممل
Afficher_Article
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER procedure [dbo].[Afficher_Article] (@Num_Article nvarchar(7) ,@Num_Inventaire nvarchar(7)output,@Num_Facture nvarchar(10)output,
@Designation_Article nvarchar(50)output,@Qualite_Article nvarchar(50)output,@Division int output,@Quantite_Article int output,
@Date_Recevoir datetime output,@Nom_Centre nvarchar(50)output)
as
select
@Num_Inventaire=Num_Inventaire ,
@Num_Facture=Num_Facture,
@Designation_Article=Designation_Article ,
@Qualite_Article=Qualite_Article ,
@Division=Division ,
@Quantite_Article=Quantite_Article ,
@Date_Recevoir=Date_Recevoir
from Article
where Num_Article=@Num_Article
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
Afficher_Modifier_Bon_Commande
ALTER procedure [dbo].[Afficher_Modifier_Bon_Commande] (@Num_Bon_Commande nvarchar(7) ,@Date_Commande datetime output,@Quantite_Demande int output,
@Quantite_Accepte int output,@Num_Benificiare nvarchar(4)output,@Observation nvarchar(50)output)
as
if exists(select * from Bon_Commande where Num_Bon_Commande=@Num_Bon_Commande)
begin
select
@Date_Commande=Date_Commande ,
@Quantite_Demande=Quantite_Demande,
@Quantite_Accepte=Quantite_Accepte ,
@Observation=Observation
from Bon_Commande where Num_Bon_Commande=@Num_Bon_Commande
end
Counter_Article
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER procedure [dbo].[Counter_Article] (@Annee_article nvarchar(4),@Num_Counter nvarchar(7)output)
as
declare @Counter int
declare @Num int
set @Num=1
begin
select @counter=Count(*) from Article where Annee_article=@Annee_article
while @Counter >-1
begin
if exists (select * from Article where Num_Article =Gestion_Stock.dbo.Number(@Num)+'/'+@Annee_article)
begin
set @Num=@Num+1
set @Counter=@Counter-1
end
else
begin
set @Num_Counter=Gestion_Stock.dbo.Number(@Num)+'/'+substring(@Annee_article,3,2)
set @Counter=-1
end
end
end
Afficher_Article
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER procedure [dbo].[Afficher_Article] (@Num_Article nvarchar(7) ,@Num_Inventaire nvarchar(7)output,@Num_Facture nvarchar(10)output,
@Designation_Article nvarchar(50)output,@Qualite_Article nvarchar(50)output,@Division int output,@Quantite_Article int output,
@Date_Recevoir datetime output,@Nom_Centre nvarchar(50)output)
as
select
@Num_Inventaire=Num_Inventaire ,
@Num_Facture=Num_Facture,
@Designation_Article=Designation_Article ,
@Qualite_Article=Qualite_Article ,
@Division=Division ,
@Quantite_Article=Quantite_Article ,
@Date_Recevoir=Date_Recevoir
from Article
where Num_Article=@Num_Article
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
Afficher_Modifier_Bon_Commande
ALTER procedure [dbo].[Afficher_Modifier_Bon_Commande] (@Num_Bon_Commande nvarchar(7) ,@Date_Commande datetime output,@Quantite_Demande int output,
@Quantite_Accepte int output,@Num_Benificiare nvarchar(4)output,@Observation nvarchar(50)output)
as
if exists(select * from Bon_Commande where Num_Bon_Commande=@Num_Bon_Commande)
begin
select
@Date_Commande=Date_Commande ,
@Quantite_Demande=Quantite_Demande,
@Quantite_Accepte=Quantite_Accepte ,
@Observation=Observation
from Bon_Commande where Num_Bon_Commande=@Num_Bon_Commande
end
Counter_Article
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER procedure [dbo].[Counter_Article] (@Annee_article nvarchar(4),@Num_Counter nvarchar(7)output)
as
declare @Counter int
declare @Num int
set @Num=1
begin
select @counter=Count(*) from Article where Annee_article=@Annee_article
while @Counter >-1
begin
if exists (select * from Article where Num_Article =Gestion_Stock.dbo.Number(@Num)+'/'+@Annee_article)
begin
set @Num=@Num+1
set @Counter=@Counter-1
end
else
begin
set @Num_Counter=Gestion_Stock.dbo.Number(@Num)+'/'+substring(@Annee_article,3,2)
set @Counter=-1
end
end
end