Package com.ebspos.model

Examples of com.ebspos.model.Employee


    }
    return rands;
  }

  public void add() {
    Employee pojo = new Employee();
    Long id = getParaToLong(1, 0L);
    Long pid = getParaToLong(0, 0L);
//    Long orgid = getParaToLong(0, 0L);
    pojo.set("partmentid", pid);
//    pojo.set("orgid", orgid);
    if (id != 0) {
      pojo = Employee.dao.findById(id);
    }
//    setAttr(OrgSelectTarget.targetName, new OrgSelectTarget());
View Full Code Here


    setAttr(PartmentSelectTarget.targetName, new PartmentSelectTarget());
    setAttr("pojo", pojo);
    render("add.html");
  }
  public void show() {
    Employee pojo = new Employee();
    Long id = getParaToLong(0, 0L);
    pojo = Employee.dao.findById(id);
    setAttr("part",Partment.dao.findById(pojo.get("partmentid")));
//    setAttr("org",Organization.dao.findById(pojo.get("orgid")));
    setAttr("pojo", pojo);
    render("show.html");
  }
View Full Code Here

    setAttr("pojo", pojo);
    render("show.html");
  }
  public void save() {
    try {
      Employee m = getModel(Employee.class);
      if (m.getLong("id") != null) {
        m.set("upd_time",new Timestamp((new Date()).getTime()));
        m.update();
      } else {
        m.set("pwd",MD5.getMD5ofStr("123456"));
        m.set("upd_time",new Timestamp((new Date()).getTime()));
        m.save();
      }
//       Db.update("update employee e set e.orgid=(select p.orgid from partment p where p.id=e.partmentid)");
      toDwzJson(200, "保存成功!", navTabId);
    } catch (Exception e) {
      log.error("保存员工异常", e);
View Full Code Here

  @PowerBind
  public void savepwd() {
    String oldpwd = getPara("oldpwd");
    String pwd = getPara("pwd");
    Record po = getCurrentUser();
    Employee e = Employee.dao.findById(po.get("id"));
    String pwd1 = e.getStr("pwd");
    if (MD5.getMD5ofStr(oldpwd).equals(pwd1)) {
      e.set("pwd", MD5.getMD5ofStr(pwd));
      e.update();
      toDwzJson(200, "重置密码成功!密码为<br><h3><b style='color:red;'>" + pwd
          + "</b></h3><br>请牢记!");
    } else {
      toDwzJson(300, "旧密码输入错误!");
    }
View Full Code Here

TOP

Related Classes of com.ebspos.model.Employee

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.