. , , ,

,,,

" " — ,

85 4, 21 , 11 , 24 , 5 .

WEB , WEB , 1, C#, , ADO, , , COM.

.

, .

. :

-                        ,

-                        ,

-                        ,

-                        ,

-                        ,

-                        .

.
:

TOC o "1-5" h z u PAGEREF _Toc106719318 h 7

1 PAGEREF _Toc106719319 h 8

1.1 PAGEREF _Toc106719320 h 8

1.2 . PAGEREF _Toc106719321 h 10

1.3 PAGEREF _Toc106719322 h 11

1.4 PAGEREF _Toc106719323 h 12

1.4.1

-

PAGEREF _Toc106719324 h 13

1.4.2 PAGEREF _Toc106719325 h 14

1.4.3 PAGEREF _Toc106719326 h 15

1.4.4 PAGEREF _Toc106719327 h 15

1.4.5 Web PAGEREF _Toc106719328 h 16

1.5 PAGEREF _Toc106719329 h 16

1.5.1 1 . PAGEREF _Toc106719330 h 16

1.5.2 MS SQL Server 2000 PAGEREF _Toc106719331 h 21

1.5.3 MS Visual Studio.NET PAGEREF _Toc106719332 h 22

2 PAGEREF _Toc106719333 h 25

2.1 1ѻ PAGEREF _Toc106719334 h 25

2.2 PAGEREF _Toc106719335 h 26

2.3 1 WEB (SQL Server) PAGEREF _Toc106719336 h 28

2.3.1 WEB PAGEREF _Toc106719337 h 29

2.4 ASP.NET PAGEREF _Toc106719338 h 34

2.4.1 PAGEREF _Toc106719339 h 35

2.4.2 PAGEREF _Toc106719340 h 37

3 PAGEREF _Toc106719341 h 39

3.1 PAGEREF _Toc106719342 h 39

3.2 PAGEREF _Toc106719343 h 39

3.3 WEB SQL Server 2000 PAGEREF _Toc106719344 h 39

4 PAGEREF _Toc106719345 h 45

4.1 PAGEREF _Toc106719346 h 45

4.1.1 PAGEREF _Toc106719347 h 45

4.1.2 - PAGEREF _Toc106719348 h 46

4.2 PAGEREF _Toc106719349 h 48

4.3 WEB PAGEREF _Toc106719350 h 50

4.3.1 WEB . PAGEREF _Toc106719351 h 51

4.3.2 PAGEREF _Toc106719352 h 52

4.3.2.1 WEB PAGEREF _Toc106719353 h 52

4.3.2.2 ASP.NET 2.0 PAGEREF _Toc106719354 h 52

4.3.2.3 ADO.NET PAGEREF _Toc106719355 h 53

4.3.3 WEB PAGEREF _Toc106719356 h 53

4.3.4 PAGEREF _Toc106719357 h 54

4.3.5 PAGEREF _Toc106719358 h 55

4.3.6 PAGEREF _Toc106719359 h 56

2.4.7 PAGEREF _Toc106719360 h 57

5 PAGEREF _Toc106719361 h 59

5.1 1 PAGEREF _Toc106719362 h 59

5.1.1 PAGEREF _Toc106719363 h 59

5.1.2 : PAGEREF _Toc106719364 h 59

5.1.3 (): PAGEREF _Toc106719365 h 60

5.1.4 PAGEREF _Toc106719366 h 62

5.1.5 (): PAGEREF _Toc106719367 h 64

5.1.6 : PAGEREF _Toc106719368 h 64

5.1.7 : PAGEREF _Toc106719369 h 66

5.1.8 : PAGEREF _Toc106719370 h 68

5.2 WEB PAGEREF _Toc106719371 h 68

PAGEREF _Toc106719372 h 70

PAGEREF _Toc106719373 h 71

PAGEREF _Toc106719374 h 73

WEB ( Service.asmx) PAGEREF _Toc106719375 h 74

, WEB PAGEREF _Toc106719376 h 78

SQL SERVER PAGEREF _Toc106719377 h 82

WEB ASP.NET PAGEREF _Toc106719378 h 84


. , .

, , .

1 . , . ( ) .

. , .


1

1.1

:

-                        ,

-                        ,

-                        Internet ,

-                        , Internet.

:

-                        , (, , , ),

-                        ,

-                        , (),

-                        - ,

-                        ,

-                        web ,

-                        .

, :

-                        ( WEB , ),

-                        , , ,

-                        , , . ( , ),

-                        . . ,

-                        ( ). , ,

-                        . 10 , 20, , . , ( ) 10 , , , , 20 . , .

1.2 .

1ѻ, . , . . . , , . . ( ) . , . , , , .

. . , , , . -. . - . , . , - 1, MS Excel . - .

, , ( ). , ( 2 4), , , .

1.3

. . : TCP-IP.

1:

1

1.4

, .

. . .

1.4.1 -

1 7.7 , 1 . 1 Windows. Windows (XP Professional Server 2003). 7.7, 8 8, ( , ). , . , . , . . . 1 4 , . . , 1 . . , . , . , 1 . , , , . .

1, .

1.4.2

1 , WEB . , Web . Microsoft, MS Windows, .

MS Visual Studio Borland Delphi Builder. , . , , (MSDN) MS Visual Studio . Web Service Web Application.

Beta Visual Studio 2005, , . . 2005 , , beta . . 9 Visual Studio 2003 ASP.NET. (ASP 2.0) , . GridView . . , .

1.4.3

Web --> ASP.NET . 1, HTTP, 80 XML . . . ADO.NET.

1.4.4

MS Visual Studio : C#, C++, Java, Basic. C#. C# Java C++, , . C++ .

1.4.5 Web

MS SQL Server 2000. MS Access, Access ( ) , SQL Server . , , SQL SQL . Oracle, . . , . 2000, 2005 , 2000 , 2005 . MS SQL Server, .

1.5

, . , .

1.5.1 1 .

"1: 7.7" , "1: ", , ,   , .

"1: 7.7" . , 1: 7.7 .

"1: 7.7" .

1 . , , 1. 1ѻ, , . .

"1: " .

.

, DBF.

"1: " : OLE, OLE Automation DDE.

1ѻ . "1: " . , :

-                        ,

-                        ,

-                        ,

-                        ,

-                        : , , , ,

-                        ,

-                        ,

-                        .

. 1 , :

-                        ,

-                        ( - ).

"1: " . 1.

1. *.DBF . . . . , () , 3 dbf. DBASE IV, ADO.NET, .

1 . Basic. 1 Microsoft Office. ( ). , XML ( ), Dbase IV OLE. *.dbf 1 OLE WEB . 1 . , 1 ( 1).

. , *.dbf c 1Cv7.md . , . 1 - ert. Windows ( , , ). , , 1. , . .

1 , . 1, . . , , . .

, . , . . , . , ֻ , - , ( , ). .

1.5.2 MS SQL Server 2000

Microsoft SQL Server 2000 , .

:

-                        web-. , . XML . web- , . , ,

-                        . SQL 2000 Server , ,

-                        . SQL 2000 , , , T-SQL. , , , web-,

-                        . Windows 2000, SQL 2000 Server , .

. Query Analyzer SQL Profiler. SQL . , SQL Server < -- > ADO.NET Microsoft, . Visual Studio MS SQL Server ( SQL).

InterBase SQL Server . Wizard.

T-SQL, SQL , SQL ( ).

1.5.3 MS Visual Studio.NET

, , , , (.. Microsoft , ).

.NET , C# - .NET Framework .NET. , , , , .NET. , C# - Java Microsoft ( Sun). , , .

Visual Studio 2005 beta :

-                        WEB . Visual Studio .NET   WEB - XML,   . . Visual Studio .NET     XML ( , )     -,   -  , ,

-                        ASP.NET . , .NET Framework 2.0 ASP.NET 2.0. ASP.NET 2005 . ASP.NET , , . ASP.NET Web ,

