20-03-2020-------------------DataBase Changes 1st
DataBase Changes
create procedure USPCheckGoodNightAppearsOrNot
(
@srno int
)
as
begin
if exists(select 1 from tbl_Attendance where user_id=@srno and cast(Coming_Time as date)=cast(getDate() as date))
begin
declare @working_per varchar(30)=''
select @working_per=user_id from tbl_Login where srno=@srno
if exists(SELECT 1 FROM tbl_ProjDetails WHERE working_per=@working_per and work_status='0'
and work_by_mark is not null)
begin
if exists(select 1 from tbl_Attendance where User_Id=@srno and
cast(Coming_Time as date)=cast(getDate() as date) and Hr_Permission='1')
begin
if exists(select 1 from tbl_Attendance where User_Id=@srno and
cast(Coming_Time as date)=cast(getDate() as date) and Hr_Permission='1' and Status='Go')
begin
select 3 as found --When Good night button press
end
else
begin
select 0 as found --When Good night button press not press
end
--This condition when an employee have pending task but approved by hr
end
else
begin
select 1 as found
--This condition when an employee have pending task but did not approved by hr
end
end
else
begin
if exists(select 1 from tbl_Attendance where User_Id=@srno and
cast(Coming_Time as date)=cast(getDate() as date) and Hr_Permission='1' and Status='Go')
begin
select 3 as found --when good night press
end
else
begin
select 0 as found --when good night not press
end
--This condition when an employee have all task completed
end
end
else
begin
select 2 as found
--This condition when an employee not say good morning
end
end
create procedure USPCheckGoodNightAppearsOrNot
(
@srno int
)
as
begin
if exists(select 1 from tbl_Attendance where user_id=@srno and cast(Coming_Time as date)=cast(getDate() as date))
begin
declare @working_per varchar(30)=''
select @working_per=user_id from tbl_Login where srno=@srno
if exists(SELECT 1 FROM tbl_ProjDetails WHERE working_per=@working_per and work_status='0'
and work_by_mark is not null)
begin
if exists(select 1 from tbl_Attendance where User_Id=@srno and
cast(Coming_Time as date)=cast(getDate() as date) and Hr_Permission='1')
begin
if exists(select 1 from tbl_Attendance where User_Id=@srno and
cast(Coming_Time as date)=cast(getDate() as date) and Hr_Permission='1' and Status='Go')
begin
select 3 as found --When Good night button press
end
else
begin
select 0 as found --When Good night button press not press
end
--This condition when an employee have pending task but approved by hr
end
else
begin
select 1 as found
--This condition when an employee have pending task but did not approved by hr
end
end
else
begin
if exists(select 1 from tbl_Attendance where User_Id=@srno and
cast(Coming_Time as date)=cast(getDate() as date) and Hr_Permission='1' and Status='Go')
begin
select 3 as found --when good night press
end
else
begin
select 0 as found --when good night not press
end
--This condition when an employee have all task completed
end
end
else
begin
select 2 as found
--This condition when an employee not say good morning
end
end
Comments
Post a Comment