コード例 #1
0
        public ActionResult Index()
        {
            try
            {
                var Category = Connection.GDgetAllSchoolCategory("Y");
                List <GDgetAllSchoolCategory_Result> Categorylist = Category.ToList();

                SchoolCategoryModel tcm = new SchoolCategoryModel();

                List <SchoolCategoryModel> tcmlist = Categorylist.Select(x => new SchoolCategoryModel
                {
                    SchoolCategoryId   = x.SchoolCategoryId,
                    SchoolCategoryName = x.SchoolCategoryName,
                    CreatedBy          = x.CreatedBy,
                    CreatedDate        = x.CreatedDate,
                    IsActive           = x.IsActive,
                    ModifiedBy         = x.ModifiedBy,
                    ModifiedDate       = x.ModifiedDate
                }).ToList();



                return(View(tcmlist));
            }
            catch (Exception ex)
            {
                Errorlog.ErrorManager.LogError(ex);
                return(View());
            }
        }
コード例 #2
0
 public ActionResult Delete(int Code)
 {
     try
     {
         SchoolCategoryModel TModel = new SchoolCategoryModel();
         TModel.SchoolCategoryId = Code;
         return(PartialView("DeleteView", TModel));
     }
     catch (Exception ex)
     {
         Errorlog.ErrorManager.LogError(ex);
         return(View());
     }
 }
コード例 #3
0
        public ActionResult Delete(SchoolCategoryModel Model)
        {
            UserId = USession.User_Id;
            try
            {
                Connection.GDdeleteSchoolCategory("N", Model.SchoolCategoryId, UserId);
                Connection.SaveChanges();


                return(Json(true, JsonRequestBehavior.AllowGet));
                //return RedirectToAction("Index");
            }
            catch (Exception ex)
            {
                Errorlog.ErrorManager.LogError(ex);
                return(View());
            }
        }
コード例 #4
0
        public ActionResult Edit(SchoolCategoryModel Model)
        {
            UserId = USession.User_Id;
            try
            {
                tblSchoolCategory TCtable = Connection.tblSchoolCategories.SingleOrDefault(x => x.SchoolCategoryId == Model.SchoolCategoryId);

                Connection.GDModifySchoolCategory(Model.SchoolCategoryName, Model.SchoolCategoryId, UserId);
                Connection.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                Errorlog.ErrorManager.LogError(ex);
                return(View());
            }
        }
コード例 #5
0
        public ActionResult Edit(int Code)
        {
            try{
                SchoolCategoryModel TModel = new SchoolCategoryModel();

                tblSchoolCategory TCtable = Connection.tblSchoolCategories.SingleOrDefault(x => x.SchoolCategoryId == Code);
                TModel.IsActive = TCtable.IsActive;

                TModel.SchoolCategoryId   = TCtable.SchoolCategoryId;
                TModel.SchoolCategoryName = TCtable.SchoolCategoryName;

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