public ActionForward deleteApplyDetail (ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
ApplyForm applyForm = (ApplyForm) form;
int elementID = applyForm.getApplyVO().getElementId();
EmployeeVO employeeVO=getEmployeeVO(request); //得到申报用户的 person_id;
int apply_employee_id=employeeVO.getEmployeeId();
int payrollID =0; // 根据申报用户的 person_id 获取payrollID
payrollID=getPayrollID(apply_employee_id);
if ((Integer) elementID != null && payrollID!=0) {
ApplicationDelegate delegate = new ApplicationDelegate();
FndFlexContextVO tempColumnVO = delegate.getApplyTemplate(elementID,payrollID);
int selectContentid=applyForm.getSelectContentId();
List templatelist = tempColumnVO.getFndFlexColumnList();
request.setAttribute("Templatelist", templatelist);
List contentList = applyForm.getApplyVO().getInstanceContentList();
//删除指定的一行,要求ID
InstanceContentVO instancecontentvo=(InstanceContentVO)contentList.get(selectContentid);
int instance_content_id=instancecontentvo.getInstance_content_id();
int instance_control_id=instancecontentvo.getInstance_control_id();
//如数据库中有数据,也要删除
if(instance_content_id!=0 && instance_control_id!=0){
ApplicationDelegate deleteDelegate = new ApplicationDelegate();
deleteDelegate.deleteApply(instancecontentvo);
}
contentList.remove(selectContentid); //从页面列表中删除
if(contentList.size()==0){
return this.changeElementAction(mapping, form, request, response);
}
}
return forwardTemplatePage(request, mapping, payrollID, elementID);
}
HttpServletRequest request, HttpServletResponse response)
throws Exception {
ApplyForm applyForm = (ApplyForm) form;
int elementID = applyForm.getApplyVO().getElementId();
EmployeeVO employeeVO=getEmployeeVO(request); //得到申报用户的 person_id;
int apply_employee_id=employeeVO.getEmployeeId();
int payrollID =0; // 根据申报用户的 person_id 获取payrollID
payrollID=getPayrollID(apply_employee_id);
if ((Integer) elementID != null && payrollID!=0) {
ApplicationDelegate delegate = new ApplicationDelegate();
FndFlexContextVO tempColumnVO = delegate.getApplyTemplate(elementID,payrollID);
int selectContentid=applyForm.getSelectContentId();
List templatelist = tempColumnVO.getFndFlexColumnList();
request.setAttribute("Templatelist", templatelist);
List contentList = applyForm.getApplyVO().getInstanceContentList();
//删除指定的一行,要求ID
InstanceContentVO instancecontentvo=(InstanceContentVO)contentList.get(selectContentid);
int instance_content_id=instancecontentvo.getInstance_content_id();
int instance_control_id=instancecontentvo.getInstance_control_id();
//如数据库中有数据,也要删除
if(instance_content_id!=0 && instance_control_id!=0){
ApplicationDelegate deleteDelegate = new ApplicationDelegate();
deleteDelegate.deleteApply(instancecontentvo);
}
contentList.remove(selectContentid); //从页面列表中删除
if(contentList.size()==0){
return this.changeElementAction(mapping, form, request, response);
}
}
return forwardTemplatePage(request, mapping, payrollID, elementID);
}