public static Msg<String> updateAdressLibrary(Context context, Addresslibrary al) { DSLContext create = context.getJc().getDefaultClient().getContext(); Msg<String> msg = new Msg<String>(); try { create .update(ADDRESSLIBRARY) .set(ADDRESSLIBRARY.NAME, al.getName()) .set(ADDRESSLIBRARY.PROVINCIAL, al.getProvincial()) .set(ADDRESSLIBRARY.CITY, al.getCity()) .set(ADDRESSLIBRARY.DISTRICT, al.getDistrict()) .set(ADDRESSLIBRARY.TEL, al.getTel()) .set(ADDRESSLIBRARY.ADDRESS, al.getAddress()) .set(ADDRESSLIBRARY.TYPE, al.getType()) .set(ADDRESSLIBRARY.USERID, al.getUserid()) .set(ADDRESSLIBRARY.ISDEFAULT, al.getIsdefault()) .where(ADDRESSLIBRARY.ADDRESSLIBRARYID.eq(al.getAddresslibraryid())) .execute(); } catch (Exception e) { e.printStackTrace(); msg.setResult(false); return msg; } msg.setResult(true); return msg; }
public static Msg<String> delAdressLibrary(Context context, Addresslibrary al) { DSLContext create = context.getJc().getDefaultClient().getContext(); Msg<String> msg = new Msg<String>(); try { create .update(ADDRESSLIBRARY) .set(ADDRESSLIBRARY.ISDEL, 1) .where(ADDRESSLIBRARY.ADDRESSLIBRARYID.eq(al.getAddresslibraryid())) .execute(); } catch (Exception e) { e.printStackTrace(); msg.setResult(false); return msg; } msg.setResult(true); return msg; }