Ejemplo n.º 1
0
  public static void dg1DataBind(DataGridAction dga) {
    String searchUserName = dga.getParam("searchUserName");

    QueryBuilder qb = new QueryBuilder("select * from ZSOrder where IsValid = 'Y' and status='10'");
    QueryBuilder totalQB =
        new QueryBuilder("select * from ZSOrder where IsValid = 'Y' and status='10'");
    if (StringUtil.isNotEmpty(searchUserName)) {
      qb.append(" and UserName like ? ", "%" + searchUserName + "%");
      totalQB.append(" and UserName like ? ", "%" + searchUserName + "%");
    }
    dga.setTotal(totalQB);

    qb.append(" order by id desc");
    DataTable dt = qb.executePagedDataTable(dga.getPageSize(), dga.getPageIndex());
    dt.decodeColumn("IsValid", HtmlUtil.codeToMapx("Order.IsValid"));
    dt.decodeColumn("HasInvoice", HtmlUtil.codeToMapx("Order.HasInvoice"));
    dt.decodeColumn("Status", HtmlUtil.codeToMapx("Order.Status"));
    DataTable dc =
        new QueryBuilder("select Name,Code from zddistrict Order by Code").executeDataTable();
    Mapx map = dc.toMapx("Code", "Name");
    dt.decodeColumn("Province", map);
    dt.decodeColumn("City", map);
    dt.decodeColumn("District", map);
    dga.bindData(dt);
  }
Ejemplo n.º 2
0
 public static Mapx init(Mapx params) {
   String ID = params.getString("OrderID");
   if (ID != null) {
     ZSOrderSchema order = new ZSOrderSchema();
     order.setID(ID);
     order.fill();
     params.putAll(order.toMapx());
     params.put(
         "HasInvoice", HtmlUtil.codeToMapx("Order.HasInvoice").getString(order.getHasInvoice()));
     Mapx sendTypeMap =
         new QueryBuilder("select name,id from zssend order by id")
             .executeDataTable()
             .toMapx(1, 0);
     Mapx paymentTypeMap =
         new QueryBuilder("select name,id from zspayment order by id")
             .executeDataTable()
             .toMapx(1, 0);
     params.put("SendType", sendTypeMap.getString(order.getSendType()));
     params.put("PaymentType", paymentTypeMap.getString(order.getPaymentType()));
     Mapx districtMap =
         new QueryBuilder("select code,name from zddistrict").executeDataTable().toMapx(0, 1);
     String province = params.getString("Province");
     String city = params.getString("City");
     params.put("Province", districtMap.getString(province));
     params.put("City", districtMap.getString(city));
     params.put("District", districtMap.getString(params.getString("District")));
     params.put("OrderID", ID);
     return params;
   }
   return params;
 }
Ejemplo n.º 3
0
  public static Mapx init(Mapx params) {
    String position = params.getString("Position");
    params.put("Political", HtmlUtil.mapxToOptions(Political_MAP, true));
    params.put("EduLevel", HtmlUtil.mapxToOptions(EduLevel_MAP, true));
    params.put("Gender", HtmlUtil.mapxToRadios("Gender", Gender_MAP, "M"));
    params.put("Ethnicity", HtmlUtil.codeToOptions("Ethnicity"));
    params.put("District", "");
    params.put("Position", position);

    Mapx district =
        new QueryBuilder("select code,name from zddistrict where treelevel=1")
            .executeDataTable()
            .toMapx(0, 1);
    params.put("NativePlace", HtmlUtil.mapxToOptions(district));
    return params;
  }
Ejemplo n.º 4
0
  public static Mapx init(Mapx params) {
    ZCAdminGroupSchema manageGroup = new ZCAdminGroupSchema();
    String ID = params.getString("ID");
    manageGroup.setGroupID(ID);
    manageGroup.fill();
    ZCForumGroupSchema group = new ZCForumGroupSchema();
    group.setID(manageGroup.getGroupID());
    group.fill();
    params = manageGroup.toMapx();
    params.put("Name", group.getName());
    Mapx map = new Mapx();
    map.put("Y", "允许");
    map.put("N", "不允许");
    params.put(
        "AllowEditUser",
        HtmlUtil.mapxToRadios("AllowEditUser", map, manageGroup.getAllowEditUser()));
    params.put(
        "AllowForbidUser",
        HtmlUtil.mapxToRadios("AllowForbidUser", map, manageGroup.getAllowForbidUser()));
    params.put(
        "AllowEditForum",
        HtmlUtil.mapxToRadios("AllowEditForum", map, manageGroup.getAllowEditForum()));
    params.put(
        "AllowVerfyPost",
        HtmlUtil.mapxToRadios("AllowVerfyPost", map, manageGroup.getAllowVerfyPost()));
    params.put("AllowEdit", HtmlUtil.mapxToRadios("AllowEdit", map, manageGroup.getAllowEdit()));
    params.put("AllowDel", HtmlUtil.mapxToRadios("AllowDel", map, manageGroup.getAllowDel()));
    params.put("Hide", HtmlUtil.mapxToRadios("Hide", map, manageGroup.getHide()));

    return params;
  }
Ejemplo n.º 5
0
 public static Mapx initThemeOption(Mapx params) {
   ZCAdminGroupSchema manageGroup = new ZCAdminGroupSchema();
   manageGroup.setGroupID(params.getString("ID"));
   manageGroup.fill();
   params = manageGroup.toMapx();
   Mapx map = new Mapx();
   map.put("Y", "允许");
   map.put("N", "不允许");
   params.put(
       "RemoveTheme", HtmlUtil.mapxToRadios("RemoveTheme", map, manageGroup.getRemoveTheme()));
   params.put("MoveTheme", HtmlUtil.mapxToRadios("MoveTheme", map, manageGroup.getMoveTheme()));
   params.put("TopTheme", HtmlUtil.mapxToRadios("TopTheme", map, manageGroup.getTopTheme()));
   params.put(
       "BrightTheme", HtmlUtil.mapxToRadios("BrightTheme", map, manageGroup.getBrightTheme()));
   params.put(
       "UpOrDownTheme",
       HtmlUtil.mapxToRadios("UpOrDownTheme", map, manageGroup.getUpOrDownTheme()));
   params.put("BestTheme", HtmlUtil.mapxToRadios("BestTheme", map, manageGroup.getBestTheme()));
   return params;
 }