test2

/**
 * 执行添加
 * @return
 * @throws UnsupportedEncodingException 
 */
public String exAdd() throws UnsupportedEncodingException{
   String newName = new String(cashier.getName().getBytes("ISO8859-1"),"utf-8");
   cashier.setName(newName);
   cashierService.save(cashier);
   ActionContext.getContext().put("url", "/cashier_cashier.do");
   return "redirect";
}

/**
 * 查看详情页面
 * @return
 */
public String view(){
   Cashier n = cashierService.getById(cashier.getId());
   ActionContext.getContext().put("Obj", n);
   return SUCCESS;
}

/**
 * 跳转修改页面
 * @return
 */
public String update(){
   Cashier n = cashierService.getById(cashier.getId());
   ActionContext.getContext().put("Obj", n);
   return SUCCESS;
}
   
/**
 * 执行修改
 * @return
 * @throws UnsupportedEncodingException 
 */
public String exUpdate() throws UnsupportedEncodingException{
   Cashier n = cashierService.getById(cashier.getId());
   String newName = new String(cashier.getName().getBytes("ISO8859-1"),"utf-8");
   n.setName(newName);
   n.setPassWord(cashier.getPassWord());
   cashierService.update(n);
   ActionContext.getContext().put("url", "/cashier_cashier.do");
   return "redirect";
}


/**
 * 删除
 * @return
 */
public String delete(){
   cashierService.delete(cashier.getId());
   ActionContext.getContext().put("url", "/cashier_cashier.do");
   return "redirect";
}

  

posted @ 2022-05-03 11:21  leochan007  阅读(23)  评论(0)    收藏  举报