Search in sources :

Example 11 with CommitSuccess

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

the class UnitAction method doSave.

@Action("save")
@Verify(conf = "matrix", form = "unit")
@CommitSuccess
public void doSave(ActionHelper helper) throws HongsException {
    Map data = helper.getRequestData();
    String id = model.set(data);
    Map info = new HashMap();
    info.put("id", id);
    info.put("name", data.get("name"));
    CoreLocale lang = CoreLocale.getInstance().clone();
    lang.load("matrix");
    String ms = lang.translate("core.save.unit.success");
    helper.reply(ms, info);
}
Also used : CoreLocale(app.hongs.CoreLocale) HashMap(java.util.HashMap) Map(java.util.Map) HashMap(java.util.HashMap) Action(app.hongs.action.anno.Action) CommitSuccess(app.hongs.action.anno.CommitSuccess) Verify(app.hongs.action.anno.Verify)

Example 12 with CommitSuccess

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

the class UnitAction 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.unit.success", Integer.toString(rows));
    helper.reply(ms, rows);
}
Also used : CoreLocale(app.hongs.CoreLocale) Map(java.util.Map) HashMap(java.util.HashMap) Action(app.hongs.action.anno.Action) CommitSuccess(app.hongs.action.anno.CommitSuccess)

Example 13 with CommitSuccess

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

the class DBAction method delete.

@Action("delete")
@Preset(conf = "", form = "", deft = { ":delete" })
@CommitSuccess
@Override
public void delete(ActionHelper helper) throws HongsException {
    Model ett = getEntity(helper);
    Map req = helper.getRequestData();
    req = getReqMap(helper, ett, "delete", req);
    int num = ett.delete(req);
    String msg = getRspMsg(helper, ett, "delete", num);
    helper.reply(msg, num);
}
Also used : Map(java.util.Map) Action(app.hongs.action.anno.Action) IAction(app.hongs.dh.IAction) CommitSuccess(app.hongs.action.anno.CommitSuccess) Preset(app.hongs.action.anno.Preset)

Example 14 with CommitSuccess

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

the class JointGate method update.

@Override
@Action("update")
@Preset(conf = "", form = "", deft = { ":update" })
@Verify(conf = "", form = "")
@CommitSuccess
public void update(ActionHelper helper) throws HongsException {
    IEntity sr = getEntity(helper);
    Map rd = helper.getRequestData();
    rd = getReqMap(helper, sr, "update", rd);
    int sn = sr.update(rd);
    String ss = getRspMsg(helper, sr, "update", 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) 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