-                        ADO.NET. MS Excel ( Jet), Dbase IV, MS SQL Server,

-                        COM . COM MSDN , .


2

2.1 1ѻ

, .

: 1 , . , ( ).

, .

1 , - . , , 1, . :

-                        , ,

-                        ,

-                        , .

flash :

-                        ,

-                        ,

-                        ( (USB) , ),

-                        Internet ( Internet ).

DBF.

2.2

.

- 2.

2

2.3 1 WEB (SQL Server)

3.

3 1 WEB (SQL Server)

. , .

4.


4

.

2.3.1 WEB

Web HTTP .

asmx( Service.asmx. .

IIS WEB . Web WEB HTML .

5 WEB :

.       ASP.NET ,

.       1 COM . 1 , DBF ,

.       DBF ADO.NET, DataTable,

.       DataTable .

, 1 . :

.      

.       ( , )

.       DBF .

( ) nastr.txt, .

DBF 1 WEB . , ( 1 , ) . 1 , . 1 , .

, :

-                        COM. COM . COM , . --> --> . , DCOM, 1 7.7, COM ,

-                        . . MSDN , . , , 1cv7s.exe , 1 30 . WEB 1 . 1 . , - . , , 1 - ExitSystem - . 10 . 10 1, , 15 1.

WEB , :

-                        XML XML ,

-                        ( ) C#. ( ) , [WebMethod]. , , ,

-                        (dll). , IIS ,

-                        . Microsoft. ADO.NET. .

, public private. . WEB Java. ѻ Java ( ) , Java ( , , ), . Visual C# . , .

WEB 1, WEB . 1. 1. ( ). , WEB .


2.4 ASP.NET

*.aspx ( MS Visio Studio 2005). 5.

5 Visual Studio


2.4.1

6

1 - :

aspx - , HTML . .

ascx. .

XML.

WEB . .

MS SQL Server. .

, . .

(Bitmap).

Microsoft Excel

. , 16 , , Skolko.aspx . 26 , , , . 14 , _Nomenklatura, .

:

-                        _Statistika,

-                        .

2.4.2

-                        Default.aspx. . . : , , ,

-                        Men.aspx. . , 1 WEB MS SQL Server, , Zakazi.aspx, Statistika.aspx, Polzovateli.aspx,

-                        Zakazi.aspx. . , ,

-                        Statistika.aspx. ,

-                        Polzovateli.aspx. , ,

-                        Skolko.aspx. default.aspx,

-                        ShemaProezda.aspx. . , , , ,

-                        Kontakt.aspx. . . ,

-                        Prajs.aspx. xls ꅻ,

-                        Zakaz.aspx. , .

. ascx. . 6. JavaScript. derevo.ascx [11] .


3

3.1

1. 1 , Web , . , Web .

3.2

2.2.

, :

-                        ,

-                        ,

-                        ,

-                        ,

-                        ,

-                        .

3.3 WEB SQL Server 2000

SQL Server 7.

7 WEB (SQL Server).

, . SQL , ASP.NET.

. . . , .

. :

2

KodDejstv

Int

Dejstvie

C(100)

3

KodStat

Int

Dejstv

Int

_StoDel

Data

Date

Polzovatel

int

_Polzovateli. ( )


4

KodNom

(9)

Otec

C(9)

( )

Naimenov

Int

Strana

C(120)

MinPartija

int

Photo

C(200)

Opisanie

C(600)

EtoGruppa

smallInt

5

KodCeni

Int

Cena

money

Nomen

(9)

_Nomenklatura

NomerPrajsa

smallint

6

KodOstatka

Int

Kolichestvo

Int

Magazin

Int

_Magazini

Nomen

C(9)

_Nomenkalatura


7

KodMagazina

Int

Naimenovanie

C(200)

Adress

C(200)

Telephon

C(30)

VremjaRaboti

C(50)

ShemaProezda

C(120)

.jpg,

DataOstatkov

DateTime

_Ostatki

8 ( )

KodMenedzera

Int

Imja

C(20)

Pass

C(15)

Email

C(12)

DataZahoda

DateTime

9 .

KodNovosti

Int

Avtor

Int

_Menedzeri

Novost

C(600)

Data

C(12)

10 .

KodZakaza

Int

Obrabotan

Date

Status

smallint

(, )

Polzovatel

Int

_Polzovateli

Data

Date

Sym

money

11 .

KodPozicii

Int

Zakaz

Int

_Zakazi

Nomen

Int

_Nomenklatura

Cena

money

Kolichestvo

Int

Sym

money

(Cena*Kolichestvo)


4

4.1

4.1.1

( ) 8

8

, dbf , . :

.       ,

.       DBF , ,

.       DBF :

-       ,

-       ,

-       ,

-       ( ),

-       ,

-       .

, 1 .

4.1.2 -

, .

( 5.1.8) 1 , 9.

9

, , . () () .

, ֻ :

=

"//{{(_)

|= ..;

|=...;

|= ...;

|= ..;

| ;

| ;

| = ();"//}}

;

.() = 0

(" ");

;

. 8 . . : DBF , . , , , , .. , - , 1, , , 1 , . , , ( ).

. .

, .

4.2

:

-                        , ,

-                        ,

-                        ,

-                        , ,

-                        .

, . , .

, 5.1.

-. . , :

-                        ,

-                        ,

-                        .

-ʻ. , 1 7.7. RS-232. :

-                        ,

-                        ,

-                        .

. . -, . , , .

, . , , . , . : ( ), ( ) , . 1ѻ.

, .

, ( ) . ( ) . 5.1.6.

4.3 WEB

10.

10 web

10 .

4.3.1 WEB .

. . . WEB :

-                        Internet Explorer 6 x,

-                        , 1024x768,

-                        ( Windows XP SP2),

-                        Java Script.

4.3.2

4.3.2.1 WEB

JavaSript, CSS. , , . , .

4.3.2.2 ASP.NET 2.0

ASP.NET 2.0:

-                        FileUpload men.aspx. . ost.dbf, . , 5.1.8,

-                        DataView . Visual Studio 2003 DataGrid, , DataView. , : , , . SqlDataSource,

-                        Label. ,

-                        Login. . , , .

4.3.2.3 ADO.NET

. SQL Server : SqlConnection, SqlCommand. Visual Studio MS SQL Server. [16], [22], [23].

:

-                        SQL Servere ( NomenObnovi, DobTov)

-                        SQL Servere (NewZakaz)

-                        SQL , WEB ( - Excel ).

-                        DataSet Fill.

.

4.3.3 WEB

WEB Visual Studio. SolutionExplorer WebReferences WEB . WEB : Sluzba.Service ws = new Sluzba.Service();. WEB : ws. .

men, Web . WEB (Timeout). 1 . WEB 3 , 5 ( ). Web , .

WEB 3 . _Nomenklatura (10 000 ), 70 _Ostatki (10 000 ) (63 000 ). ( ) , , 1 . , .

4.3.4

HTML . (), , . . . . . WEB , .

WEB . derev.ascx : <%@ OutputCache Duration = "600" VaryByParam="none" %>. , ( ) 600 .

4.3.5

InternetMagazin@mirposudy.com. Visual Studio 2005 , Visual Studio 2003. , 11.

11

4.3.6

.

, ( ) 1 ( , ). .

- , . , . : . .

.

12.

12 -

Excel , DataView.

2.4.7

:

-                        JavaScript C#. : , ,

-                        . : ,

-                        JavaScript. : ShowAlert . .


5

5.1 1

:

-                        ,

-                        ,

-                        (),

-                        ,

-                        (),

-                        ,

-                        ,

-                        .

5.1.1

. , :

-                        ,

-                        ,

-                        , , ,

-                        .

 

5.1.2 :

. , . . , , 1 .

 

5.1.3 ():

:

.       . , ( ). 13.

13

.       . , . . 14.


14 -

ʻ , .

, 15.

15 -

. , , 9 , .

. .

.       , . , . .

, , , . . , . , . .

 

5.1.4

:

.       ٸ 1.

.       . . , , ( ). .

.       ( ).

, . , . , . , Delete( ).

16.

16 -

.       . , , .

.       ( )

5.1.5 ():

1 л:

:

-                        - , .

-                        - .

-                        - . , . , . ( ), , .

-                        - , .

5.1.6 :

.

- > . :Base .ert. , 17.


17 -

, . ( ). , . , . . , , . .

. , 18.

18 -

, .

5.1.7 :

( 16 ) .

19:

19 -

19. , , > , .

, .

, , , , , . 20.

20 -

, .

5.1.8 :

:

-                          flesh USB

-                          1

-                          , 21.

21

-                          ( ).

-                         

-                         

-                          .

5.2 WEB

.

SQL Server.

WEB :

-                        Internet Explorer 6 x

-                        , 1024x768

-                        ( Windows XP SP2)

-                        Java Script

, .


, .

:

-                       

-                       

-                        1 WEB (SQL Server 2000).

-                        ,

. 2005 .


1.   1Ѡ ( ).

2.   1: : . . . .: 1-, 2003 . -273 .

3.   1: . .., .. /: , 2003 320 .

4.   1:: . .. .: -, 2004. 464 .

5.   1:. . .. .: , 2004 . 464.

6.   1є: http://www.kuban.ru/cgi-bin/forum/forum9.cgi

7.   1: http://1c.proclub.ru/

8.   Windows Server 2003. . . .: , 2004. 767 .

9.   Internet WWW. . ., . ., . .. . . .: ̻, 2002 . 1184 .

10. JavaScript 1.5: . - ., - .: , 2002 . 272 .

11. JavaScript DHTML. . . . .: , 2004 . 523 .

12. ASP.NET C#. . . . .: , 2003 . 304 .

13. ASP .Net Mania ASP.NET .NET Framework: http://aspnetmania.com/

14. C#. . NIIT. . .: , 2002 . 528 .

15. Visual Studio .NET 2003. .. - .: - , 2003.- 688 .

16. C# .NET. . . . .: , 2005. 796 .

17. web- .NET. . ., - . : BHV; .: , 2003. 430 .

18. MSDN Library for Visual Studio 2005 Beta

19. http://rsdn.ru/

20. http://www.gotdotnet.ru/

21. Microsoft SQL Server 7 . ., . : , 2000 . 896 .

22. Visual Studio .NET: . . . .: -, 2003 . 544 .

23. ADO.NET . .. .- .: , 2005 576 .

24. http://sql.ru/


.


Web ( Service.asmx)

// -

using System.Web;

using System;

using System.Reflection;

using System.Web.Services;

using System.Web.Services.Protocols;

using System.Data;

using System.Data.OleDb;

[WebServiceBinding(ConformanceClaims=WsiClaims.BP10,EmitConformanceClaims = true)]

public class Service : System.Web.Services.WebService {

private

// 1

Type _1C = null; // 頠

object tor = null; // COM

object rmtrade = null;

object[] args = null; // 蠠

object Order = null;

//***************************************************************************

// 1. true false -

bool podkluchenie(){

_1C = Type.GetTypeFromProgID("V77s.Application");

try{

tor = Activator.CreateInstance(_1C);

rmtrade = _1C.InvokeMember("RMTrade", BindingFlags.GetProperty, null, tor, null);

// ,

args = new object[] { rmtrade, "/DC:\ttt\ /NFOKS /P676676 ", "NO_SPLASH_SHOW" };

// 1

_1C.InvokeMember("Initialize", BindingFlags.InvokeMethod, null, tor, args);

return true;

}

catch{

// COM

//return " - OLE";

// Windows COM

//. " "

return false;

}

}

//******************************************************************************

//

// ,

object Procedura1C_par(string Imja, string Param){

args = new object[] { Param };

return _1C.InvokeMember(Imja, BindingFlags.InvokeMethod, null, tor, args);

}

//******************************************************************************

//

// ,

object Procedura1C_tz(string Imja, string Param){

args = new object[] {};

//*return_1C.InvokeMember(Imja, BindingFlags.GetField | BindingFlags.InvokeMethod | BindingFlags.Default, null, tor, null);

return _1C.InvokeMember(Imja, BindingFlags.InvokeMethod | BindingFlags.OptionalParamBinding, null, tor, args);

}

//******************************************************************************

// 1

// 1, dbf

// :

// ImjaProc -

// ImjaKat - ,

// ImjaTabl -

DataTable Vigr(string ImjaProc, string ImjaKat, string ImjaTabl)

{

// object ost;

int i;

string rez;

DataSet dt = new DataSet();

DataTable ddt = new DataTable();

if (podkluchenie())

{//

try

{

rez = Procedura1C_tz(ImjaProc, "").ToString();

// - .

// ADO.NET

string konekt = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+ImjaKat+";Extended Properties=dBase IV;mode=Read|Write|Share Deny None";

string zapr = "Select * from " + ImjaTabl;

OleDbDataAdapter adapt = new OleDbDataAdapter(zapr, konekt);

adapt.Fill(dt, ImjaTabl);

//ds.WriteXml(@"C:ttt.xml");

_1C.InvokeMember("ExitSystem", BindingFlags.InvokeMethod, null, tor, new object[] { 0 });

tor = null;

_1C = null;

return dt.Tables[0];

}

catch

{//

_1C.InvokeMember("ExitSystem", BindingFlags.InvokeMethod, null, tor, new object[] { 0 });

tor = null;

_1C = null;

return ddt;

}

}

else

{ //

_1C.InvokeMember("ExitSystem", BindingFlags.InvokeMethod, null, tor, new object[] { 0 });

tor = null;

_1C = null;

return ddt;

}

}

[WebMethod]

public

//******************************************************************************

//

string OstatokPoKodu(string nom) {

string ost;

ost = "";

if (podkluchenie()){

ost = Procedura1C_par("GlVozrOst", nom).ToString();

_1C = null;

return ost;

}else{

_1C = null;

return null;

}

}

[WebMethod]

public

//******************************************************************************

//

DataTable VigruzNom(){

return Vigr("GlVozrNom", @"C:BD_WBnomen", "nomen");

}

[WebMethod]

public

//******************************************************************************

//

DataTable VigruzCeni()

{

return Vigr("GlVozrCeni", @"C:BD_WBceni", "ceni");

}

[WebMethod]

public

//******************************************************************************

//

DataTable VigruzOst()

{

return Vigr("GlVozrOstatki", @"C:BD_WBost_osnov", "ost");

}

}


,

WEB .

 (, ,  = 0,  = 0,  = 0,  = 0,  = 0,  = 0, =0)  

 GlVozrOst(_)     
 GlVozrCeni()  
 GlVozrNom()           


//###############################################################################
//           Web 

//*******************************************************************
//        nastr.txt  
//  :
//    # - 
//     [],      
 ()
      ;
      ;
     
      = (""); 
     .(0);
     .(()+"nastr.txt");
      = 1;
      <= .() 
           = .();
          //       
          (); 
           ()>0       
               //  ,  
                (, 1) = "#"   
                     =  + 1;
                    ;
               ;
               //    , 
                (, 1) = "[" 
                     = (,()-1);
                     = (,()-1);
                    //    - 
                      =  
                          (.(+1));
                    ;
               ; 
          ;
           =  + 1;
     ;
     "0";   //     -  


//******************************************************************
//       ,     Web 

 GlVozrOst(_) 
      ;
     
     =(".");
      = (".");
      = ("."); 
     
     .("00001");
     .(_); 
     
      = 0;
      = .(  ,.(), .(),,"");
     
      ;
      
             
//*******************************************************************
//     -      

 GlVozrNom() 
      , ;                           
     ;
     
      = ("");  
      = 
     "//{{()      
     |            = ..; 
     | ;"//}}
    ;
     
      .() = 0 
          ("  ");
     ;                                  
     
      = ("") + ("");
     
      = ("XBase");
     .("EtoGruppa",1,1,0);
     .("KodNom",2,9,0);
     .("Otec",2,9,0);
     .("Strana",2,20,0);
     .("Naimenov",2,250,0);
     

     .(+"nomen.dbf"); 
     .(1);  
     .();
      .(1)=1    
               .();
               .KodNom  = ..;
               .Otec = ...;
               .Strana=...;;
               .Naimenov=..;                
               .EtoGruppa=.(1);
               .();
     ;
      1;
 
       
//*******************************************************************
//       -    
 () 
       = "00002" 
           1;
       = "00003" 
           2;
       = "00004" 
           3;
       = "00005" 
           4;                
       = "00006" 
           5;
       = "00007" 
           6;
       = "00001" 
           0;
      
           33;     //  . 0 , ..      
     ;



//*******************************************************************
//        
 GlVozrCeni() 
      , ;                           
     ; 
      ;
     
      = ("");  
      = 
     "//{{()      
     |     = ..;
     |         = ...;
     |               = ..;
     |            = ..;
     | ; 
     |"//}}
     ;
     
      .() = 0 
          ("  ");
     ;                                  
     
      = ("") + ("");
     
      = ("XBase");
     .("Cena",1,8,2);
     .("Nomen",2,9,0);
     .("Prajs",1,2,0);

     .(+"Ceni.dbf"); 
     .(1);  
     .();
      .(1)=1    
                (.<>"00010") 
                    .();           
                    (., .,,,,,,0);
                    .Cena  = ;
                    .Nomen = ..;
                    .Prajs = (.);
                    .();
               ;
     ;
      1;
 


//*******************************************************************
//    
 GlVozrOstatki() 
      , ;  
      ;
     
      = ("XBase"); 
     .("Kod",2,9,0);
     .("Ostatok",1,5,0);
                  
      =("") + (""); 

     .(+"ost.dbf"); 

     .(1);     
      = ("");  
      = 
     "//{{(_)
     |            = ..;
     |           = ...;
     |            = ..;   
     |   ; 
     | ; 
     |        = ();"//}}
    ;

      .() = 0 
          ("  ");
     ; 

     .();
      .(1)=1    
           .(2)=1    
                .="00001"  
                    .();           
                    .Kod = ..;
                    .Ostatok = .;
                    .();                 
              ;
          ;
     ;

      1;
 


SQL Server

DobTov

/* ,

- */

CREATE PROCEDURE DobTov

@Nomen char(9) ,

@Zakaz int,

@Kolichestvo int,

@Prajs smallint

AS

DECLARE @cen money

SET @cen=(SELECT SUM(Cena) FROM _Ceni WHERE ((NomerPrajsa = @Prajs) and (_Ceni.Nomen=@Nomen)))

INSERT _TovariVZakaze (Nomen, Zakaz, Kolichestvo, Cena, Sym)

VALUES (@Nomen, @Zakaz, @Kolichestvo, @cen, @cen*@Kolichestvo)

GO

NomenObnovi

/* 1.

, . -

*/

CREATE PROCEDURE NomenObnovi

@KodNom char(9),

@EtoGruppa smallint,

@Otec char(9),

@Strana char(30),

@Naimenov char(300)

AS

IF (SELECT COUNT(KodNom) FROM _Nomenklatura WHERE (KodNom = @KodNom))>0 BEGIN

UPDATE [_Nomenklatura] SET [EtoGruppa] = @EtoGruppa, [Otec] = @Otec, [Strana] = @Strana, [Naimenov] = @Naimenov WHERE ([KodNom] = @KodNom)

END

ELSE BEGIN

INSERT INTO [_Nomenklatura] ([KodNom], [EtoGruppa], [Otec], [Strana], [Naimenov]) VALUES (@KodNom, @EtoGruppa, @Otec, @Strana, @Naimenov)

END

GO

VisualStudio ( default.aspx prajs.aspx) 1, Excel:

// /shabloni /zaka4

// - rendom'om

Random rnd = new Random(); //

// ,

String str_rnd = Convert.ToInt32(rnd.NextDouble() * 10000).ToString();

//

string path = Server.MapPath("") +@"ShabloniPrice.xls";

string path2 = Server.MapPath("") + @"Zaka4Price" + str_rnd + ".xls";

//

FileInfo fi1 = new FileInfo(path);

fi1.CopyTo(path2);

String zapr3;

zapr3 = "insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0; Database=" + path2 + " ; ID=Foks; Password=676676', 'SELECT * FROM [$]') SELECT Naimenov, KodNom, Strana, MinimPartija, CAST (Cena AS nvarchar) FROM dbo._Nomenklatura, dbo._Ceni, dbo._Ostatki WHERE (([EtoGruppa] = 0) AND (Kolichestvo>0) AND (_Ostatki.Nomen=KodNom) AND (_Ceni.Nomen=KodNom) AND (NomerPrajsa=" +

Session["prs"].ToString() + ") AND (Otec='"+ str +"') ) ORDER BY Naimenov";

// 3, 100%

SqlConnection con3 = new SqlConnection(System.Configuration.ConfigurationSettings.ConnectionStrings["ConnectionForForWeb"].ConnectionString);

SqlCommand cmd3 = new SqlCommand(zapr3, con3);

con3.Open();

cmd3.ExecuteScalar();

con3.Close();


WEB ASP.NET

//******************************************************************************

// ,

void Button1_Click(object sender, EventArgs e)

{

int i, vsego; // , Web

DataTable ds = new DataTable();

Sluzba.Service ws = new Sluzba.Service();

ws.Timeout = 1000 * 60 * 5;

try{

ds = ws.VigruzNom(); //

}

catch{

LabelInfo.Text = " 1. 15 ";

return;

}

// ds.Tables[0].TableName = "Nomenkl";

// ds.Tables[0].Columns[0].ColumnName = "EtoGruppa";

// ds.Tables[0].Columns[1].ColumnName = "KodNom";

// ds.Tables[0].Columns[2].ColumnName = "Otec";

// ds.Tables[0].Columns[3].ColumnName = "Strana";

// ds.Tables[0].Columns[4].ColumnName = "Naimenov";

// ds.WriteXml(@"C:ds.xml");

// MS SQL Server

SqlConnection konekt = new SqlConnection("Server=FKS;Integrated Security=True;Database=ForWeb");

SqlCommand sqlcom = new SqlCommand("NomenObnovi", konekt);

sqlcom.CommandType = CommandType.StoredProcedure;

SqlParameter param = null;

param = sqlcom.Parameters.Add(new SqlParameter("@KodNom", SqlDbType.Char, 9));

param.Direction = ParameterDirection.Input;

param = sqlcom.Parameters.Add(new SqlParameter("@EtoGruppa", SqlDbType.SmallInt, 9));

param.Direction = ParameterDirection.Input;

param = sqlcom.Parameters.Add(new SqlParameter("@Otec", SqlDbType.Char, 9));

param.Direction = ParameterDirection.Input;

param = sqlcom.Parameters.Add(new SqlParameter("@Strana", SqlDbType.Char, 30));

param.Direction = ParameterDirection.Input;

param = sqlcom.Parameters.Add(new SqlParameter("@Naimenov", SqlDbType.Char, 300));

param.Direction = ParameterDirection.Input;

LabelInfo.Text = " ";

vsego = ds.Rows.Count;

konekt.Open();

for (i = 0; i < vsego; i++)

{

sqlcom.Parameters[0].Value = ds.Rows[i][1];

sqlcom.Parameters[1].Value = ds.Rows[i][0];

sqlcom.Parameters[2].Value = ds.Rows[i][2];

sqlcom.Parameters[3].Value = ds.Rows[i][3];

sqlcom.Parameters[4].Value = ds.Rows[i][4];

sqlcom.ExecuteNonQuery();

}

konekt.Close();

LabelInfo.Text = " , - " + vsego;

}

85 4, 21 , 11 , 24 , 5 . WEB , WEB , 1, C#, , ADO, , , COM.

 

 

 

! , , , .
. , :