public void bindCourseDetails(int?id) { try { getCourseById_Result objcourse = new getCourseById_Result(); objcourse = course.GetCourseById(id); txtCourseName.Text = objcourse.CourseName; txtCourserFee.Text = Convert.ToString(objcourse.Fee); txtCourseDuaration.Text = Convert.ToString(objcourse.Duration); ChkActive.Checked = objcourse.Active; } catch (Exception ex) { com.Loginsert(HttpContext.Current.Request.Url.AbsolutePath, "bindCourseDetails", ex.StackTrace, ex.Message); } }
public getCourseById_Result GetCourseById(int?id) { try { getCourseById_Result objcourse = new getCourseById_Result(); using (aspccEntities db = new aspccEntities()) { objcourse = db.getCourseById(id).FirstOrDefault(); return(objcourse); } } catch (Exception ex) { return(null); } }