private void InitControlValuesForEdit(int id) { train_course_view info = context.train_course_view.Single(i => i.Id == id); Name.Text = info.Name; Name.Enabled = false; Number.Text = info.Number; Number.Enabled = false; Time.Text = info.Time.ToString(); Time.Enabled = false; Description.Text = info.Description; Description.Enabled = false; Type.Value = info.Type; Type.DataBind(); Type.Enabled = false; lessonType.DataBind(); ContentType.Value = info.ContentTypeId; ContentType.DataBind(); ContentType.Enabled = false; LinqContentType.DataBind(); Place.Text = info.Place; Place.Enabled = false; Class_time.Text = info.Class_time; Class_time.Enabled = false; start_date.Date = info.Start_date; start_date.Enabled = false; end_date.Date = info.End_date; end_date.Enabled = false; EndChooseDate.Date = info.End_choose_date; EndChooseDate.Enabled = false; Teacher.Value = info.Teacher; TeacherType.DataBind(); //TeacherType.Enabled = false; Status.Value = info.Status; Status.DataBind(); Status.Enabled = false; CourseStatus.DataBind(); Create_time.Text = info.Create_time.ToString(); Create_time.Enabled = false; }
private void InitControlValuesForEdit(int id) { train_course_view info = db1.train_course_view.Single(i => i.Id == id); if (info == null) { return; } Name.Text = info.Name; Name.Enabled = false; Number.Text = info.Number; Number.Enabled = false; Time.Text = info.Time.ToString(); Time.Enabled = false; Description.Text = info.Description; Description.Enabled = false; train_lesson_type typeinfo = db1.train_lesson_type.Single(i => i.id == info.Type); if (typeinfo == null) { return; } Type.Value = typeinfo.lesson_type_name; Type.Enabled = false; train_lesson_content_type contentinfo = db1.train_lesson_content_type.Single(i => i.ID == info.ContentTypeId); ContentType.Value = contentinfo.TypeName; ContentType.Enabled = false; Place.Text = info.Place; Place.Enabled = false; Class_time.Text = info.Class_time; Class_time.Enabled = false; start_date.Text = info.Start_date.ToString(); start_date.Enabled = false; end_date.Text = info.End_date.ToString(); end_date.Enabled = false; EndChooseDate.Text = info.End_choose_date.ToString(); EndChooseDate.Enabled = false; employeename.Value = info.employeename; employeename.Enabled = false; StatusName.Value = info.StatusName; StatusName.Enabled = false; Create_time.Text = info.Create_time.ToString(); Create_time.Enabled = false; }