Search in sources :

Example 1 with CommitSuccess

use of app.hongs.action.anno.CommitSuccess in project HongsCORE by ihongs.

the class DeptAction method doDelete.

@Action("delete")
@CommitSuccess
public void doDelete(ActionHelper helper) throws HongsException {
    Map rd = helper.getRequestData();
    int rn = model.delete(rd);
    CoreLocale ln = CoreLocale.getInstance().clone();
    ln.load("master");
    String ms = ln.translate("core.delete.dept.success", Integer.toString(rn));
    helper.reply(ms, rn);
}
Also used : CoreLocale(app.hongs.CoreLocale) HashMap(java.util.HashMap) NaviMap(app.hongs.action.NaviMap) Map(java.util.Map) RoleMap(app.hongs.serv.auth.RoleMap) Action(app.hongs.action.anno.Action) CommitSuccess(app.hongs.action.anno.CommitSuccess)

Example 2 with CommitSuccess

use of app.hongs.action.anno.CommitSuccess in project HongsCORE by ihongs.

the class UserAction method doSave.

@Action("save")
@Verify(conf = "master", form = "user")
@CommitSuccess
public void doSave(ActionHelper helper) throws HongsException {
    Map rd = helper.getRequestData();
    // Ignore empty password in update
    if ("".equals(rd.get("password"))) {
        rd.remove("password");
        rd.remove("passcode");
    }
    String id = model.set(rd);
    Map sd = new HashMap();
    sd.put("id", id);
    sd.put("name", rd.get("name"));
    sd.put("head", rd.get("head"));
    CoreLocale ln = CoreLocale.getInstance().clone();
    ln.load("master");
    String ms = ln.translate("core.save.user.success");
    helper.reply(ms, sd);
}
Also used : CoreLocale(app.hongs.CoreLocale) HashMap(java.util.HashMap) HashMap(java.util.HashMap) NaviMap(app.hongs.action.NaviMap) Map(java.util.Map) RoleMap(app.hongs.serv.auth.RoleMap) Action(app.hongs.action.anno.Action) CommitSuccess(app.hongs.action.anno.CommitSuccess) Verify(app.hongs.action.anno.Verify)

Example 3 with CommitSuccess

use of app.hongs.action.anno.CommitSuccess in project HongsCORE by ihongs.

the class FormAction method doDelete.

@Action("delete")
@CommitSuccess
public void doDelete(ActionHelper helper) throws HongsException {
    Map data = helper.getRequestData();
    int rows = model.delete(data);
    CoreLocale lang = CoreLocale.getInstance().clone();
    lang.load("matrix");
    String ms = lang.translate("core.delete.form.success", Integer.toString(rows));
    helper.reply(ms, rows);
}
Also used : CoreLocale(app.hongs.CoreLocale) HashMap(java.util.HashMap) Map(java.util.Map) Action(app.hongs.action.anno.Action) CommitSuccess(app.hongs.action.anno.CommitSuccess)

Example 4 with CommitSuccess

use of app.hongs.action.anno.CommitSuccess in project HongsCORE by ihongs.

the class JointGate method delete.

@Override
@Action("delete")
@Preset(conf = "", form = "", deft = { ":delete" })
@CommitSuccess
public void delete(ActionHelper helper) throws HongsException {
    IEntity sr = getEntity(helper);
    Map rd = helper.getRequestData();
    rd = getReqMap(helper, sr, "delete", rd);
    int sn = sr.delete(rd);
    String ss = getRspMsg(helper, sr, "delete", sn);
    helper.reply(ss, sn);
}
Also used : NaviMap(app.hongs.action.NaviMap) Map(java.util.Map) Action(app.hongs.action.anno.Action) CommitSuccess(app.hongs.action.anno.CommitSuccess) Preset(app.hongs.action.anno.Preset)

Example 5 with CommitSuccess

use of app.hongs.action.anno.CommitSuccess in project HongsCORE by ihongs.

the class JointGate method create.

@Override
@Action("create")
@Preset(conf = "", form = "", deft = { ":create" })
@Select(conf = "", form = "", mode = 2)
@Verify(conf = "", form = "")
@CommitSuccess
public void create(ActionHelper helper) throws HongsException {
    IEntity sr = getEntity(helper);
    Map rd = helper.getRequestData();
    rd = getReqMap(helper, sr, "create", rd);
    Map sd = sr.create(rd);
    sd = getRspMap(helper, sr, "create", sd);
    String ss = getRspMsg(helper, sr, "create", 1);
    helper.reply(ss, sd);
}
Also used : NaviMap(app.hongs.action.NaviMap) Map(java.util.Map) Action(app.hongs.action.anno.Action) CommitSuccess(app.hongs.action.anno.CommitSuccess) Preset(app.hongs.action.anno.Preset) Select(app.hongs.action.anno.Select) Verify(app.hongs.action.anno.Verify)

Aggregations

Action (app.hongs.action.anno.Action)14 CommitSuccess (app.hongs.action.anno.CommitSuccess)14 Map (java.util.Map)14 HashMap (java.util.HashMap)8 CoreLocale (app.hongs.CoreLocale)7 NaviMap (app.hongs.action.NaviMap)7 Preset (app.hongs.action.anno.Preset)6 Verify (app.hongs.action.anno.Verify)6 RoleMap (app.hongs.serv.auth.RoleMap)4 IAction (app.hongs.dh.IAction)3 Select (app.hongs.action.anno.Select)2 HongsException (app.hongs.HongsException)1 FetchCase (app.hongs.db.util.FetchCase)1 SearchAction (app.hongs.dh.search.SearchAction)1 Data (app.hongs.serv.matrix.Data)1 Set (java.util.Set)1