package com.action;
import java.util.ArrayList;
import java.util.List;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.bean.yonghu;
import com.bean.yuangong;
import com.dao.yonghuDao;
import com.dao.yuangongDao;
/*
对用户功能进行维护
*/
@SuppressWarnings("serial")
public class yonghuAction extends ActionSupport {
private static final long serialVersionUID = 1L;
private yonghuDao dao=null;
private yuangongDao ygdao=null;//员工dao
private yonghu yonghu=new yonghu();////对用户进行管理bean
private List<yonghu> yonghus=new ArrayList<yonghu>();//对用户进行管理获得结果集返回list
private String key="";
private int pageNum=1;
private int pageCount=0;
public yonghu getYonghu() {
return yonghu;
}
public yuangongDao getYgdao() {
return ygdao;
}
public void setYgdao(yuangongDao ygdao) {
this.ygdao = ygdao;
}
public void setDao(yonghuDao dao) {
this.dao = dao;
}
public void setYonghu(yonghu yonghu) {
this.yonghu = yonghu;
}
public List<yonghu> getYonghus() {
return yonghus;
}
public String out()
{
ServletActionContext.getRequest().getSession().removeAttribute("yhm");
ServletActionContext.getRequest().getSession().removeAttribute("mm");
ServletActionContext.getRequest().getSession().removeAttribute("yonghu");
return "login";
}
public String execute()
{//默认用户功能 添加 暂时留空
return "";
}
public String addPage(){
//用户添加页面
try{
}catch(Exception e){
System.out.println(e.toString());
}
return "yonghuaddPage";
}
public String add()
{//对表yonghu进行添加操作
try{
dao.addyonghu(yonghu);
}catch(Exception e){
System.out.println(e.toString());
}
ServletActionContext.getRequest().setAttribute("msg", "<script>alert('添加成功');</script>");
return "yonghuadd";
}
public String login(){
String yhm=ServletActionContext.getRequest().getParameter("yhm").toString();
String pwd=ServletActionContext.getRequest().getParameter("pwd").toString();
String qx=ServletActionContext.getRequest().getParameter("qx").toString();
System.out.println("yhm="+yhm);
System.out.println("pwd=="+pwd);
System.out.println("qx=="+qx);
if(qx.equals("管理员")){
String hql="from yonghu where yhm='"+yhm+"' and mm='"+pwd+"'";
yonghu u=dao.getyonghu(hql);
if(u!=null)
{
ServletActionContext.getRequest().getSession().setAttribute("yhid", u.getYhid());
ServletActionContext.getRequest().getSession().setAttribute("yhm", yhm);
ServletActionContext.getRequest().getSession().setAttribute("mm", u.getMm());
ServletActionContext.getRequest().getSession().setAttribute("qx", "管理员");
return "index";
}
else
{
ServletActionContext.getRequest().setAttribute("msg", "<script>alert('用户名或者密码输入不正确');</script>");
return "login";
}
}else if(qx.equals("员工")){
String sql=" from yuangong where yhm='"+yhm+"' and mm='"+pwd+"'";
yuangong c=ygdao.getyuangong(sql);
if(c!=null){
ServletActionContext.getRequest().getSession().setAttribute("yhid", c.getYgid());
ServletActionContext.getRequest().getSession().setAttribute("yhm", yhm);
ServletActionContext.getRequest().getSession().setAttribute("mm", pwd);
ServletActionContext.getRequest().getSession().setAttribute("qx", "员工");
return "index";
}else{
ServletActionContext.getRequest().setAttribute("msg", "<script>alert('用户名或者密码输入不正确');</script>");
return "login";
}
}else {
return "login";
}
}
public String list()
{//对用户进行管理 对表yonghu进行查询
try{
yonghus=dao.getyonghus(" from yonghu where 1=1");
}catch(Exception e){
System.out.println(e.toString());
}
return "yonghulist";
}
public String del()
{//对用户进行删除 对表yonghu进行删除
String keyid=ServletActionContext.getRequest().getParameter("keyid").toString();
yonghu tempbean=dao.getyonghu("from yonghu where yhid="+keyid);
try{
dao.delyonghu(tempbean);
}catch(Exception e){
System.out.println(e.toString());
}
ServletActionContext.getRequest().setAttribute("msg", "<script>alert('删除成功');</script>");
return list();
}
public String modPage(){
////对用户修改页面 对表yonghu进行修改
String keyid=ServletActionContext.getRequest().getParameter("keyid").toString();
try{
yonghu=dao.getyonghu("from yonghu where yhid="+keyid);
}catch(Exception e){
System.out.println(e.toString());
}
return "yonghumodPage";
}
public String pwd(){
////对用户修改页面密码修改
String yhid=ServletActionContext.getRequest().getParameter("yhid").toString();
String mm=ServletActionContext.getRequest().getParameter("new1").toString();
String qx=ServletActionContext.getRequest().getParameter("qx").toString();
try{
if(qx.equals("管理员")){
yonghu=dao.getyonghu("from yonghu where yhid="+yhid);
yonghu.setMm(mm);
dao.modifyyonghu(yonghu);
}
if(qx.equals("员工")){
yuangong bean=new yuangong();
bean=ygdao.getyuangong("from yuangong where ygid="+yhid);
bean.setMm(mm);
ygdao.modifyyuangong(bean);
}
ServletActionContext.getRequest().setAttribute("msg", "<script>alert('密码成功');</script>");
// yonghu=dao.getyonghu("from yonghu where yhid="+keyid);
}catch(Exception e){
System.out.println(e.toString());
}
return "yonghupwd";
}
public String mod(){
////对用户进行修改操作 对表yonghu进行修改
try{
dao.modifyyonghu(yonghu);
}catch(Exception e){
System.out.println(e.toString());
}
ServletActionContext.getRequest().setAttribute("msg", "<script>alert('修改成功');</script>");//location.href='bookmanage';
return list();
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public int getPageNum() {
return pageNum;
}
public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}
public int getPageCount() {
return pageCount;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
JSPssh药品进销存管理系统 是一套完善的WEB设计系统,对理解JSP java 编程开发语言有帮助,系统采用ssh框架 MVC模式进行开发,系统具有完整的源代码和数据库,系统主要采用B/S模式开发。 应用技术:java|jsp+ mysql 开发工具:Myeclipse或Eclipse、jdk、tomcat。 #资源达人分享计划# #毕业设计# (1)用户管理模块:实现对登入用户的用户名、密码的修改功能以及对药店销售人员管理。 (2)统计查询模块:实现了库存查询、销售记录的查询、查询利润现金。 (3)销售管理模块:实现了药品销售、销售结算功能。 (4)采购管理模块:实现了药品入库、药品采购结算、药品退货报损。 (5)库存管理模块:实现了库存盘点、库存报警、药品有效期管理、制定药品采购计划。 (6)药品管理模块:实现了供货商管理、药品字典管理。 1、管理员账号:admin密码:admin 数据库配置文件applicationContext.xml 2、开发环境为TOMCAT7.0,Myeclipse8.5开发,数据库为mysql,使用java语言开发。 3、数据库名称jspypjincx.sql
资源推荐
资源详情
资源评论
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
共 301 条
- 1
- 2
- 3
- 4
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
- tangxiaolumama2024-01-03这个资源内容超赞,对我来说很有价值,很实用,感谢大佬分享~
- m0_671711332022-03-14用户下载后在一定时间内未进行评价,系统默认好评。
- m0_580390552022-11-15资源使用价值高,内容详实,给了我很多新想法,感谢大佬分享~
- m0_485785242022-06-07用户下载后在一定时间内未进行评价,系统默认好评。
- jgx19922021-11-20用户下载后在一定时间内未进行评价,系统默认好评。
![avatar](https://profile-avatar.csdnimg.cn/3c425d273e46473cb9b19a74e6896a25_qq_41221322.jpg!1)
qq_251836457
- 粉丝: 5708
- 资源: 618
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)