public List <StaffApprovalDTO> SelectStaffApproval(SelectStaffApprovalProcDTO obj) { List <StaffApprovalDTO> staf = new List <StaffApprovalDTO>(); using (DBlayer dblayer = new DBlayer()) { SqlCommand cmd = new SqlCommand("sp_SelectStaffApproval"); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@p_EventId", obj.StudentId); cmd.Parameters.AddWithValue("@p_StudentId", obj.StudentId); staf = dblayer.GetEntityList <StaffApprovalDTO>(cmd); } return(staf); }
public HttpResponseMessage SelectStaffApproval(SelectStaffApprovalProcDTO obj) { HttpResponseMessage message; try { StaffApprovalDAL dal = new StaffApprovalDAL(); var dynobj = new { result = dal.SelectStaffApproval(obj) }; message = Request.CreateResponse(HttpStatusCode.OK, dynobj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "something Wrong.Try Again!" }); } return(message); }