コード例 #1
0
        /// <summary>
        /// 首次设置菜单
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>
        public ActionResult SetSysMenu(int id)
        {
            var entity = SMFUNCTBService.LoadEntities(m => m.FUNC_ID == id).FirstOrDefault();

            ViewData["myname"] = entity.FUNC_NAME;
            return(View(entity));
        }
コード例 #2
0
        public ActionResult Delete(FormCollection collection)
        {
            string returnValue = string.Empty;

            int[] deleteId = collection["query"].GetString().ToIntList().ToArray <int>();
            if (deleteId != null && deleteId.Length > 0)
            {
                SMLOG OperLog = new SMLOG {
                    OPERATION_TYPE = "D", FUNC_CODE = "900013", USER_ID = UserId, CLASSNAME = ClassName + strDelete
                };

                if (deleteId.Length == 1)
                {
                    int funcId = deleteId[0];
                    var entity = SMFUNCTBService.LoadEntities(f => f.FUNC_ID == funcId).FirstOrDefault();
                    if (SMFUNCTBService.DeleteEntity(entity))
                    {
                        OperLog.REMARK = "信息的Id为" + deleteId[0] + Suggestion.DeleteSucceed;

                        return(Json("OK"));
                    }
                    else
                    {
                        OperLog.REMARK = "信息的Id为" + deleteId[0] + Suggestion.DeleteSucceed;
                    }
                    SMLOGService.AddEntity(OperLog);//写入日志
                }

                #region 批量删除

                //if (OperLog.DeleteCollection(ref validationErrors, deleteId))
                //{
                //    OperLog.REMARK = "操作信息的Id:" + string.Join(",", deleteId) + Suggestion.DeleteSucceed;
                //    LogClassService.WriteServiceLog(OperLog);//写入日志

                //    return Json("OK");
                //}
                //else
                //{
                //    if (validationErrors != null && validationErrors.Count > 0)
                //    {
                //        validationErrors.All(a =>
                //        {
                //            returnValue += a.ErrorMessage;
                //            return true;
                //        });
                //    }
                //    OperLog.REMARK = "操作信息的Id:" + string.Join(",", deleteId) + Suggestion.DeleteFail + " " + returnValue;
                //    LogClassService.WriteServiceLog(OperLog);//写入日志
                //}

                #endregion
            }
            return(Json(returnValue));
        }
コード例 #3
0
        /// <summary>
        /// 查看详细
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(int id)
        {
            SMFUNCTB item = SMFUNCTBService.LoadEntities(f => f.FUNC_ID == id).FirstOrDefault();

            return(View(item));
        }