Exemplo n.º 1
0
        public ActionResult DeleteSubjectTeacher(mst_class_subject_teacher instance)
        {
            mst_class_subject_teacherMain main = new mst_class_subject_teacherMain();

            main.DeleteSubjectTeacher(instance);

            return(RedirectToAction("AllSubjectTeacher"));
        }
Exemplo n.º 2
0
            public void DeleteSubjectTeacher(mst_class_subject_teacher mst)
            {
                try
                {
                    string query = @"DELETE FROM `mst_class_subject_teacher` 
                                WHERE
                                    session = @session
                                    AND class_id = @class_id
                                    AND section_id = @section_id
                                    AND subject_id = @subject_id
                                    AND subject_teacher_id = @subject_teacher_id";

                    con.Execute(query, mst);
                }
                catch (Exception ex)
                {
                    Console.Write(ex.ToString());
                }
            }
Exemplo n.º 3
0
        public ActionResult AddSubjectTeacher(mst_class_subject_teacher mst)
        {
            try
            {
                mst_class_subject_teacherMain main = new mst_class_subject_teacherMain();

                main.AddSubjectTeacher(mst);

                return(RedirectToAction("AllSubjectTeacher"));
            }
            catch
            {
                mst_classMain mstClass = new mst_classMain();

                emp_detailMain mstFaculty = new emp_detailMain();

                mst_sessionMain sess = new mst_sessionMain();

                var class_list = mstClass.AllClassList(sess.findFinal_Session());



                var emp_list = mstFaculty.DDFacultyList();

                IEnumerable <SelectListItem> list = new SelectList(class_list, "class_id", "class_name");

                IEnumerable <SelectListItem> list2 = new SelectList(emp_list, "user_id", "user_name");


                ViewData["class_id"] = list;

                ViewData["subject_teacher_id"] = list2;

                ModelState.AddModelError(String.Empty, "Subject Already Assigned");

                return(View(mst));
            }
        }
Exemplo n.º 4
0
            public void AddSubjectTeacher(mst_class_subject_teacher mst)
            {
                try
                {
                    mst_sessionMain sess = new mst_sessionMain();



                    string query = @"INSERT INTO `mst_class_subject_teacher`
                                    (`session`,
                                    `class_id`,
                                    `section_id`,
                                    `subject_id`,
                                    `subject_teacher_id`)
                                    VALUES
                                    (@session,
                                    @class_id,
                                    @section_id,
                                    @subject_id,
                                    @subject_teacher_id)";

                    mst.session = sess.findFinal_Session();

                    con.Execute(query, new
                    {
                        mst.session,
                        mst.class_id,
                        mst.section_id,
                        mst.subject_id,
                        mst.subject_teacher_id
                    });
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }