4.1
.
(Summary)1: .
: Windows 7.
(Description) .
:
1. ³ .
2. .
(Expectedresult ): .
(Observedresult): .
(Severity):
.
(Summary)2: .
: Windows 7.
(Description) .
:
1. ³ .
2. .
(Expectedresult): .
(Observedresult): .
(Severity):
(Priority):
.2.- .
IJ 5
5.1
.
.10. .
ϳ , . ϳ 1- , .11, 2- , .12. , 3, .13, "".
.11. .
.12. ³ .
.13. ³ .
.13 .
# Visual Studio 2010 " ". ᒺ- .
:
( ).
.
.
.
.
.
|
|
.
Windows Forms .
ᒺ- , (), , , ( - , , ).
: (, , ).
, , , .
1. #; . .: , 2014.-752 .
2. , . VisualC#. Net. ; . . .: +, .: , .:, .:, 2004.-960 .
3. - C# . - , , 2003.
4. .. , .. - #. . .: -, 2003.-560.
5. .. #. 2005.djvu.
6. , . C # .2000.djvu.
7. , . C #. .. 2003.djvu.
8., , . #, . 2001.djvu.
-
. . ____________________2014 .
. -39 ..
___ ________________2014 .
Ͳ
: " "
:
-
1.1 : " ".
1.2 ' : " ".
1.3 ϳ :ϳ
6.050101 ' , "- ", .
1.4 : __01___ 2014 .
1.5 : _25__ 2014 .
1.6 : " ". . . .
1.7 :
; , ; , 䳿 , 䳿, .
|
|
:
5807 - 85 , , .
19.781 - 74 - .
19.101-77 ( 1626 - 79) - , .
29.401 - 78 - . .
19.106 - 78 - .
7.1 - 84 3008 - 95 - .
1.8 䳿 :
1.
" "( 29.09.2014 .).
2.
" "..( 13.10.2014 .).
3. " . ( 3.11.200 .).
4. , " ". ( 17.11.2014 .).
5.
" ". ( 24.11.2014 .).
6. " ". ( 1.12.2014 .).
7. ( 8.12.2014 .).
8. ( 15.12.2014 .).
1.9 .
Ͳ ҳ
Form1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Drawing.Printing;
namespace recepty
{
publicpartialclassForm1: Form
{
int ci = 0, cj = 1;
int count = 0;
string[] data;
Book bookC1 = newBook();
Form2 frm2 = newForm2();
string[][] list;
PrintDocument PD = newPrintDocument();
public Form1()
{
InitializeComponent();
}
privatevoid button1_Click(object sender,EventArgs e)
{
this.panel1.Visible = true;
pictureBox8.Visible = pictureBox9.Visible = true;
panel7.Refresh();
data = bookC1.GetDataArr();
count = data.Length;
showData();
}
privatevoid showData()
{
if (ci < count && ci >= 0)
{
setDataForm(data[ci].Split('#'), 1, label1, label6, label5);
}
else
{
deleteDataForm(1, label1, label6, label5);
}
if (cj < count && cj > 0)
{
setDataForm(data[cj].Split('#'), 2, label3, label2, label4);
}
else
{
deleteDataForm(2, label3, label2, label4);
}
}
void setDataForm(string [] data_inf,int numb,paramsLabel []ct)
{
try
{
if (numb == 1)
pictureBox1.Image = Image.FromFile(Directory.GetCurrentDirectory() + data_inf[5].Remove(0, 2));
}
catch
{
pictureBox1.Image = null;
}
try
{
if (numb == 2)
{
pictureBox2.Image = Image.FromFile(Directory.GetCurrentDirectory() + data_inf[5].Remove(0, 2));
}
}
catch
{
pictureBox2.Image = null;
}
pictureBox1.SizeMode = pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
ct[0].Text=data_inf[0].Trim('\n','');
ct[1].Text=data_inf[2].Trim('\n','');
ct[2].Text=data_inf[3].Trim('\n','');
}
void deleteDataForm(int numb,paramsLabel [] ct)
{
if (numb==1)
pictureBox1.Image=null;
elseif (numb==2)
pictureBox2.Image=null;
ct[0].Text="";
ct[1].Text="";
ct[2].Text="";
|
|
}
privatevoid button_Click(object sender,EventArgs e)
{
if (sender==this.pictureBox8)
{
ci-=2; cj-=2;
pictureBox9.Enabled=true;
if (ci<=0 && cj<=1)
pictureBox8.Enabled=false;
}
elseif (sender==this.pictureBox9)
{
ci+=2; cj+=2;
pictureBox8.Enabled=true;
if (ci>=count-1 && cj>=count)
pictureBox9.Enabled=false;
}
showData();
}
privatevoid Form1_Load(object sender,EventArgs e)
{
this.BackgroundImage=Image.FromFile(Directory.GetCurrentDirectory()+"\\data\\book.jpg");
}
privatevoid pictureBox5_Click(object sender,EventArgs e)
{
this.panel1.Visible=false;
deleteDataForm(2, label2, label3, label4);
frm2.listBox1.Items.Clear();
frm2.listBox1.Items.Add("\t ̲\n");
list=bookC1.GetList();
for (int i=0;i<list.Length;i++)
frm2.listBox1.Items.Add(list[i][0].Trim(''));
frm2.listBox1.SelectedIndexChanged+=new System.EventHandler(this.listBox_SelectedIndexChanged);
frm2.panel1.BringToFront();
panel7.Controls.Add(frm2.panel1);
pictureBox8.Visible=pictureBox9.Visible=false;
}
privatevoid listBox_SelectedIndexChanged(object sender, EventArgs e)
{
cj=0;
if (frm2.listBox1.SelectedIndex!=0)
{
setDataForm(list[frm2.listBox1.SelectedIndex -1],2,label3,label2,label4);
cj++;
}
}
privatevoid pictureBox7_Click(object sender,EventArgs e)
{
PrintDoc();
}
privatevoid PrintDoc()
{
PrinterSettings PS=newPrinterSettings();
PD.PrinterSettings=PS;
PD.PrinterSettings.PrintRange =PrintRange.SomePages;
PrinterSet.name=label3.Text;
PrinterSet.ingrad=label2.Text;
PrinterSet.article=label4.Text;
PrinterSet.image1=pictureBox2.Image;
PD.PrintPage+=newPrintPageEventHandler(PrinterSet.PD_PrintPage);
if (printDialog1.ShowDialog()==DialogResult.OK)
{
PD.PrinterSettings.PrinterName=printDialog1.PrinterSettings.PrinterName;
PD.Print();
}
}
}
}
PrinterSet
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing.Printing;
using System.Drawing;
using System.Windows.Forms;
namespace recepty
{
classPrinterSet
{
PrintDocument PD=newPrintDocument();
publicstaticImage image1;
publicstaticstring name;
publicstaticstring ingrad;
publicstaticstring article;
publicstaticint z=0;
publicstaticint count=0;
publicstaticvoid PD_PrintPage(object sender,PrintPageEventArgs e)
{
string PrintText=Environment.NewLine;
PrintText+=ingrad+Environment.NewLine;
PrintText+=checkTextLine(article)+Environment.NewLine;
Font PrintFont=newFont("Times New Roman",5,FontStyle.Regular,GraphicsUnit.Millimeter);
Font PrintFont2=newFont("Times New Roman",5,FontStyle.Bold,GraphicsUnit.Millimeter);
Rectangle rectang=e.PageBounds;
rectang.Location=newPoint(30,320);
int linesPerPage=Convert.ToInt16(e.PageBounds.Height / PrintFont.GetHeight(e.Graphics));
string [] text_lines=PrintText.Split('\n');
string tx="";
while (z<text_lines.Length &&count++<linesPerPage-5)
{
tx+=text_lines[z++]+Environment.NewLine;
}
e.Graphics.DrawImage(image1,100,20,270,250);
e.Graphics.DrawString("\n",PrintFont,Brushes.Black,rectang);
e.Graphics.DrawString(name,PrintFont2,Brushes.Black,120,300);
e.Graphics.DrawString(tx,PrintFont,Brushes.Black,rectang);
count=0;
if (z<text_lines.Length)
e.HasMorePages=true;
else e.HasMorePages=false;
}
privatestaticstring checkTextLine(string text)
{
|
|
string res="";
int k=text.Length /80;
if (k==0)
return text+Environment.NewLine;
int pos_p=0;
int pos_n=0;
while (pos_p!=-1)
{
pos_n=text.IndexOf("",(pos_p+80<text.Length)?pos_p+80:text.Length -1);
res+=text.Substring(pos_p,(pos_n-pos_p>0)?pos_n-pos_p:text.Length-pos_p)+Environment.NewLine;
pos_p=pos_n;
}
return res;
}
}
}
Book
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;
namespace recepty
{
classBook
{
publicstring[] GetDataArr()
{
string[] data=null;
int i=0;
TextReader text;
Stream str=Stream.Null;
OpenFileDialog openFileDialog1=newOpenFileDialog();
string text_line;
string data_text="";
openFileDialog1.FileName=Directory.GetCurrentDirectory()+"\\data\\recepty.txt";
try
{
if ((str=openFileDialog1.OpenFile())!=Stream.Null)
{
text=newStreamReader(str,Encoding.Default);
while ((text_line=text.ReadLine())!=null)
{
data_text+=text_line+Environment.NewLine;
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
str.Close();
data=data_text.Split('&');
return data;
}
publicstring [][] GetList()
{
string[] data=GetDataArr();
string[][]list=newstring[data.Length][];
for(int i=0;i<data.Length;i++)
list[i]=data[i].Split('#');
return list;
}
}
}