Beispiel #1
0
        public ActionResult AssertAction(InstrumentAssert instrumentassert)
        {
            ModelState.Remove("InstrumentAssertID");
            ModelState.Remove("InstrumentCode");

            if (ModelState.IsValid)
            {
                string msg = "";

                if (instrumentassert.InstrumentAssertID > 0)
                {
                    var dataset = entities.InstrumentAsserts.Where(f => f.InstrumentAssertID == instrumentassert.InstrumentAssertID).FirstOrDefault();
                    if (dataset != null)
                    {
                        Instrument instument = entities.Instruments.Where(x => x.InstrumentID == instrumentassert.InstrumentID).FirstOrDefault();
                        String     code      = "SMMS_" + instument.Name + "_00" + instrumentassert.InstrumentAssertID;
                        dataset.InstrumentCode        = code;
                        dataset.InstrumentID          = instrumentassert.InstrumentID;
                        dataset.InstrumentConditionID = instrumentassert.InstrumentConditionID;
                        msg = "Instrument Updated Successfully";
                    }
                }
                else
                {
                    Instrument instument = entities.Instruments.Where(x => x.InstrumentID == instrumentassert.InstrumentID).FirstOrDefault();
                    try
                    {
                        var    insAssert = entities.InstrumentAsserts.Max(x => x.InstrumentAssertID) + 1;
                        String code      = "SMMS_" + instument.Name + "_00" + insAssert;
                        instrumentassert.InstrumentCode = code;
                    }
                    catch
                    {
                        String code = "SMMS_" + instument.Name + "_00" + 1;
                        instrumentassert.InstrumentCode = code;
                    }

                    entities.InstrumentAsserts.Add(instrumentassert);
                    msg = "Instrument Added successfully";
                }
                entities.SaveChanges();
                return(new JsonResult
                {
                    Data = new
                    {
                        success = true,
                        action = "Assert",
                        message = msg
                    },
                    JsonRequestBehavior = JsonRequestBehavior.AllowGet
                });
            }
            ViewBag.drpInstrument          = CommonController.drpInstrument();
            ViewBag.drpInstrumentCondition = CommonController.drpInstrumentCondition();

            return(PartialView(instrumentassert));
        }
Beispiel #2
0
        public ActionResult FeeAction(int?id)
        {
            ViewBag.drpInstrument = CommonController.drpInstrument();

            if (id != 0)
            {
                FeeStructire dataset = entities.FeeStructires.Find(id);
                return(PartialView(dataset));
            }

            else
            {
                return(PartialView());
            }
        }
Beispiel #3
0
        public ActionResult NoteAction(int?id)
        {
            ViewBag.drpCourseLevel = CommonController.drpCourseLevel();
            ViewBag.drpInstrument  = CommonController.drpInstrument();
            ViewBag.drpMusic       = CommonController.drpMusic();

            if (id != 0)
            {
                MusicSheet dataset = entities.MusicSheets.Find(id);
                return(PartialView(dataset));
            }

            else
            {
                return(PartialView());
            }
        }
Beispiel #4
0
        public ActionResult AssertAction(int?id)
        {
            ViewBag.drpInstrument          = CommonController.drpInstrument();
            ViewBag.drpInstrumentCondition = CommonController.drpInstrumentCondition();


            if (id != 0)
            {
                InstrumentAssert dataset = entities.InstrumentAsserts.Find(id);
                return(PartialView(dataset));
            }

            else
            {
                return(PartialView());
            }
        }
        public ActionResult LessonAction(int?id)
        {
            ViewBag.drpCourseLevel = CommonController.drpCourseLevel();
            ViewBag.drpInstrument  = CommonController.drpInstrument();
            ViewBag.drpLessonType  = CommonController.drpLessonType();

            if (id != 0)
            {
                Lesson dataset = entities.Lessons.Find(id);
                return(PartialView(dataset));
            }

            else
            {
                return(PartialView());
            }
        }
