some changes
DataBase
alter procedure ManageLeave
(
@dateFrom datetime=null,
@dateTo datetime=null,
@srno int=0,
@lastworkingday nvarchar(max)='',
@reportingday nvarchar(max)='',
@address nvarchar(max)='',
@mobilenumber varchar(20)='',
@JobsTODoBeforeLeave nvarchar(max)='',
@ReasonforLeave nvarchar(max)='',
@approvedBy int=0,
@Actiontype varchar(50)
)
as
begin
if(@Actiontype='approvedby')
begin
select srno,name from tbl_Login where srno>1 and srno!=@srno and status=1 order by name
end
else if(@Actiontype='insert')
begin
insert into tblLeave(dateFrom,dateTo,srno,lastworkingday,reportingday,address,mobilenumber,JobsTODoBeforeLeave,
ReasonforLeave,approvedBy)values
(@dateFrom,@dateTo,@srno,@lastworkingday,@reportingday,@address,@mobilenumber,@JobsTODoBeforeLeave,@ReasonforLeave,@approvedBy)
end
end
Developer/DeveloperLeave.aspx.cs
bindApprovedBy() find this function and replace it
public void bindApprovedBy()
{
string[] col4 = { "@srno", "@Actiontype" };
object[] val4 = { Convert.ToInt32(Session["developer_srno"]),"approvedby" };
DataSet ds4 = dal.getDataSet("ManageLeave", col4, val4);
if (ds4.Tables[0].Rows.Count > 0)
{
ddlApprovedBy.DataSource = ds4.Tables[0];
ddlApprovedBy.DataTextField = "name";
ddlApprovedBy.DataValueField = "srno";
ddlApprovedBy.DataBind();
ddlApprovedBy.Items.Insert(0, new ListItem("--Select--", ""));
}
}
alter procedure ManageLeave
(
@dateFrom datetime=null,
@dateTo datetime=null,
@srno int=0,
@lastworkingday nvarchar(max)='',
@reportingday nvarchar(max)='',
@address nvarchar(max)='',
@mobilenumber varchar(20)='',
@JobsTODoBeforeLeave nvarchar(max)='',
@ReasonforLeave nvarchar(max)='',
@approvedBy int=0,
@Actiontype varchar(50)
)
as
begin
if(@Actiontype='approvedby')
begin
select srno,name from tbl_Login where srno>1 and srno!=@srno and status=1 order by name
end
else if(@Actiontype='insert')
begin
insert into tblLeave(dateFrom,dateTo,srno,lastworkingday,reportingday,address,mobilenumber,JobsTODoBeforeLeave,
ReasonforLeave,approvedBy)values
(@dateFrom,@dateTo,@srno,@lastworkingday,@reportingday,@address,@mobilenumber,@JobsTODoBeforeLeave,@ReasonforLeave,@approvedBy)
end
end
Developer/DeveloperLeave.aspx.cs
bindApprovedBy() find this function and replace it
public void bindApprovedBy()
{
string[] col4 = { "@srno", "@Actiontype" };
object[] val4 = { Convert.ToInt32(Session["developer_srno"]),"approvedby" };
DataSet ds4 = dal.getDataSet("ManageLeave", col4, val4);
if (ds4.Tables[0].Rows.Count > 0)
{
ddlApprovedBy.DataSource = ds4.Tables[0];
ddlApprovedBy.DataTextField = "name";
ddlApprovedBy.DataValueField = "srno";
ddlApprovedBy.DataBind();
ddlApprovedBy.Items.Insert(0, new ListItem("--Select--", ""));
}
}
Comments
Post a Comment