예제 #1
0
        public RoleCommandModel(RoleCommandView rc)
            : base(rc)
        {
            if (rc != null)
            {
                Command_Id = rc.Command_Id;
                IsManagerCommand = rc.IsManagerCommand;
                SourceRole_Id = rc.SourceRole_Id;
                TargetRole_Id = rc.TargetRole_Id;
                Application_Id = rc.Application_Id;
                Command_Name = rc.Command_Name;
                CommandType = rc.CommandType;
                Money = rc.Money;
				Command_Application_Id = rc.Command_Application_Id;
                ActionName = rc.ActionName;
            }
        }
예제 #2
0
 public RoleCommandViewModel(RoleCommandView roleCommandView)
     : base(roleCommandView)
 {
 }
 public JsonResult NewBackendRoleCommand()
 {
     try
     {
         RoleCommand rCmd = AddEntity<RoleCommand>(new RoleCommand { SourceRole_Id = BuiltIns.DefaultRole.Id, TargetRole_Id = BuiltIns.AllRole.Id, Command_Id = BuiltIns.DefaultBackendCommand.Id, IsManagerCommand = false, IsBuiltIn = false });
         RoleCommandView view = new RoleCommandView(rCmd, BuiltIns.DefaultBackendCommand);
         return Json(new { Success = true, Model = new RoleCommandModel(view), Message = string.Empty }, JsonRequestBehavior.AllowGet);
     }
     catch (DatabaseException exception)
     {
         return Json(new { Success = true,  Message = exception.Message }, JsonRequestBehavior.AllowGet);
     }
 }
예제 #4
0
        public RoleCommandView GetRoleCommandView(int appid, int userId, string token, int id)
        {
            try
            {
                CheckToken(appid, userId, token);
                RoleCommandView view = new RoleCommandView { Id = id };
                modelAccesser.Get<RoleCommandView>(view);
                return view.Loaded ? view : null;
            }
            catch (Exception)
            {
                throw new DatabaseException();
            }

        }