Дипломная работа: Автоматизация управления распределенной структурой складов для ООО «ЕВРОПОС ГРУПП»

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
142
procedure TfrmReport.btnReport3Click(Sender: TObject);
begin
DataInfo.qReport3.Close;
DataInfo.qReport3.Open;
if DataInfo.qReport3.RecordCount=0 then
begin
MessageDlg('Отчет пустой!',mtWarning,[mbOk],0);
Exit
end;
DataInfo.qRepDoc3.Close;
DataInfo.qRepDoc3.Parameters.ParamValues['DateFrom']:=DateFrom.Date;
DataInfo.qRepDoc3.Parameters.ParamValues['DateInto']:=DateInto.Date;
DataInfo.qRepDoc3.Open;
if MessageDlg('Формируем отчет?',mtConfirmation,[mbYes,mbNo],0)=mrNo
then Exit;
DataInfo.EkRTF.InFile:=ExtractFilePath(Application.ExeName)+'Template\report3.rtf';
DataInfo.EkRTF.ClearVars;
DataInfo.EkRTF.CreateVar('DateFrom',DateToStr(DateFrom.Date));
DataInfo.EkRTF.CreateVar('DateInto',DateToStr(DateInto.Date));
DataInfo.EkRTF.OutFile:=ExtractFilePath(Application.ExeName)+'Report\report3.doc';
DataInfo.EkRTF.ExecuteOpen([DataInfo.qReport3,DataInfo.qRepDoc3],SW_Show);
end;
procedure TfrmReport.btnReport4Click(Sender: TObject);
begin
DataInfo.qReport4.Close;
DataInfo.qReport4.Open;
if DataInfo.qReport4.RecordCount=0 then
143
begin
MessageDlg('Отчет пустой!',mtWarning,[mbOk],0);
Exit
end;
DataInfo.qRepDoc4.Open;
DataInfo.qRepDoc4.Parameters.ParamValues['DateFrom']:=DateFrom.Date;
DataInfo.qRepDoc4.Parameters.ParamValues['DateInto']:=DateInto.Date;
DataInfo.qRepDoc4.Open;
if MessageDlg('Формируем отчет?',mtConfirmation,[mbYes,mbNo],0)=mrNo
then Exit;
DataInfo.EkRTF.InFile:=ExtractFilePath(Application.ExeName)+'Template\report4.rtf';
DataInfo.EkRTF.ClearVars;
DataInfo.EkRTF.CreateVar('DateFrom',DateToStr(DateFrom.Date));
DataInfo.EkRTF.CreateVar('DateInto',DateToStr(DateInto.Date));
DataInfo.EkRTF.OutFile:=ExtractFilePath(Application.ExeName)+'Report\report4.doc';
DataInfo.EkRTF.ExecuteOpen([DataInfo.qReport4,DataInfo.qRepDoc4],SW_Show);
end;
/**
* Класс (модель) для таблицы "Отдел"
*/
@Entity
@Table(name = "department")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Department.findAll", query = "SELECT d FROM
Department d")
, @NamedQuery(name = "Department.findById", query = "SELECT d FROM
Department d WHERE d.id = :id")
, @NamedQuery(name = "Department.findByTitle", query = "SELECT d FROM
Department d WHERE d.title = :title")})
public class Department implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
144
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Size(max = 255)
@Column(name = "title")
private String title;
@OneToMany(mappedBy = "idDepartment")
private Collection<DocumentRule> documentRuleCollection;
@OneToMany(mappedBy = "idDepartment")
private Collection<User> userCollection;
/**
* Конструктор класса
*/
public Department() {
}
/**
* Коснтруктор класса
*
* @param id Идентифкатор документа
*/
public Department(Integer id) {
this.id = id;
}
/**
* Возвращает идентифкатор
*
* @return Идентифкатор
*/
public Integer getId() {
return id;
}
/**
* Задает идентифкатор
*
* @param id Идентифкатор
*/
public void setId(Integer id) {
this.id = id;
}
/**
* Возвращает название отдела
*
* @return Название
145
*/
public String getTitle() {
return title;
}
/**
* Задает название отдела
*
* @param title Название
*/
public void setTitle(String title) {
this.title = title;
}
/**
* Возвращает коллекцию правил, связанных с отделом
*
* @return Коллекция правил
*/
@XmlTransient
public Collection<DocumentRule> getDocumentRuleCollection() {
return documentRuleCollection;
}
/**
* Задает коллекцию правил, связанных с отделом
*
* @param documentRuleCollection Коллекция правил
*/
public void setDocumentRuleCollection(Collection<DocumentRule>
documentRuleCollection) {
this.documentRuleCollection = documentRuleCollection;
}
/**
* Возвращает коллекцию сотрудников данного отдела
*
* @return Коллекция сотрудников
*/
@XmlTransient
public Collection<User> getUserCollection() {
return userCollection;
}
/**
* Задает коллекцию сотрудников данного отдела
*
* @param userCollection Коллекция сотрудников
146
*/
public void setUserCollection(Collection<User> userCollection) {
this.userCollection = userCollection;
}
/**
* Hash-код элемента
*
* @return Hash-значение
*/
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
/**
* Метод сравнения двух объектов (проверка равенства)
*
* @param object Объект, который будет сравниваться с текущим
* @return Результат сравнения
*/
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Department)) {
return false;
}
Department other = (Department) object;
if ((this.id == null && other.id != null) || (this.id != null &&
!this.id.equals(other.id))) {
return false;
}
return true;
}
/**
* Метод вычисления названия объекта
*
* @return Название
*/
@Override
public String toString() {
return title;
}
}
Источник: https://baza.diplomsite.ru/previewfile/2334