public void bindLeaveInfo() { clsFaculty f=new clsFaculty(); int f_id = f.getFacultyIDbyEmail(Session["UserName"].ToString()); clsLeaveNotification ln = new clsLeaveNotification(); DataSet ds = ln.ListLeaveNotifications(f_id); gvLeaveNotification.DataSource = ds; gvLeaveNotification.DataBind(); }
protected void ckIsRejected_CheckedChanged(object sender, EventArgs e) { GridViewRow gr = (GridViewRow)((DataControlFieldCell)((CheckBox)sender).Parent).Parent; HiddenField hfLeveID = (HiddenField)gr.FindControl("hfLeaveID"); int leaveID = Convert.ToInt32(hfLeveID.Value); clsLeaveNotification clLeave = new clsLeaveNotification(); bool i = clLeave.RejectLeave(leaveID); if (i) { bindLeaveInfo(); } else { } }
public void requestLeave(clsLeaveNotification leave) { SqlParameter[] sp = new SqlParameter[7]; sp[0] = new SqlParameter("@Faculty_ID", leave.facultyID); sp[1] = new SqlParameter("@Student_ID", leave.Student_ID); sp[2] = new SqlParameter("@From_Date", leave.from_Date); sp[3] = new SqlParameter("@To_Date", leave.to_Date); sp[4] = new SqlParameter("@Comments", leave.comments); sp[5] = new SqlParameter("@IsApproved", leave.IsApproved); sp[6] = new SqlParameter("@IsRejected",leave.IsRejected); datalayer.Execute_NonQuery("sp_requestLeave", CommandType.StoredProcedure, sp); }