Beispiel #6
0
        public ActionResult TutorSkillAction(int?id, int?uid)
        {
            ViewBag.drpInstrument  = CommonController.drpInstrument();
            ViewBag.drpCourseLevel = CommonController.drpCourseLevel();

            if (id != 0)
            {
                InstumentLevel dataset = entities.InstumentLevels.Find(id);
                return(PartialView(dataset));
            }

            else
            {
                InstumentLevel dataset = new InstumentLevel();
                dataset.UserID = (int)uid;
                return(PartialView(dataset));
            }
        }
        public ActionResult LessonAction(Lesson lesson)
        {
            ModelState.Remove("LessonID");

            if (ModelState.IsValid)
            {
                string msg = "";

                if (lesson.LessonID > 0)
                {
                    var dataset = entities.Lessons.Where(f => f.LessonID == lesson.LessonID).FirstOrDefault();
                    if (dataset != null)
                    {
                        dataset.Name          = lesson.Name;
                        dataset.Description   = lesson.Description;
                        dataset.CourseLevelID = lesson.CourseLevelID;
                        dataset.LessonTypeID  = lesson.LessonTypeID;
                        dataset.InstrumentID  = lesson.InstrumentID;
                        msg = "Lesson Updated Successfully";
                    }
                }
                else
                {
                    entities.Lessons.Add(lesson);
                    msg = "New Lesson Added successfully";
                }
                entities.SaveChanges();
                return(new JsonResult
                {
                    Data = new
                    {
                        success = true,
                        action = "Lesson",
                        message = msg
                    },
                    JsonRequestBehavior = JsonRequestBehavior.AllowGet
                });
            }
            ViewBag.drpCourseLevel = CommonController.drpCourseLevel();
            ViewBag.drpLessonType  = CommonController.drpLessonType();
            ViewBag.drpInstrument  = CommonController.drpInstrument();
            return(PartialView(lesson));
        }
Beispiel #8
0
        public ActionResult TutorSkillAction(InstumentLevel instumentLevel)
        {
            ModelState.Remove("TutorInstumentID");

            if (ModelState.IsValid)
            {
                string msg          = "";
                string uid          = "";
                Tutor  datasetTutor = entities.Tutors.Where(f => f.UserID == instumentLevel.UserID).FirstOrDefault();
                uid = datasetTutor.TutorID.ToString();
                if (instumentLevel.InstumentLevelID > 0)
                {
                    var dataset = entities.InstumentLevels.Where(f => f.InstumentLevelID == instumentLevel.InstumentLevelID).FirstOrDefault();
                    if (dataset != null)
                    {
                        dataset.InstrumentID  = instumentLevel.InstrumentID;
                        dataset.CourseLevelID = instumentLevel.CourseLevelID;
                        dataset.UserID        = instumentLevel.UserID;
                        msg = "Instrument skill Updated Successfully";
                    }
                }
                else
                {
                    entities.InstumentLevels.Add(instumentLevel);
                    msg = "New Instrument skill Added successfully";
                }
                entities.SaveChanges();
                return(new JsonResult
                {
                    Data = new
                    {
                        success = true,
                        action = "TutorSkill?id=" + uid,
                        message = msg
                    },
                    JsonRequestBehavior = JsonRequestBehavior.AllowGet
                });
            }
            ViewBag.drpCourseLevel = CommonController.drpInstrument();
            ViewBag.drpCourseLevel = CommonController.drpCourseLevel();
            return(PartialView(instumentLevel));
        }
Beispiel #9
0
        public ActionResult FeeAction(FeeStructire feestructire)
        {
            ModelState.Remove("FeeID");

            if (ModelState.IsValid)
            {
                string msg = "";

                if (feestructire.FeeID > 0)
                {
                    var dataset = entities.FeeStructires.Where(f => f.FeeID == feestructire.FeeID).FirstOrDefault();
                    if (dataset != null)
                    {
                        dataset.StudentFee = feestructire.StudentFee;
                        dataset.OpenFee    = feestructire.OpenFee;
                        dataset.HireFee    = feestructire.HireFee;
                        msg = "Fee Structure Updated Successfully";
                    }
                }
                else
                {
                    entities.FeeStructires.Add(feestructire);
                    msg = "New Fee Structure Added successfully";
                }
                entities.SaveChanges();
                return(new JsonResult
                {
                    Data = new
                    {
                        success = true,
                        action = "Fee",
                        message = msg
                    },
                    JsonRequestBehavior = JsonRequestBehavior.AllowGet
                });
            }
            ViewBag.drpInstrument = CommonController.drpInstrument();

            return(PartialView(feestructire));
        }