178587 (Разработка инвестиционного проекта ОАО "Завод по производству труб большого диаметра"), страница 14
Описание файла
Документ из архива "Разработка инвестиционного проекта ОАО "Завод по производству труб большого диаметра"", который расположен в категории "". Всё это находится в предмете "экономика" из , которые можно найти в файловом архиве . Не смотря на прямую связь этого архива с , его также можно найти и в других разделах. Архив можно найти в разделе "остальное", в предмете "экономика" в общих файлах.
Онлайн просмотр документа "178587"
Текст 14 страницы из документа "178587"
nRt:=n;
Rtkey:=false;
Form2.Close;
end;
end.
unit Formirmodul;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, StdCtrls, Menus;
type
TForm4 = class(TForm)
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
GroupBox1: TGroupBox;
Label1: TLabel;
StringGrid1: TStringGrid;
GroupBox2: TGroupBox;
StringGrid2: TStringGrid;
SaveDialog1: TSaveDialog;
OpenDialog1: TOpenDialog;
procedure FormCreate(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N6Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure N7Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
i,j,t : integer;
PlusSi,MinusSi : array[1..3,1..20] of real;
implementation
uses datamodul;
{$R *.dfm}
procedure TForm4.FormCreate(Sender: TObject);
begin
StringGrid1.ColCount:=n+1;
StringGrid2.ColCount:=n+1;
StringGrid1.Cells[0,1]:='Доходы от реализации продукции';
StringGrid1.Cells[0,2]:='Возмещение НДС по инвестиции';
StringGrid1.Cells[0,3]:='Амортизация';
StringGrid2.Cells[0,1]:='Инвестиции (включая НДС)';
StringGrid2.Cells[0,2]:='Прирост оборотных средств';
StringGrid2.Cells[0,3]:='Эксплутационные затраты';
StringGrid2.Cells[0,4]:='Налоги';
For i:=1 to n do begin
StringGrid1.Cells[i,0]:=IntToStr(i);
StringGrid2.Cells[i,0]:=IntToStr(i);
end;
end;
procedure TForm4.N5Click(Sender: TObject);
begin
if StringGrid1.Focused then StringGrid1.RowCount:=StringGrid1.RowCount+1;
if StringGrid2.Focused then StringGrid2.RowCount:=StringGrid2.RowCount+1;
end;
procedure TForm4.N6Click(Sender: TObject);
begin
if StringGrid1.Focused then StringGrid1.RowCount:=StringGrid1.RowCount-1;
if StringGrid2.Focused then StringGrid2.RowCount:=StringGrid2.RowCount-1;
end;
procedure TForm4.N3Click(Sender: TObject);
Var
Myfile : Textfile;
Date : String;
begin
If (saveDialog1.Execute) then begin
AssignFile(Myfile,Savedialog1.FileName);
Try Rewrite(myFile);
Except
Showmessage('Ошибка при чтении файла!'); Exit;
end;
Date:=IntToStr(StringGrid1.RowCount);WriteLn(MyFile,Date);
Date:=IntToStr(StringGrid2.RowCount);WriteLn(MyFile,Date);
For j:=0 to n do begin
For i:=0 to StringGrid1.RowCount-1 do begin
Date:=StringGrid1.Cells[j,i];
WriteLn(Myfile,Date);
end;
end;
For j:=0 to n do begin
For i:=0 to StringGrid2.RowCount-1 do begin
Date:=StringGrid2.Cells[j,i];
WriteLn(Myfile,Date);
end;
end;
Closefile(myFile);
end
else Begin Showmessage('Ошибка!'); Exit;end;
end;
procedure TForm4.N2Click(Sender: TObject);
Var
Myfile : Textfile;
Date : String;
begin
If (OpenDialog1.Execute) then begin
AssignFile(Myfile,Opendialog1.FileName);
Try Reset(myFile);
Except
Showmessage('Ошибка при чтении файла!'); Exit;
end;
ReadLn(MyFile,Date);StringGrid1.RowCount:=StrToInt(Date);
ReadLn(MyFile,Date);StringGrid2.RowCount:=StrToInt(Date);
For j:=0 to n do begin
For i:=0 to StringGrid1.RowCount-1 do begin
ReadLn(MyFile,Date);
StringGrid1.Cells[j,i]:=Date;
end;
end;
For j:=0 to n do begin
For i:=0 to StringGrid2.RowCount-1 do begin
ReadLn(MyFile,Date);
StringGrid2.Cells[j,i]:=Date;
end;
end;
Closefile(myFile);
end
else Begin Showmessage('Файл не найден!'); Exit;end;
end;
procedure TForm4.N7Click(Sender: TObject);
var
str,str2 : string;
k : integer;
begin
for t:=1 to n do begin
for j:=1 to 3 do begin
PlusSi[j,t]:=0;
end;
end;
for t:=1 to n do begin
for i:=1 to StringGrid1.RowCount-1 do begin
str:=StringGrid1.Cells[t,i];
if pos(';',str)<>0 then begin str2:='';k:=1;
for j:=1 to Length(str)do begin
if (str[j]<>';') then str2:=str2+str[j]
else begin
PlusSi[k,t]:=PlusSi[k,t]+StrToFloat(str2);
k:=k+1;str2:='';
end;
if j=Length(str) then PlusSi[k,t]:=PlusSi[k,t]+StrToFloat(str2);
end;
end else try
PlusSi[1,t]:=PlusSi[1,t]+StrToFloat(str);
PlusSi[2,t]:=PlusSi[2,t]+StrToFloat(str);
PlusSi[3,t]:=PlusSi[3,t]+StrToFloat(str);
except
showmessage('Ошибка при вводе значений интервалов денежных потоков!');
FocusControl(Stringgrid1);
end;
end;
for i:=1 to StringGrid2.RowCount-1 do begin
str:=StringGrid2.Cells[t,i];
if pos(';',str)<>0 then begin str2:='';k:=1;
for j:=1 to Length(str)do begin
if (str[j]<>';') then str2:=str2+str[j]
else begin
if k=1 then PlusSi[3,t]:=PlusSi[3,t]-StrToFloat(str2);
if k=2 then PlusSi[2,t]:=PlusSi[2,t]-StrToFloat(str2);
k:=k+1;str2:='';
end;
if j=Length(str) then PlusSi[1,t]:=PlusSi[1,t]-StrToFloat(str2);
end;
end else try
PlusSi[1,t]:=PlusSi[1,t]-StrToFloat(str);
PlusSi[2,t]:=PlusSi[2,t]-StrToFloat(str);
PlusSi[3,t]:=PlusSi[3,t]-StrToFloat(str);
except
showmessage('Ошибка при вводе значений интервалов денежных потоков!');
FocusControl(Stringgrid1);
end;
end;
end;
for i:=1 to n do begin
str:='';
for j:=1 to 3 do begin
str:=str+FloatToStr(PlusSi[j,i]);
if j<>3 then str:=str+';';
end;
Form1.StringGrid1.Cells[i-1,1]:=str;
end;
end;
end.
unit Risk;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, Grids, ExtCtrls, Buttons, Spin, Menus;
type
TForm8 = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
StringGrid1: TStringGrid;
StringGrid2: TStringGrid;
TabSheet2: TTabSheet;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
StringGrid3: TStringGrid;
StringGrid4: TStringGrid;
TabSheet3: TTabSheet;
Label8: TLabel;
StringGrid6: TStringGrid;
Label9: TLabel;
StringGrid7: TStringGrid;
StringGrid8: TStringGrid;
Label10: TLabel;
Panel3: TPanel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
SpinEdit1: TSpinEdit;
SpinEdit2: TSpinEdit;
Edit1: TEdit;
Edit2: TEdit;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
CheckBox1: TCheckBox;
MainMenu1: TMainMenu;
N1: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
N5: TMenuItem;
N9: TMenuItem;
CheckBox2: TCheckBox;
Label7: TLabel;
procedure SpinEdit1Change(Sender: TObject);
procedure SpinEdit2Change(Sender: TObject);
procedure Edit1Exit(Sender: TObject);
procedure Edit2Exit(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure N7Click(Sender: TObject);
procedure N4Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N9Click(Sender: TObject);
procedure CheckBox2Click(Sender: TObject);
procedure StringGrid1KeyPress(Sender: TObject; var Key: Char);
procedure StringGrid2KeyPress(Sender: TObject; var Key: Char);
procedure StringGrid3KeyPress(Sender: TObject; var Key: Char);
procedure StringGrid4KeyPress(Sender: TObject; var Key: Char);
procedure StringGrid6KeyPress(Sender: TObject; var Key: Char);
procedure StringGrid7KeyPress(Sender: TObject; var Key: Char);
procedure StringGrid8KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form8: TForm8;
Ct,At,Zt,Simd : array[1..20] of real;{критерий покрытия,соб.капитал,заемный кап.,мат.ож.ден.потоков(прогнозир.ден.потоки)}
Pfsr : real; {ср.зн.цены}
Sij,Vt : array[1..20] of real;{чист.ден.потоки,риск,}
Rt : array[1..20] of real;{кр.ликвидности}
n,i,j,f,l,ii : integer; {число ПУП,число ресурсов,}
d,NPV,NPVi,NPVj,s,sum,sum2,sum3,ENPV : real; {коэф.дисконтирования,ЧПЭ,мат.ож.NPV}
Ip : real; {первонач.кап.вложения}
Pf : array[1..20,1..20] of real; {цена на ресурс в каждый ПУП, }
Pkrit,Xf : array[1..20] of real; {Критический лимит цены,доля ресурса в портфеле ресурсов}
implementation
uses Results,Cov, PriceCov, Riskproject, normgenerator;
{$R *.dfm}
procedure TForm8.SpinEdit1Change(Sender: TObject);
begin
n:=SpinEdit1.Value;
StringGrid1.ColCount:=n; StringGrid2.ColCount:=n; StringGrid3.ColCount:=n; StringGrid4.ColCount:=n;
Stringgrid7.RowCount:=n+1; Form3.StringGrid1.ColCount:=n+1;Form3.Stringgrid1.RowCount:=n+1;
Form4.StringGrid1.ColCount:=n+1; Form4.Stringgrid1.RowCount:=n+1;
Form7.StringGrid1.ColCount:=n+3; Form7.StringGrid2.ColCount:=n+2;Form7.StringGrid3.ColCount:=n+1;
For i:=1 to n do begin
Stringgrid1.Cells[i-1,0]:=IntToStr(i); Stringgrid2.Cells[i-1,0]:=IntToStr(i);
Stringgrid3.Cells[i-1,0]:=IntToStr(i); Stringgrid4.Cells[i-1,0]:=IntToStr(i);
Form3.Stringgrid1.Cells[i,0]:=IntToStr(i);Form3.Stringgrid1.Cells[0,i]:=IntToStr(i);
Form4.Stringgrid1.Cells[i,0]:=IntToStr(i); Form4.Stringgrid1.Cells[0,i]:=IntToStr(i);
Form7.StringGrid1.Cells[i+2,0]:=IntToStr(i); Form7.StringGrid2.Cells[i+1,0]:=IntToStr(i);
Form7.StringGrid3.Cells[i,0]:=IntToStr(i); Stringgrid7.Cells[0,i]:=IntToStr(i);
end;
end;
procedure TForm8.SpinEdit2Change(Sender: TObject);
begin
f:=SpinEdit2.Value;
StringGrid6.ColCount:=f;StringGrid7.ColCount:=f+1;
StringGrid7.RowCount:=n+1; StringGrid8.ColCount:=f;
For i:=1 to f do begin
Stringgrid6.Cells[i-1,0]:=IntToStr(i);
Stringgrid7.Cells[i,0]:=IntToStr(i);
Stringgrid8.Cells[i-1,0]:=IntToStr(i);
end;
For i:=1 to n+1 do begin
StringGrid7.Cells[0,i]:=IntToStr(i);
end;
end;
procedure TForm8.Edit1Exit(Sender: TObject);
begin
try
d:=StrToFloat(Edit1.Text);
except
Showmessage('Неправельный ввод данных!');
end;
end;
procedure TForm8.Edit2Exit(Sender: TObject);
begin
try
Ip:=StrToFloat(Edit2.Text);
except
Showmessage('Неправельный ввод данных!');
end;
end;
procedure TForm8.FormCreate(Sender: TObject);
begin
n:=5;f:=5;d:=1.2;Ip:=10;
For i:=1 to 5 do begin
Stringgrid1.Cells[i-1,0]:=IntToStr(i); Stringgrid2.Cells[i-1,0]:=IntToStr(i);
Stringgrid3.Cells[i-1,0]:=IntToStr(i); Stringgrid4.Cells[i-1,0]:=IntToStr(i);
Stringgrid6.Cells[i-1,0]:=IntToStr(i); Stringgrid7.Cells[0,i]:=IntToStr(i);
StringGrid7.Cells[i,0]:=IntToStr(i); Stringgrid8.Cells[i-1,0]:=IntToStr(i);
end;
For i:=1 to 20 do begin
For j:=1 to 20 do begin
Pcovar[i,j]:=0;
Covar[i,j]:=0;
end;
end;
end;
procedure TForm8.CheckBox1Click(Sender: TObject);
begin
if checkBox1.Checked then Form4.Show;
end;
procedure TForm8.N7Click(Sender: TObject);
var
keyw: boolean;
begin
// Заполнение данных в массивы
keyw:=true;
try
For i:=0 to n-1 do begin
Zt[i+1]:=StrToFloat(StringGrid1.Cells[i,1]);
At[i+1]:=StrToFloat(StringGrid2.Cells[i,1]);
Simd[i+1]:=StrToFloat(Stringgrid3.Cells[i,1]);
Sij[i+1]:=StrToFloat(Stringgrid4.Cells[i,1]);
end;
s:=0;
For i:=1 to f do begin
Pkrit[i]:=StrToFloat(Stringgrid8.Cells[i-1,1]);
Xf[i]:= StrToFloat(Stringgrid6.Cells[i-1,1]);
s:=s+Xf[i];
end;
if s<>1 then begin
Showmessage('Общяя сумма долей ресурсов в портфеле должна быть меньше равна единице!');
keyw:=false;
PageControl1.ActivePage:=TabSheet3;
FocusControl(StringGrid6);