客户管理模块中action里的几个主要程序:
//添加新的客户
public ActionForward addClient(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
ClientForm cl = (ClientForm) form;
Clientmessage c = new Clientmessage();
//从表单中获得输入的数据
String cname=cl.getClientname();//客户姓名
String csex = cl.getSex();//性别
String ctelephone = cl.getTelephone();//电话
int cpostcode = cl.getPostcode();//邮编
String cemail = cl.getEmail();//邮箱
String crade = cl.getRade();//级别名称
String caddress = cl.getAddress();//地址
String cremark = cl.getRemark();//备注
Clientgrad cg = new Clientgrad();//创建一个客户级别对象
list = clientMImpl.findByGrad(crade);
Iterator iter = list.iterator();
while(iter.hasNext())
{
cg = (Clientgrad) iter.next();
}
c.setClientgrad(cg);
c.setName(cname);
c.setSex(csex);
c.setTelephone(ctelephone);
c.setPostcode(cpostcode);
c.setEmail(cemail);
c.setAddress(caddress);
c.setRemark(cremark);
clientMImpl.saveClient(c);//保存客户信息
return this.selectClientPages(mapping, form, request, response);
}
//修改客户信息
public ActionForward updateClient(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
ClientForm cf = (ClientForm) form;
int id = cf.getGid();//获得Id
String clientName = cf.getClientname();//获取客户名
String sex = cf.getSex();//获取性别
String telephone = cf.getTelephone();//获取电话
String email = cf.getEmail();//获取邮箱
String address = cf.getAddress();//获取地址
String remark = cf.getRemark();//获取备注
int postCode = cf.getPostcode();//获取邮编
String rade = cf.getRade();//获取级别
Clientgrad cg = new Clientgrad();
list = clientMImpl.findByGrad(rade);
Iterator iter = list.iterator();
while(iter.hasNext()){
cg = (Clientgrad) iter.next();
}
Clientmessage c = new Clientmessage();
c.setClientId(id);
c.setClientgrad(cg);
c.setName(clientName);
c.setSex(sex);
c.setTelephone(telephone);
c.setEmail(email);
c.setAddress(address);
c.setRemark(remark);
c.setPostcode(postCode);
clientMImpl.updateClient(c);
return this.selectClientPages(mapping, form, request, response);
}
//删除客户信息
public ActionForward deleteClient(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
ClientForm cf = (ClientForm) form;
int id = cf.getGid();
Clientmessage client = new Clientmessage();
client.setClientId(id);
clientMImpl.deleteClient(client);
return mapping.findForward("deleteClientSuccess");后 记
毕业设计论文已经成功的完成了,看着自己做出的成果,此时让我感到无比的轻松,同时也让我觉得非常的有成就感。在此,我不得不首先感谢我的指导老师葛菁老师,虽然我不在学校,但是她还是非常耐心的多次通过电话和电子邮箱对我的论文进行全面的审核与指导,这才使我能够有效的得以完成。同时也要感谢身边的同学,是他们给我帮助和鼓励,才使我更加有信心的去做好毕业设计。
时光如梭,大学生涯即将结束,在此,我要深深的感谢在这四年来学院给了我一个好的学习环境,感谢所有的领导和老师对我们这些学子的辛勤培育和关心。没有你们知识的传播,就没有今天的华东交大理工学子去工作岗位上创造丰功伟绩。
最后,感谢评审老师能抽出宝贵的时间来对我的论文进行审核指正,谢谢您们!
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]