protected void btnAddSubCourse_Click(object sender, EventArgs e)
 {
     obj          = new SubCourseMaster();
     obj.Name     = txtName.Text;
     obj.CourseID = Convert.ToInt16(ddlCourse.SelectedValue);
     //obj.IsVisible = chkVisible.Checked;
     obj.CreatedBy   = 1;
     obj.UpdatedBy   = 1;
     obj.SubCourseID = Convert.ToInt16(lblSubCourseID.Text);
     if (lblSubCourseID.Text.Equals("-1"))
     {
         obj1 = new SubCourseMasterDataManager();
         obj1.AddSubCourseDetail(obj);
         msgbox("Sub Course Added successfully!!!");
     }
     else
     {
         obj1 = new SubCourseMasterDataManager();
         obj1.UpdateSubCourseDetail(obj);
         msgbox("Sub Course updated successfully!!!");
     }
     Clear();
     BindDropdown();
     bind(ddlCourse.SelectedValue);
 }
 public void UpdateSubCourseDetail(SubCourseMaster obj)
 {
     try
     {
         SqlParameter[] parameter = new SqlParameter[]
         {
             new SqlParameter("@SubCourseID", obj.SubCourseID),
             new SqlParameter("@Name", obj.Name),
             new SqlParameter("@CourseID", obj.CourseID),
             //new SqlParameter("@IsVisible",obj.IsVisible.Equals(true)?1:0),
             new SqlParameter("@CreatedBy", obj.CreatedBy),
             new SqlParameter("@UpdatedBy", obj.UpdatedBy)
         };
         DBOperate.ExecuteProcedureWithOutReturn("usp_UpdateSubCourse", parameter);
     }
     catch
     {
         throw;
     }
 }