public ActionResult Edit(SubjectCategoryModel Model)
        {
            UserId = USession.User_Id;
            try
            {
                tblSubjectCategory TCtable = Connection.tblSubjectCategories.SingleOrDefault(x => x.SubjectCategoryId == Model.SubjectCategoryId);

                Connection.GDModifySubjectCategory(Model.SubjectCategoryName, Model.SubjectCategoryId, UserId);
                Connection.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                Errorlog.ErrorManager.LogError(ex);
                return(View());
            }
        }
        public ActionResult Create(tblSubjectCategory Model)
        {
            UserId = USession.User_Id;
            try
            {
                Connection.GDsetSubjectCategory(Model.SubjectCategoryName, UserId, "Y");
                Connection.SaveChanges();

                //return View();

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                Errorlog.ErrorManager.LogError(ex);
                return(View());
            }
        }
        public ActionResult Edit(int Code)
        {
            try{
                SubjectCategoryModel TModel = new SubjectCategoryModel();

                tblSubjectCategory TCtable = Connection.tblSubjectCategories.SingleOrDefault(x => x.SubjectCategoryId == Code);
                TModel.IsActive = TCtable.IsActive;

                TModel.SubjectCategoryId   = TCtable.SubjectCategoryId;
                TModel.SubjectCategoryName = TCtable.SubjectCategoryName;

                return(PartialView("EditView", TModel));
            }
            catch (Exception ex)
            {
                Errorlog.ErrorManager.LogError(ex);
                return(View());
            }
        }