コード例 #1
0
        private LectureType createLectureType()
        {
            LectureType lt = new LectureType();

            lt.Name = txtName.Text;
            return(lt);
        }
コード例 #2
0
        private void FillField(int id)
        {
            LectureTypeModel lectureTypeModel = new LectureTypeModel();
            LectureType      lectureType      = lectureTypeModel.getLectureType(id);

            txtName.Text = lectureType.Name;
        }
コード例 #3
0
ファイル: Lecture.cs プロジェクト: imanys/Solen.Api
 protected Lecture(string title, string moduleId, LectureType lectureType, int order)
 {
     Id              = LectureNewId;
     Title           = title;
     ModuleId        = moduleId;
     LectureTypeName = lectureType.Name;
     Order           = order;
 }
コード例 #4
0
 public string InsertLectureTypes(LectureType lectureType)
 {
     try
     {
         OnlineStudyEntities db = new OnlineStudyEntities();
         db.LectureType.Add(lectureType);
         db.SaveChanges();
         return(lectureType.Name + " е упешно качена !");
     }
     catch (Exception e)
     {
         return("Error " + e);
     }
 }
コード例 #5
0
 public LectureType getLectureType(int id)
 {
     try
     {
         using (OnlineStudyEntities db = new OnlineStudyEntities())
         {
             LectureType lecture = db.LectureType.Find(id);
             return(lecture);
         }
     }catch (Exception)
     {
         return(null);
     }
 }
コード例 #6
0
 public string UpdateLectureTypes(int id, LectureType lectureType)
 {
     try
     {
         OnlineStudyEntities db = new OnlineStudyEntities();
         LectureType         lt = db.LectureType.Find(id);
         lt.Name = lectureType.Name;
         db.SaveChanges();
         return(lectureType.Name + " е успешно редактирана !");
     }
     catch (Exception e)
     {
         return("Error " + e);
     }
 }
コード例 #7
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            LectureTypeModel model = new LectureTypeModel();
            LectureType      lt    = createLectureType();

            if (!String.IsNullOrWhiteSpace(Request.QueryString["id"]))
            {
                int id = Convert.ToInt32(Request.QueryString["id"]);
                lblResult.Text = model.UpdateLectureTypes(id, lt);
            }
            else
            {
                lblResult.Text = model.InsertLectureTypes(lt);
            }
        }
コード例 #8
0
 public string DeleteLectureTypes(int id)
 {
     try
     {
         OnlineStudyEntities db         = new OnlineStudyEntities();
         LectureType         lecureType = db.LectureType.Find(id);
         db.LectureType.Attach(lecureType);
         db.LectureType.Remove(lecureType);
         db.SaveChanges();
         return(lecureType.Name + " е успешно изтрита!");
     }
     catch (Exception e)
     {
         return("Error " + e);
     }
 }
コード例 #9
0
 protected MediaLecture(string title, string moduleId, LectureType lectureType, int order) : base(title,
                                                                                                  moduleId, lectureType, order)
 {
 }
コード例 #10
0
 public Lecture(string title, LectureType lectureType)
 {
     Title            = title;
     this.LectureType = lectureType;
 }