int FFXPD = Govaze.SQLServerDAL.Factory.getCHINADADAL().d_YWZC_new_Sample_FHXPD
(int.Parse(MainAID.Text), int.Parse(ItemTreeID.SelectedValue), ObjectType.Text, getUserName());
public int d_YWZC_new_Sample_FHXPD(int MainAID, int TreeID, string Text1, string UserName)
{
int FFXPD;
int rowsAffected = 0;
SqlParameter[] parameters = new SqlParameter[]
{
new SqlParameter("@MainAID", SqlDbType.Int),
new SqlParameter("@TreeID", SqlDbType.Int),
new SqlParameter("@Text1", SqlDbType.NVarChar,1000),
new SqlParameter("@UserName", SqlDbType.VarChar,50),
new SqlParameter("@FFXPD", SqlDbType.Int)
};
parameters[0].Value = MainAID;
parameters[1].Value = TreeID;
parameters[2].Value = Text1;
parameters[3].Value = UserName;
parameters[4].Direction = ParameterDirection.Output;
SQLHelper.RunProcedure("d_YWZC_new_Sample_FHXPD", parameters, out rowsAffected);
FFXPD = parameters[4].Value != null && parameters[4].Value.ToString() != "" ? int.Parse(parameters[4].Value.ToString()) : 0;
return FFXPD;
}
ALTER PROCEDURE [dbo].[d_YWZC_new_Sample_FHXPD] --符合性判定
@MainAID INT,
@TreeID INT,
@Text1 Nvarchar(1000)=NULL,
@UserName varchar(50),
@FFXPD INT OUT
AS
begin
declare @Text107 Nvarchar(100)
SELECT @Text107=NodeName FROM tb_Tree_YWZC WHERE TreeID=@TreeID
if @Text1='力学性能' or @Text1='热物性能' or @Text1='结构分析' or @Text1='无损检测'
begin
declare @ExitText107 nvarchar(50) --已经存在的项目
select @ExitText107=Text107 from td_YWZC_Sample where MainAID=@MainAID and Text1=@Text1 and Creator=@UserName
if @ExitText107 is null or @ExitText107='' or @ExitText107=@Text107
begin
select @FFXPD=1
end
else if @ExitText107 is not null and @ExitText107<>'' and @ExitText107<>@Text107
begin
select @FFXPD=0
end
end
else if @Text1='化学分析' or @Text1='金相分析'
begin
select @FFXPD=1
end
END