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;
            }
        }
 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);
     }
 }
Exemple #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();
            }

        }