Диплом: Автоматизация управления распределенной структурой складов для ООО ПСК "Владимир"

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
127
DataInfo.qRepDoc3.Open;
end;
procedure TDataInfo.qReport4AfterScroll(DataSet: TDataSet);
begin
DataInfo.qRepDoc4.Close;
DataInfo.qRepDoc4.Parameters.ParamValues['UserId']:=DataSet.FieldByName('Id')
.AsInteger;
DataInfo.qRepDoc4.Open;
end;
end.
unit Reports;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics, cxControls,
cxLookAndFeels,
cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters,
dxSkinscxPCPainter, cxPCdxBarPopupMenu, cxStyles, cxCustomData,
cxFilter,
cxData, cxDataStorage, cxEdit, cxNavigator, Data.DB, cxDBData,
cxGridLevel,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
cxClasses,
cxGridCustomView, cxGrid, cxPC, Vcl.Menus, Vcl.StdCtrls, cxButtons,
128
cxContainer, Vcl.ComCtrls, dxCore, cxDateUtils, cxDropDownEdit,
cxLabel,
cxTextEdit, cxMaskEdit, cxCalendar, dxPSGlbl, dxPSUtl, dxPSEngn,
dxPrnPg,
dxBkgnd, dxWrap, dxPrnDev, dxPSCompsProvider, dxPSFillPatterns,
dxPSEdgePatterns, dxPSPDFExportCore, dxPSPDFExport,
cxDrawTextUtils,
dxPSPrVwStd, dxPSPrVwAdv, dxPSPrVwRibbon,
dxPScxPageControlProducer,
dxPScxGridLnk, dxPScxGridLayoutViewLnk, dxPScxEditorProducers,
dxPScxExtEditorProducers, dxSkinsdxBarPainter, dxSkinsdxRibbonPainter,
dxPSCore, dxPScxCommon, cxLookupEdit, cxDBLookupEdit,
cxDBLookupComboBox,
cxCheckBox, dxPSContainerLnk;
type
TfrmReport = class(TForm)
btnClose: TcxButton;
Printer: TdxComponentPrinter;
PrinterLink1: TdxCustomContainerReportLink;
GroupBox1: TGroupBox;
DateFrom: TcxDateEdit;
cxLabel1: TcxLabel;
cxLabel2: TcxLabel;
DateInto: TcxDateEdit;
btnReport1: TcxButton;
btnReport2: TcxButton;
btnReport3: TcxButton;
btnReport4: TcxButton;
procedure btnReport1Click(Sender: TObject);
129
procedure btnCloseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure btnReport2Click(Sender: TObject);
procedure btnReport3Click(Sender: TObject);
procedure btnReport4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmReport: TfrmReport;
implementation
{$R *.dfm}
uses DataBase;
procedure TfrmReport.btnCloseClick(Sender: TObject);
begin
frmReport.Close;
end;
procedure TfrmReport.FormShow(Sender: TObject);
begin
DateFrom.Date:=Date+StrToTime('00:00');
DateInto.Date:=Date+StrToTime('23:59');
end;
130
procedure TfrmReport.btnReport1Click(Sender: TObject);
begin
DataInfo.qListMoveAssets.DisableControls;
NumFilter:=1;
DataInfo.qListMoveAssets.Filtered:=True;
DataInfo.qListMoveAssets.First;
if DataInfo.qListMoveAssets.RecordCount=0 then
begin
MessageDlg('Отчет пустой!',mtWarning,[mbOk],0);
Exit
end;
if MessageDlg('Формируем
отчет?',mtConfirmation,[mbYes,mbNo],0)=mrNo then Exit;
DataInfo.EkRTF.InFile:=ExtractFilePath(Application.ExeName)+'Template\reportrt
f';
DataInfo.EkRTF.ClearVars;
DataInfo.EkRTF.CreateVar('DateFrom',DateToStr(DateFrom.Date));
DataInfo.EkRTF.CreateVar('DateInto',DateToStr(DateInto.Date));
DataInfo.EkRTF.OutFile:=ExtractFilePath(Application.ExeName)+'Report\reportdo
c';
DataInfo.EkRTF.ExecuteOpen([DataInfo.qListMoveAssets],SW_Show);
end;
procedure TfrmReport.btnReport2Click(Sender: TObject);
begin
DataInfo.qListMoveAssets.DisableControls;
NumFilter:=2;
131
DataInfo.qListMoveAssets.Filtered:=True;
DataInfo.qListMoveAssets.First;
if DataInfo.qListMoveAssets.RecordCount=0 then
begin
MessageDlg('Отчет пустой!',mtWarning,[mbOk],0);
Exit
end;
if MessageDlg('Формируем
отчет?',mtConfirmation,[mbYes,mbNo],0)=mrNo then Exit;
DataInfo.EkRTF.InFile:=ExtractFilePath(Application.ExeName)+'Template\report2
.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\report2.
doc';
DataInfo.EkRTF.ExecuteOpen([DataInfo.qListMoveAssets],SW_Show);
end;
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;
132
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
begin
MessageDlg('Отчет пустой!',mtWarning,[mbOk],0);
Exit
end;
DataInfo.qRepDoc4.Open;
133
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)
134
@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;
}
/**
135
* Возвращает название отдела
*
* @return Название
*/
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;
136
}
/**
* Задает коллекцию сотрудников данного отдела
*
* @param userCollection Коллекция сотрудников
*/
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;
}
/**

Смотрите также:

"Автоматизация обработки заявок ООО "Проектно-Строительная Компания"
"Автоматизация процесса аттестации персонала для ООО "Нэт Бай Нэт Холдинг"
"Анализ интернет-активности конкурентов ( на примере конкурентов "Газпром нефть")
"Бухгалтерский учёт и аудит расчётов с подотчётними лицами в организации на примере ООО "ЛОЦ 10""
«Психологическое сопровождение персонала в организации на примере ООО «Крокус»
Cовершенствование деловой оценки персонала в организации (на примере ООО "Даймонд кейтеринг развитие")
IPO - инструмент финансирования деятельности организации. На примере ПАО «Нефтяная компания «Лукойл»
PR как средство продвижения организации (на примере ПАО "Тамбовский завод "Комсомолец им. Н.С. Артемова")
PR-коммуникации в сфере общественного питания (на примере кафе-кондитерской «Cream Cheese»)
SMM как средство повышения эффективности работы учреждений социокультурной сферы (на примере Малого театра)