This presentation is the property of its rightful owner.
Sponsored Links
1 / 1378

 浅谈“三层结构”原理与用意 PowerPoint PPT Presentation


  • 68 Views
  • Uploaded on
  • Presentation posted in: General

 浅谈“三层结构”原理与用意. 浅谈“三层结构”原理与用意. 2005 年 02 月 28 日, AfritXia 撰写. 2006 年 12 月 28 日, AfritXia 第一次修改. 序. 在刚刚步入“多层结构” Web 应用程序开发的时候,我阅读过几篇关于“ asp.net 三层结构开发”的文章。但其多半都是对 PetShop3.0 和 Duwamish7 的局部剖析或者是学习笔记。对“三层结构”通体分析的学术文章几乎没有。.

Download Presentation

 浅谈“三层结构”原理与用意

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


3814611


3814611


2005 02 28 afritxia

20050228AfritXia


2006 12 28 afritxia

20061228AfritXia


3814611


Web asp net petshop3 0 duwamish7

Webasp.netPetShop3.0Duwamish7


3814611

2005211Bincess BBS7TraceLWord1~TraceLWord7CodePackage


Web asp net

Webasp.net


3814611

asp.netWeb


3814611


3814611


3814611

n


3814611

n


N xml

nXML


3814611


3814611


3814611

Web


3814611


Listlword aspx listlword aspx cs

ListLWord.aspxListLWord.aspx.cs


Postlword aspx postlword aspx cs

PostLWord.aspxPostLWord.aspx.cs


Codepackage tracelword1

CodePackage/TraceLWord1


3814611


Lwordid int not null identity 1 1

[LWordID] INT NOT NULLIDENTITY(1, 1)


Textcontent ntext n

[TextContent] NText N


Posttime datetime getdate

[PostTime] DateTime GetDate()


Listlword aspx

ListLWord.aspx


001 @ page language c codebehind listlword aspx cs autoeventwireup false

#001 <%@ Page language="c#" Codebehind="ListLWord.aspx.cs" AutoEventWireup="false"


Inherits tracelword1 listlword

Inherits="TraceLWord1.ListLWord" %>


002 doctype html public w3c dtd html 4 0 transitional en

#002 <!DOCTYPEHTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


3814611

#003


004 html

#004 <html>


005 head

#005 <head>


006 title listlword title

#006 <title>ListLWord</title>


007 meta name generator content microsoft visual studio net 7 1

#007 <metaname="GENERATOR"Content="Microsoft Visual Studio .NET 7.1">


008 meta name code language content c

#008 <metaname="CODE_LANGUAGE"Content="C#">


009 meta name vs defaultclientscript content javascript

#009 <metaname=vs_defaultClientScriptcontent="JavaScript">


010 meta name vs targetschema content http schemas microsoft com intellisense ie5

#010 <metaname=vs_targetSchemacontent="http://schemas.microsoft.com/intellisense/ie5">


011 head

#011</head>


012 body ms positioning gridlayout

#012 <bodyMS_POSITIONING="GridLayout">


3814611

#013


014 form id aspnetform method post runat server

#014 <formid="__aspNetForm"method="post"runat="server">


3814611

#015


016 a href postlword aspx a

#016 <ahref="PostLWord.aspx"></a>


3814611

#017


018 asp datalist id m lwordlistctrl runat server

#018 <asp:DataListID="m_lwordListCtrl"Runat="Server">


019 itemtemplate

#019 <ItemTemplate>


020 div

#020 <div>


021 databinder eval container dataitem posttime

#021 <%# DataBinder.Eval(Container.DataItem, "PostTime") %>


022 databinder eval container dataitem textcontent

#022 <%# DataBinder.Eval(Container.DataItem, "TextContent") %>


023 div

#023 </div>


024 itemtemplate

#024 </ItemTemplate>


025 asp datalist

#025 </asp:DataList>


3814611

#026


027 form

#027 </form>


3814611

#028


029 body

#029 </body>


030 html

#030 </html>


3814611


Visual studio net 2003 listlword aspx listlword aspx cs

Visual Studio.NET 2003ListLWord.aspx ListLWord.aspx.cs


001 using system

#001 usingSystem;


002 using system collections

#002 usingSystem.Collections;


003 using system componentmodel

#003 usingSystem.ComponentModel;


004 using system data

#004 usingSystem.Data;


005 using system data oledb access

#005 usingSystem.Data.OleDb;// Access


006 using system drawing

#006 usingSystem.Drawing;


007 using system web

#007 usingSystem.Web;


008 using system web sessionstate

#008 usingSystem.Web.SessionState;


009 using system web ui

#009 usingSystem.Web.UI;


010 using system web ui webcontrols

#010 usingSystem.Web.UI.WebControls;


011 using system web ui htmlcontrols

#011 usingSystem.Web.UI.HtmlControls;


3814611

#012


013 namespace tracelword1

#013 namespaceTraceLWord1


3814611

#014 {


015 summary

#015 ///<summary>


016 listlword

#016 ///ListLWord


017 summary

#017 ///</summary>


018 public class listlword system web ui page

#018 publicclassListLWord : System.Web.UI.Page


3814611

#019 {


3814611

#020 //


021 protected system web ui webcontrols datalist m lwordlistctrl

#021 protectedSystem.Web.UI.WebControls.DataList m_lwordListCtrl;


3814611

#022


023 summary

#023 ///<summary>


024 listlword aspx

#024 ///ListLWord.aspx


025 summary

#025 ///</summary>


026 private void page load object sender system eventargs e

#026 privatevoidPage_Load(objectsender, System.EventArgs e)


3814611

#027 {


028 lword databind

#028 LWord_DataBind();


3814611

#029 }


3814611

#030


031 region web

#031 #regionWeb


032 override protected void oninit eventargs e

#032 overrideprotectedvoidOnInit(EventArgs e)


3814611

#033 {


034 initializecomponent

#034 InitializeComponent();


035 base oninit e

#035 base.OnInit(e);


3814611

#036 }


3814611

#037


038 private void initializecomponent

#038 privatevoidInitializeComponent()


3814611

#039 {


040 this load new system eventhandler this page load

#040 this.Load+=newSystem.EventHandler(this.Page_Load);


3814611

#041 }


042 endregion

#042 #endregion


3814611

#043


044 summary

#044 ///<summary>


3814611

#045 ///


046 summary

#046 ///</summary>


047 private void lword databind

#047 privatevoidLWord_DataBind()


3814611

#048 {


049 string mdbconn @ provider microsoft jet oledb 4 0

#049 stringmdbConn=@"PROVIDER=Microsoft.Jet.OLEDB.4.0;


Data source c dbfs tracelworddb mdb

DATA Source=C:\DbFs\TraceLWordDb.mdb";


050 string cmdtext @ select from lword order by lwordid desc

#050 stringcmdText=@"SELECT * FROM [LWord] ORDER BY [LWordID] DESC";


3814611

#051


052 oledbconnection dbconn new oledbconnection mdbconn

#052OleDbConnectiondbConn=newOleDbConnection(mdbConn);


053 oledbdataadapter dbadp new oledbdataadapter cmdtext dbconn

#053 OleDbDataAdapterdbAdp=newOleDbDataAdapter(cmdText, dbConn);


3814611

#054


055 dataset ds new dataset

#055 DataSet ds=newDataSet();


056 dbadp fill ds @ lwordtable

#056 dbAdp.Fill(ds, @"LWordTable");


3814611

#057


058 m lwordlistctrl datasource ds tables @ lwordtable defaultview

#058 m_lwordListCtrl.DataSource=ds.Tables[@"LWordTable"].DefaultView;


059 m lwordlistctrl databind

#059 m_lwordListCtrl.DataBind();


3814611

#060 }


3814611

#061 }


3814611

#062 }


Postlword aspx

PostLWord.aspx


001 @ page language c codebehind postlword aspx cs autoeventwireup false

#001 <%@ Page language="c#" Codebehind="PostLWord.aspx.cs" AutoEventWireup="false"


Inherits tracelword1 postlword

Inherits="TraceLWord1.PostLWord" %>


002 doctype html public w3c dtd html 4 0 transitional en1

#002 <!DOCTYPEHTML PUBLIC"-//W3C//DTD HTML 4.0 Transitional//EN">


3814611

#003


004 html1

#004 <html>


005 head1

#005 <head>


006 title postlword title

#006 <title>PostLWord</title>


007 meta name generator content microsoft visual studio net 7 11

#007 <metaname="GENERATOR"Content="Microsoft Visual Studio .NET 7.1">


008 meta name code language content c1

#008 <metaname="CODE_LANGUAGE"Content="C#">


009 meta name vs defaultclientscript content javascript1

#009 <metaname=vs_defaultClientScriptcontent="JavaScript">


010 meta name vs targetschema content http schemas microsoft com intellisense ie51

#010 <metaname=vs_targetSchemacontent="http://schemas.microsoft.com/intellisense/ie5">


011 head1

#011 </head>


012 body ms positioning gridlayout1

#012 <bodyMS_POSITIONING="GridLayout">


3814611

#013


014 form id aspnetform method post runat server1

#014 <formid="__aspNetForm"method="post"runat="server">


3814611

#015


016 textarea id m txtcontent runat server rows 8 cols 48 textarea

#016 <textareaid="m_txtContent"runat="Server"rows=8cols=48></textarea>


017 input type button id m btnpost runat server value

#017 <inputtype="Button"id="m_btnPost"runat="Server"value=""/>


3814611

#018


019 form

#019 </form>


3814611

#020


021 body

#021 </body>


022 html

#022 </html>


Postlword aspx postlword aspx cs1

PostLWord.aspxPostLWord.aspx.cs


001 using system1

#001 usingSystem;


002 using system collections1

#002 usingSystem.Collections;


003 using system componentmodel1

#003 usingSystem.ComponentModel;


004 using system data1

#004 usingSystem.Data;


005 using system data oledb access1

#005 usingSystem.Data.OleDb;// Access


006 using system drawing1

#006 usingSystem.Drawing;


007 using system web1

#007 usingSystem.Web;


008 using system web sessionstate1

#008 usingSystem.Web.SessionState;


009 using system web ui1

#009 usingSystem.Web.UI;


010 using system web ui webcontrols1

#010 usingSystem.Web.UI.WebControls;


011 using system web ui htmlcontrols1

#011 usingSystem.Web.UI.HtmlControls;


3814611

#012


013 namespace tracelword11

#013 namespaceTraceLWord1


3814611

#014 {


015 summary1

#015 ///<summary>


016 postlword

#016 ///PostLWord


017 summary1

#017 ///</summary>


018 public class postlword system web ui page

#018 publicclassPostLWord : System.Web.UI.Page


3814611

#019 {


3814611

#020 //


021 protected system web ui htmlcontrols htmltextarea m txtcontent

#021 protectedSystem.Web.UI.HtmlControls.HtmlTextArea m_txtContent;


3814611

#022 //


023 protected system web ui htmlcontrols htmlinputbutton m btnpost

#023 protectedSystem.Web.UI.HtmlControls.HtmlInputButton m_btnPost;


3814611

#024


025 summary1

#025 ///<summary>


026 postlword aspx

#026 ///PostLWord.aspx


027 summary

#027 ///</summary>


028 private void page load object sender system eventargs e

#028 privatevoidPage_Load(objectsender, System.EventArgs e)


3814611

#029 {


3814611

#030 }


3814611

#031


032 region web

#032 #regionWeb


033 override protected void oninit eventargs e

#033 overrideprotectedvoidOnInit(EventArgs e)


3814611

#034 {


035 initializecomponent

#035 InitializeComponent();


036 base oninit e

#036 base.OnInit(e);


3814611

#037 }


3814611

#038


039 private void initializecomponent

#039 privatevoidInitializeComponent()


3814611

#040 {


041 this load new system eventhandler this page load

#041 this.Load+=newSystem.EventHandler(this.Page_Load);


042 this m btnpost serverclick new eventhandler post serverclick

#042 this.m_btnPost.ServerClick+=newEventHandler(Post_ServerClick);


3814611

#043 }


044 endregion

#044 #endregion


046 summary1

#046 ///<summary>


3814611

#047 ///


048 summary

#048 ///</summary>


049 private void post serverclick object sender eventargs e

#049 privatevoidPost_ServerClick(objectsender, EventArgs e)


3814611

#050 {


3814611

#051 //


052 string textcontent this m txtcontent value

#052 stringtextContent=this.m_txtContent.Value;


3814611

#053


3814611

#054 //


055 if textcontent

#055 if(textContent=="")


056 throw new exception

#056 thrownewException("");


3814611

#057


058 string mdbconn @ provider microsoft jet oledb 4 0 data source c dbfs tracelworddb mdb

#058 stringmdbConn=@"PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA Source=C:\DbFs\TraceLWordDb.mdb";


059 string cmdtext insert into lword textcontent values @textcontent

#059 stringcmdText="INSERT INTO [LWord]([TextContent]) VALUES(@TextContent)";


3814611

#060


061 oledbconnection dbconn new oledbconnection mdbconn

#061 OleDbConnectiondbConn=newOleDbConnection(mdbConn);


062 oledbcommand dbcmd new oledbcommand cmdtext dbconn

#062 OleDbCommanddbCmd=newOleDbCommand(cmdText, dbConn);


3814611

#063


3814611

#064 //


065 dbcmd parameters add new oledbparameter @textcontent

#065 dbCmd.Parameters.Add(newOleDbParameter("@TextContent",


Oledbtype longvarwchar

OleDbType.LongVarWChar));


066 dbcmd parameters @textcontent value textcontent

#066 dbCmd.Parameters["@TextContent"].Value=textContent;


3814611

#067


068 try

#068 try


3814611

#069 {


070 dbconn open

#070 dbConn.Open();


071 dbcmd executenonquery

#071 dbCmd.ExecuteNonQuery();


3814611

#072 }


073 catch

#073 catch


3814611

#074 {


075 throw

#075 throw;


3814611

#076 }


077 finally

#077 finally


3814611

#078 {


079 dbconn close

#079 dbConn.Close();


3814611

#080 }


3814611

#081


3814611

#082 //


083 response redirect listlword aspx true

#083 Response.Redirect("ListLWord.aspx", true);


3814611

#084 }


3814611

#085 }


3814611

#086 }


Access

Access


3814611


3814611


3814611

Microsoft SQL Server 2000SQL Server 2000.aspx.csOleDbConnectionSqlConnectionOleDbAdapterSqlAdapter


3814611

  • n09111317

  • n40


3814611

PostLWord.aspx.csPostLWord.aspx.cs


Windows web

WindowsWeb


3814611


3814611


3814611

ListLWord.aspx.csLWordTask.cs


Dataset

DataSet


Postlword aspx cs

PostLWord.aspx.cs


3814611


Tracelword2 codepackage tracelword2

TraceLWord2CodePackage/TraceLWord2


Lwordtask cs lwordtask cs

LWordTask.csLWordTask.cs


001 using system2

#001 usingSystem;


002 using system data

#002 usingSystem.Data;


003 using system data oledb access

#003 usingSystem.Data.OleDb;// Access


004 using system web

#004 usingSystem.Web;


3814611

#005


006 namespace tracelword2

#006 namespaceTraceLWord2


3814611

#007 {


008 summary

#008 ///<summary>


009 lwordtask

#009 ///LWordTask


010 summary

#010 ///</summary>


011 public class lwordtask

#011 publicclassLWordTask


3814611

#012 {


3814611

#013 //


014 private const string db conn @ provider microsoft jet oledb 4 0

#014 privateconststringDB_CONN=@"PROVIDER=Microsoft.Jet.OLEDB.4.0;


Data source c dbfs tracelworddb mdb1

DATA Source=C:\DbFs\TraceLWordDb.mdb";


3814611

#015


016 summary

#016///<summary>


017 lword dataset

#017 ///LWordDataSet


018 summary

#018 ///</summary>


019 param name ds param

#019 ///<param name="ds"></param>


020 param name tablename param

#020 ///<param name="tableName"></param>


021 returns returns

#021 ///<returns></returns>


022 public int listlword dataset ds string tablename

#022 publicintListLWord(DataSet ds, stringtableName)


3814611

#023 {


024 string cmdtext select from lword order by lwordid desc

#024 stringcmdText="SELECT * FROM [LWord] ORDER BY [LWordID] DESC";


3814611

#025


026 oledbconnection dbconn new oledbconnection db conn

#026 OleDbConnectiondbConn=newOleDbConnection(DB_CONN);


027 oledbdataadapter dbadp new oledbdataadapter cmdtext dbconn

#027 OleDbDataAdapterdbAdp=newOleDbDataAdapter(cmdText, dbConn);


3814611

#028


029 int count dbadp fill ds tablename

#029 intcount=dbAdp.Fill(ds, tableName);


3814611

#030


031 return count

#031 returncount;


3814611

#032 }


3814611

#033


034 summary

#034 ///<summary>


3814611

#035 ///


036 summary

#036 ///</summary>


037 param name textcontent param

#037 ///<param name="textContent"></param>


038 public void postlword string textcontent

#038 publicvoidPostLWord(stringtextContent)


3814611

#039 {


3814611

#040 //


041 if textcontent null textcontent

#041 if(textContent==null|| textContent=="")


042 throw new exception

#042 thrownewException("");


3814611

#043


044 string cmdtext insert into lword textcontent values @textcontent

#044 stringcmdText="INSERT INTO [LWord]([TextContent]) VALUES(@TextContent)";


3814611

#045


046 oledbconnection dbconn new oledbconnection db conn

#046 OleDbConnectiondbConn=newOleDbConnection(DB_CONN);


047 oledbcommand dbcmd new oledbcommand cmdtext dbconn

#047 OleDbCommanddbCmd=newOleDbCommand(cmdText, dbConn);


3814611

#048


3814611

#049 //


050 dbcmd parameters add new oledbparameter @textcontent oledbtype longvarwchar

#050 dbCmd.Parameters.Add(newOleDbParameter("@TextContent", OleDbType.LongVarWChar));


051 dbcmd parameters @textcontent value textcontent

#051 dbCmd.Parameters["@TextContent"].Value=textContent;


3814611

#052


053 try

#053 try


3814611

#054 {


055 dbconn open

#055 dbConn.Open();


056 dbcmd executenonquery

#056 dbCmd.ExecuteNonQuery();


3814611

#057 }


058 catch

#058 catch


3814611

#059 {


060 throw

#060 throw;


3814611

#061 }


062 finally

#062 finally


3814611

#063 {


064 dbconn close

#064 dbConn.Close();


3814611

#065 }


3814611

#066 }


3814611

#067 }


3814611

#068 }


3814611

Access 2000SQL Server 2000LWordTask.csLWordTask.csListLWord.aspx.csLWord_DataBind


3814611

...


046 private void lword databind

#046 privatevoidLWord_DataBind()


3814611

#047 {


048 dataset ds new dataset

#048 DataSet ds=newDataSet();


049 new lwordtask listlword ds @ lwordtable

#049 (newLWordTask()).ListLWord(ds, @"LWordTable");


3814611

#050


051 m lwordlistctrl datasource ds tables @ lwordtable defaultview

#051 m_lwordListCtrl.DataSource=ds.Tables[@"LWordTable"].DefaultView;


052 m lwordlistctrl databind

#052 m_lwordListCtrl.DataBind();


3814611

#053 }


3814611

...


Postlword aspx cs post serverclick

PostLWord.aspx.csPost_ServerClick


3814611

...


048 private void post serverclick object sender eventargs e

#048 privatevoidPost_ServerClick(objectsender, EventArgs e)


3814611

#049 {


3814611

#050 //


051 string textcontent this m txtcontent value

#051 stringtextContent=this.m_txtContent.Value;


3814611

#052


053 new lwordtask postlword textcontent

#053 (newLWordTask()).PostLWord(textContent);


3814611

#054


3814611

#055 //


056 response redirect listlword aspx true

#056 Response.Redirect("ListLWord.aspx", true);


3814611

#057 }


3814611

...


3814611

ListLWord.aspx.csPostLWord.aspx.csLWordTaskTraceLWord1ListLWord.aspx.csOleDbConnectionOleDbDataAdapterLWordTask


3814611

ListLWord.aspx.csPostLWord.aspx.csLWordTask


Public class listlword

public classListLWord


3814611

{


Private void lword databind

private voidLWord_DataBind()


3814611

{


New lwordtask listlword

(newLWordTask()).ListLWord( ... );


3814611

}


3814611

}


Public class postlword

public classPostLWord


3814611

{


Private void post serverclick object sender eventargs e

private voidPost_ServerClick(objectsender, EventArgs e)


3814611

{


New lwordtask postlword

(newLWordTask()).PostLWord( ... );


3814611

}


3814611

}


Public class lwordtask

public classLWordTask


3814611

{


Public dataset listlword dataset ds

publicDataSet ListLWord(DataSet ds)...


Public void postlword string textcontent

public voidPostLWord(stringtextContent)...


3814611

}


3814611


3814611


3814611


3814611


3814611

TraceLWord3LWordTask.csAccessTaskInterServiceLWordService.csTraceLWord3WebUICodePackage/TraceLWord3


3814611


Lwordservice cs

LWordService.cs


001 using system3

#001 usingSystem;


002 using system data1

#002 usingSystem.Data;


3814611

#003


004 using tracelword3 accesstask

#004 usingTraceLWord3.AccessTask;//


3814611

#005


006 namespace tracelword3 interservice

#006 namespaceTraceLWord3.InterService


3814611

#007 {


008 summary1

#008 ///<summary>


009 lwordservice

#009 ///LWordService


010 summary1

#010 ///</summary>


011 public class lwordservice

#011 publicclassLWordService


3814611

#012 {


013 summary

#013 ///<summary>


014 lword dataset

#014 ///LWordDataSet


015 summary2

#015 ///</summary>


016 param name ds param

#016 ///<param name="ds"></param>


017 param name tablename param

#017 ///<param name="tableName"></param>


018 returns returns

#018 ///<returns></returns>


019 public int listlword dataset ds string tablename

#019 publicintListLWord(DataSet ds, stringtableName)


3814611

#020 {


021 return new lwordtask listlword ds tablename

#021 return(newLWordTask()).ListLWord(ds, tableName);


3814611

#022 }


3814611

#023


024 summary

#024 ///<summary>


3814611

#025 ///


026 summary

#026 ///</summary>


027 param name textcontent param

#027 ///<param name="textContent"></param>


028 public void postlword string content

#028 publicvoidPostLWord(stringcontent)


3814611

#029 {


030 new lwordtask postlword content

#030 (newLWordTask()).PostLWord(content);


3814611

#031 }


3814611

#032 }


3814611

#033 }


3814611

LWordService.cs#021#030ListLWord.aspx.cs


3814611

...


012 using tracelword3 interservice

#012 usingTraceLWord3.InterService;//


3814611

...


045 summary

#045 ///<summary>


3814611

#046 ///


047 summary

#047 ///</summary>


048 private void lword databind

#048 privatevoidLWord_DataBind()


3814611

#049 {


050 dataset ds new dataset

#050 DataSet ds=newDataSet();


051 new lwordservice listlword ds @ lwordtable

#051 (newLWordService()).ListLWord(ds, @"LWordTable");


3814611

#052


053 m lwordlistctrl datasource ds tables @ lwordtable defaultview

#053 m_lwordListCtrl.DataSource=ds.Tables[@"LWordTable"].DefaultView;


054 m lwordlistctrl databind

#054 m_lwordListCtrl.DataBind();


3814611

#055 }


3814611

...


Postlword aspx cs1

PostLWord.aspx.cs


3814611

...


012 using tracelword3 interservice1

#012 usingTraceLWord3.InterService;//


3814611

...


047 summary1

#047 ///<summary>


3814611

#048 ///


049 summary

#049 ///</summary>


050 private void post serverclick object sender eventargs e

#050 privatevoidPost_ServerClick(objectsender, EventArgs e)


3814611

#051 {


3814611

#052 //


053 string textcontent this m txtcontent value

#053 stringtextContent=this.m_txtContent.Value;


3814611

#054


055 new lwordservice postlword textcontent

#055 (newLWordService()).PostLWord(textContent);


3814611

#056


3814611

#057 //


058 response redirect listlword aspx true

#058 Response.Redirect("ListLWord.aspx", true);


3814611

#059 }


3814611

...


Tracelword3

TraceLWord3


Namespace tracelword3 weblword

namespaceTraceLWord3.WebLWord


3814611

{


Public class listlword1

public classListLWord


3814611

{


Private void lword databind1

private voidLWord_DataBind()


3814611

{


New lwordservice listlword

(newLWordService()).ListLWord( ... );


3814611

}


3814611

}


Public class postlword1

public classPostLWord


3814611

{


Private void post serverclick object sender eventargs e1

private voidPost_ServerClick(objectsender, EventArgs e)


3814611

{


New lwordservice postlword

(newLWordService()).PostLWord( ... );


3814611

}


3814611

}


3814611

}


Namespace tracelword3 interservice

namespaceTraceLWord3.InterService


3814611

{


Public class lwordtask1

public classLWordTask


3814611

{


Public dataset listlword dataset ds string tablename

publicDataSet ListLWord(DataSet ds, stringtableName)


3814611

{


Return new lwordtask listlword ds tablename

return(newLWordTask()).ListLWord(ds, tableName);


3814611

}


Public void postlword string content

public voidPostLWord(stringcontent)


3814611

{


New lwordtask postlword content

(newLWordTask()).PostLWord(content);


3814611

}


3814611

}


3814611

}


Namespace tracelword3 accesstask

namespaceTraceLWord3.AccessTask


3814611

{


Public class lwordtask2

public classLWordTask


3814611

{


Public dataset listlword dataset ds1

publicDataSet ListLWord(DataSet ds)...


Public void postlword string content1

public voidPostLWord(stringcontent)...


3814611

}


3814611

}


Tracelword3 listlword aspx

TraceLWord3ListLWord.aspx


3814611

TraceLWord5ListLWord.aspxPage_LoadLWord_DataBindLWord_DataBindLWordServiceListLWordLWordService.ListLWordLWordTaskListLWordPostLWord.aspx


3814611


3814611

Web


3814611

ASP.NET WebaspxdllWebASP.NETDuwamish7WebBusinessFacadeDataAccessASP.NETPetShop3.0WebBLLSQLServerDALOracleDALBincess.CNWebForumInterServiceSqlServerTask


3814611

Duwamish7PetShop3.0PetShop3.0PetShop3.0Duwamish7PetShop3.0ModelIDALDALFactoryDuwamish7CommonBincess.CNClassesDbTask


3814611


3814611

Web


N aspx

n.aspx


3814611

n


3814611

n


3814611

n


3814611


3814611

asp.netaspxaspxTraceLWord3ListLWord.aspxListLWord.aspx.csLWordServiceListLWord(DataSet ds)AccessTaskListLWord(DataSet ds)


3814611


3814611


Asp net aspx

asp.netaspx


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611


3814611

TraceLWord3TraceLWord3


Listlword aspx cs

ListLWord.aspx.cs


3814611

...


048 private void lword databind1

#048 privatevoidLWord_DataBind()


3814611

#049 {


050 dataset ds new dataset1

#050 DataSet ds=newDataSet();


051 new lwordservice listlword ds @ lwordtable1

#051 (newLWordService()).ListLWord(ds, @"LWordTable");


3814611

#052


053 m lwordlistctrl datasource ds tables @ lwordtable defaultview1

#053 m_lwordListCtrl.DataSource=ds.Tables[@"LWordTable"].DefaultView;


054 m lwordlistctrl databind1

#054 m_lwordListCtrl.DataBind();


3814611

#055 }


3814611

...


3814611

ListLWord.aspx.csDataSetDataSet#051LWordServiceDataSetDataTableDataTableLWordServiceListLWord


3814611

...


006 namespace tracelword3 interservice1

#006 namespaceTraceLWord3.InterService


3814611

#007 {


3814611

...


011 public class lwordservice1

#011 publicclassLWordService


3814611

#012 {


3814611

...


019 public int listlword dataset ds string tablename1

#019 publicintListLWord(DataSet ds, stringtableName)


3814611

#020 {


021 ds tables clear

#021ds.Tables.Clear();


022 ds tables add new datatable tablename

#022ds.Tables.Add(newDataTable(tableName));


3814611

#023


024 return 1

#024 return1;


3814611

#025 }


3814611

...


Listlword aspx1

ListLWord.aspx


3814611

...


018 asp datalist id m lwordlistctrl runat server1

#018 <asp:DataListID="m_lwordListCtrl"Runat="Server">


019 itemtemplate1

#019 <ItemTemplate>


020 div1

#020 <div><!--// //-->


021 databinder eval container dataitem posttime1

#021 <%# DataBinder.Eval(Container.DataItem, "PostTime") %>


022 databinder eval container dataitem textcontent1

#022 <%# DataBinder.Eval(Container.DataItem, "TextContent") %>


023 div1

#023 </div>


024 itemtemplate1

#024 </ItemTemplate>


025 asp datalist1

#025 </asp:DataList>


3814611

...


3814611


Lwordservice cs1

LWordService.cs


3814611

...


019 public int listlword dataset ds string tablename2

#019 publicintListLWord(DataSet ds, stringtableName)


3814611

#020 {


021 return new lwordtask listlword ds tablename1

#021 return(newLWordTask()).ListLWord(ds, tableName);


3814611

#022 }


3814611

...


3814611

LWordService.csDataSetDataSet#021LWordTaskDataSet#019DataSet#021LWordTaskListLWord


3814611

...


006 namespace tracelword21

#006 namespaceTraceLWord2


3814611

#007 {


3814611

...


011 public class lwordtask1

#011 publicclassLWordTask


3814611

#012 {


3814611

...


022 public int listlword dataset ds string tablename1

#022 publicintListLWord(DataSet ds, stringtableName)


3814611

#023 {


024 ds tables clear

#024 ds.Tables.Clear();


3814611

#025


026 sql reguser lword

#026 // SQL[RegUser] [LWord]


027 string cmdtext select from reguser order by reguserid desc

#027 stringcmdText="SELECT * FROM [RegUser]ORDER BY [RegUserID] DESC";


3814611

#028


029 oledbconnection dbconn new oledbconnection db conn

#029 OleDbConnectiondbConn=newOleDbConnection(DB_CONN);


030 oledbdataadapter dbadp new oledbdataadapter cmdtext dbconn

#030 OleDbDataAdapterdbAdp=newOleDbDataAdapter(cmdText, dbConn);


3814611

#031


032 int count dbadp fill ds tablename

#032 intcount=dbAdp.Fill(ds, tableName);


3814611

#033


034 return count

#034 returncount;


3814611

#035 }


3814611

...


3814611

[RegUser]DataSetLWordService.cs#019DataSet


Lwordtask cs

LWordTask.cs


3814611

...


022 public int listlword dataset ds string tablename2

#022 publicintListLWord(DataSet ds, stringtableName)


3814611

#023 {


024 string cmdtext select from lword order by lwordid desc1

#024 stringcmdText="SELECT * FROM [LWord]ORDER BY [LWordID] DESC";


3814611

#025


026 oledbconnection dbconn new oledbconnection db conn1

#026 OleDbConnectiondbConn=newOleDbConnection(DB_CONN);


027 oledbdataadapter dbadp new oledbdataadapter cmdtext dbconn1

#027 OleDbDataAdapterdbAdp=newOleDbDataAdapter(cmdText, dbConn);


3814611

#028


029 int count dbadp fill ds tablename1

#029 intcount=dbAdp.Fill(ds, tableName);


3814611

#030


031 return count1

#031 returncount;


3814611

#032 }


3814611

...


3814611


3814611

ListLWord.aspxTraceLWord3


3814611


3814611

TraceLWord4ClassesLWord.csJavaClassesBeanCodePackage/TraceLWord4


Lword cs

LWord.cs


001 using system4

#001 usingSystem;


3814611

#002


003 namespace tracelword4 classes

#003 namespaceTraceLWord4.Classes


3814611

#004 {


005 summary

#005 ///<summary>


006 lword

#006 ///LWord


007 summary

#007 ///</summary>


008 public class lword

#008 publicclassLWord


3814611

#009 {


3814611

#010 //


011 private int m uniqueid

#011 privateintm_uniqueID;


3814611

#012 //


013 private string m textcontent

#013 privatestringm_textContent;


3814611

#014 //


015 private datetime m posttime

#015 privateDateTime m_postTime;


3814611

#016


017 region lword

#017 #regionLWord


018 summary1

#018 ///<summary>


019 lword

#019 ///LWord


020 summary

#020 ///</summary>


021 public lword

#021 publicLWord()


3814611

#022 {


3814611

#023 }


3814611

#024


025 summary2

#025 ///<summary>


026 lword

#026 ///LWord


027 summary1

#027 ///</summary>


028 param name uniqueid param

#028 ///<param name="uniqueID"></param>


029 public lword int uniqueid

#029 publicLWord(intuniqueID)


3814611

#030 {


031 this uniqueid uniqueid

#031 this.UniqueID=uniqueID;


3814611

#032 }


033 endregion

#033 #endregion


3814611

#034


035 summary

#035 ///<summary>


3814611

#036 ///


037 summary

#037 ///</summary>


038 public int uniqueid

#038 publicintUniqueID


3814611

#039 {


040 set

#040 set


3814611

#041 {


042 this m uniqueid value 0 0 value

#042this.m_uniqueID=(value<=0? 0: value);


3814611

#043 }


3814611

#044


045 get

#045 get


3814611

#046 {


047 return this m uniqueid

#047 returnthis.m_uniqueID;


3814611

#048 }


3814611

#049 }


3814611

#050


051 summary

#051 ///<summary>


3814611

#052 ///


053 summary

#053 ///</summary>


054 public string textcontent

#054 publicstringTextContent


3814611

#055 {


056 set

#056 set


3814611

#057 {


058 this m textcontent value

#058 this.m_textContent=value;


3814611

#059 }


3814611

#060


061 get

#061 get


3814611

#062 {


063 return this m textcontent

#063 returnthis.m_textContent;


3814611

#064 }


3814611

#065 }


3814611

#066


067 summary

#067 ///<summary>


3814611

#068 ///


069 summary

#069 ///</summary>


070 public datetime posttime

#070 publicDateTime PostTime


3814611

#071 {


072 set

#072 set


3814611

#073 {


074 this m posttime value

#074 this.m_postTime=value;


3814611

#075 }


3814611

#076


077 get

#077 get


3814611

#078 {


079 return this m posttime

#079 returnthis.m_postTime;


3814611

#080 }


3814611

#081 }


3814611

#082 }


3814611

#083 }


Lwordservice lwordtask lwordservice

LWordServiceLWordTaskLWordService


001 using system5

#001usingSystem;


002 using system data2

#002 usingSystem.Data;


3814611

#003


004 using tracelword4 accesstask

#004 usingTraceLWord4.AccessTask;//


005 using tracelword4 classes

#005 usingTraceLWord4.Classes;//


3814611

#006


007 namespace tracelword4 interservice

#007 namespaceTraceLWord4.InterService


3814611

#008 {


009 summary

#009 ///<summary>


010 lwordservice

#010 ///LWordService


011 summary

#011 ///</summary>


012 public class lwordservice

#012 publicclassLWordService


3814611

#013 {


014 summary

#014 ///<summary>


015 lword

#015 ///LWord


016 summary1

#016 ///</summary>


017 returns returns

#017 ///<returns></returns>


018 public lword listlword

#018 publicLWord[] ListLWord()


3814611

#019 {


020 return new lwordtask listlword

#020 return(newLWordTask()).ListLWord();


3814611

#021 }


3814611

#022


023 summary1

#023 ///<summary>


3814611

#024 ///


025 summary3

#025 ///</summary>


026 param name newlword param

#026 ///<param name="newLWord"></param>


027 public void postlword lword newlword

#027 publicvoidPostLWord(LWord newLWord)


3814611

#028 {


029 new lwordtask postlword newlword

#029 (newLWordTask()).PostLWord(newLWord);


3814611

#030 }


3814611

#031 }


3814611

#032 }


3814611

#018ListLWordLWordLWordLWordTextContentPostTimeDataSetLWordTask


001 using system6

#001 usingSystem;


002 using system collections2

#002 usingSystem.Collections;


003 using system data

#003 usingSystem.Data;


004 using system data oledb

#004 usingSystem.Data.OleDb;


005 using system web

#005 usingSystem.Web;


3814611

#006


007 using tracelword4 classes

#007 usingTraceLWord4.Classes;//


3814611

#008


009 namespace tracelword4 accesstask

#009 namespaceTraceLWord4.AccessTask


3814611

#010 {


011 summary1

#011 ///<summary>


012 lwordtask

#012 ///LWordTask


013 summary1

#013 ///</summary>


014 public class lwordtask

#014 publicclassLWordTask


3814611

#015 {


3814611

#016 //


017 private const string db conn @ provider microsoft jet oledb 4 0

#017 privateconststringDB_CONN=@"PROVIDER=Microsoft.Jet.OLEDB.4.0;


Data source c dbfs tracelworddb mdb2

DATA Source=C:\DbFs\TraceLWordDb.mdb";


3814611

#018


019 summary

#019 ///<summary>


020 lword

#020 ///LWord


021 summary

#021 ///</summary>


022 returns returns

#022 ///<returns></returns>


023 public lword listlword

#023 publicLWord[] ListLWord()


3814611

#024 {


3814611

#025 //


026 arraylist lwordlist new arraylist

#026 ArrayList lwordList=newArrayList();


3814611

#027


028 string cmdtext select from lword order by lwordid desc

#028 stringcmdText="SELECT * FROM [LWord] ORDER BY [LWordID] DESC";


3814611

#029


030 oledbconnection dbconn new oledbconnection db conn

#030 OleDbConnection dbConn=newOleDbConnection(DB_CONN);


031 oledbcommand dbcmd new oledbcommand cmdtext dbconn

#031 OleDbCommand dbCmd=newOleDbCommand(cmdText, dbConn);


3814611

#032


033 try

#033 try


3814611

#034 {


035 dbconn open

#035 dbConn.Open();


036 oledbdatareader dr dbcmd executereader

#036 OleDbDataReader dr=dbCmd.ExecuteReader();


3814611

#037


038 while dr read

#038 while(dr.Read())


3814611

#039 {


040 lword lword new lword

#040 LWord lword=newLWord();


3814611

#041


3814611

#042 //


043 lword uniqueid int dr lwordid

#043 lword.UniqueID=(int)dr["LWordID"];


3814611

#044 //


045 lword textcontent string dr textcontent

#045 lword.TextContent=(string)dr["TextContent"];


3814611

#046 //


047 lword posttime datetime dr posttime

#047 lword.PostTime=(DateTime)dr["PostTime"];


3814611

#048


3814611

#049 //


050 lwordlist add lword

#050 lwordList.Add(lword);


3814611

#051 }


3814611

#052 }


053 catch

#053 catch


3814611

#054 {


3814611


Arraylist

ArrayList


055 throw

#055 throw;


3814611

#056 }


057 finally

#057 finally


3814611

#058 {


059 dbconn close

#059 dbConn.Close();


3814611

#060 }


3814611

#061


3814611

#062 //


063 return lword lwordlist toarray typeof tracelword4 classes lword

#063 return(LWord[])lwordList.ToArray(typeof(TraceLWord4.Classes.LWord));


3814611

#064 }


3814611

#065


066 summary

#066 ///<summary>


3814611

#067 ///


068 summary

#068 ///</summary>


069 param name newlword param

#069 ///<param name="newLWord"></param>


070 public void postlword lword newlword

#070 publicvoidPostLWord(LWord newLWord)


3814611

#071 {


3814611

#072 //


073 if newlword null newlword textcontent null newlword textcontent

#073 if(newLWord==null|| newLWord.TextContent==null|| newLWord.TextContent=="")


074 throw new exception

#074 thrownewException("");


3814611

#075


076 string cmdtext insert into lword textcontent values @textcontent

#076 stringcmdText="INSERT INTO [LWord]([TextContent]) VALUES(@TextContent)";


3814611

#077


078 oledbconnection dbconn new oledbconnection db conn

#078 OleDbConnection dbConn=newOleDbConnection(DB_CONN);


079 oledbcommand dbcmd new oledbcommand cmdtext dbconn

#079 OleDbCommand dbCmd=newOleDbCommand(cmdText, dbConn);


3814611

#080


3814611

#081 //


082 dbcmd parameters add new oledbparameter @textcontent

#082 dbCmd.Parameters.Add(newOleDbParameter("@TextContent",


Oledbtype longvarwchar1

OleDbType.LongVarWChar));


083 dbcmd parameters @textcontent value newlword textcontent

#083 dbCmd.Parameters["@TextContent"].Value=newLWord.TextContent;


3814611

#084


085 try

#085 try


3814611

#086 {


087 dbconn open

#087 dbConn.Open();


088 dbcmd executenonquery

#088 dbCmd.ExecuteNonQuery();


3814611

#089 }


090 catch

#090 catch


3814611

#091 {


092 throw

#092 throw;


3814611

#093 }


094 finally

#094 finally


3814611

#095 {


096 dbconn close

#096 dbConn.Close();


3814611

#097 }


3814611

#098 }


3814611

#099 }


3814611

#100 }


3814611

LWordTask.csListLWords[RegUser]LWordLWordLWordTextContentDuwamish7CommonBincess.CNPetShop3.0PetShop3.0ModalBincess.CNClasses


3814611


3814611

TraceLWord4MS SQL Server 2000Access 2000MS SqlServer 2000AccessTaskAccess 2000AccessTaskMS SQL Server 2000Access 2000MS SQL Server 2000TraceLWord4Access 2000MS SQL Server 2000MS SQL Server 2000Access 2000TraceLWord4Access 2000MS SQL Server 2000TraceLWord4MS SQL Server 2000


3814611

TraceLWord5SqlServerTaskMS SQL Server 2000DALFactoryDbTaskDriver.csTraceLWord5


Tracelword5 codepackage tracelword5

TraceLWord5CodePackage/TraceLWord5


3814611

DALFactoryDbTaskDriverDALFactory


3814611

//


Public class fruit

publicclassFruit;


3814611

//


Public class apple fruit

public classApple : Fruit;


3814611

//


Public class orange fruit

public classOrange: Fruit; //


Public class fruitfactory

public classFruitFactory


3814611

{


3814611

//


Public static fruit createinstance string fruitname

public staticFruit CreateInstance(stringfruitName)


3814611

{


If fruitname apple

if(fruitName=="APPLE")


Return new apple

return newApple();


Else if fruitename orange

else if(fruiteName=="ORANGE")


Return new orange

return newOrange();


3814611

else


Return null

return null;


3814611

}


3814611

}


Apple new apple

// Applenew Apple();


Apple anapple apple fruitfactory createinstance apple

Apple anApple=(Apple)FruitFactory.CreateInstance("APPLE");


Orange new orange

// Orangenew Orange();


Orange anorange orange fruitfactory createinstance orange

Orange anOrange=(Orange)FruitFactory.CreateInstance(" ORANGE");


3814611

RTTIRunTime Type IdentificationVisual C#.NETSystem.ReflectionC#C#.NETUML


Dbtaskdriver cs dalfactory

DbTaskDriver.csDALFactory


001 using system7

#001 usingSystem;


002 using system configuration

#002 usingSystem.Configuration;


003 using system reflection net

#003 usingSystem.Reflection;// .NET


3814611

#004


005 namespace tracelword5 dalfactory

#005 namespaceTraceLWord5.DALFactory


3814611

#006 {


007 summary1

#007 ///<summary>


008 dbtaskdriver

#008 ///DbTaskDriver


009 summary1

#009 ///</summary>


010 public class dbtaskdriver

#010 publicclassDbTaskDriver


3814611

#011 {


012 dbtaskdriver

#012DbTaskDriver


3814611

#020


021 summary1

#021 ///<summary>


3814611

#022 ///


023 summary2

#023 ///</summary>


024 public object drivelwordtask

#024 publicobjectDriveLWordTask()


3814611

#025 {


3814611

#026 //


027 string assemblyname configurationsettings appsettings assemblyname

#027 stringassemblyName=ConfigurationSettings.AppSettings["AssemblyName"];


3814611

#028 //


029 string constructor configurationsettings appsettings constructor

#029 stringconstructor=ConfigurationSettings.AppSettings["Constructor"];


3814611

#030


031 accesstask sqlservertask

#031 // AccessTask SqlServerTask


032 return assembly load assemblyname createinstance constructor false

#032 returnAssembly.Load(assemblyName).CreateInstance(constructor, false);


3814611

#033 }


3814611

#034 }


3814611

#035 }


Lwordservice cs2

LWordService.cs


001 using system8

#001 usingSystem;


002 using system data3

#002 usingSystem.Data;


3814611

#003


004 using tracelword5 accesstask

#004 usingTraceLWord5.AccessTask;


005 using tracelword5 classes

#005 usingTraceLWord5.Classes;//


006 using tracelword5 dalfactory

#006 usingTraceLWord5.DALFactory;//


007 using tracelword5 sqlservertask

#007 usingTraceLWord5.SqlServerTask;


3814611

#008


009 namespace tracelword5 interservice

#009 namespaceTraceLWord5.InterService


3814611

#010 {


3814611

...


014 public class lwordservice

#014 publicclassLWordService


3814611

#015 {


3814611

...


020 public lword listlword

#020 publicLWord[] ListLWord()


3814611

#021 {


022 object dbtask new dbtaskdriver drivelwordtask

#022 objectdbTask=(newDbTaskDriver()).DriveLWordTask();


3814611

#023


024 access

#024 // Access


025 if dbtask is accesstask lwordtask

#025 if(dbTask isAccessTask.LWordTask)


026 return accesstask lwordtask dbtask listlword

#026 return((AccessTask.LWordTask)dbTask).ListLWord();


3814611

#027


028 ms sql server

#028 // MS SQL Server


029 if dbtask is sqlservertask lwordtask

#029 if(dbTask isSqlServerTask.LWordTask)


030 return sqlservertask lwordtask dbtask getlwords

#030 return((SqlServerTask.LWordTask)dbTask).GetLWords();


3814611

#031


032 return null

#032 returnnull;


3814611

#033 }


3814611

...


039 public void postlword lword newlword

#039 publicvoidPostLWord(LWord newLWord)


3814611

#040 {


041 object dbtask new dbtaskdriver drivelwordtask

#041 objectdbTask=(newDbTaskDriver()).DriveLWordTask();


3814611

#042


043 access

#043 // Access


044 if dbtask is accesstask lwordtask

#044 if(dbTask isAccessTask.LWordTask)


045 accesstask lwordtask dbtask postlword newlword

#045 ((AccessTask.LWordTask)dbTask).PostLWord(newLWord);


3814611

#046


047 ms sql server

#047 // MS SQL Server


048 if dbtask is sqlservertask lwordtask

#048 if(dbTask isSqlServerTask.LWordTask)


049 sqlservertask lwordtask dbtask addnewlword newlword

#049 ((SqlServerTask.LWordTask)dbTask).AddNewLWord(newLWord);


3814611

#050 }


3814611

#051 }


3814611

#052 }


Accesstask sqlservertask lwordtask cs

AccessTaskSqlServerTaskLWordTask.cs


001 using system9

#001 usingSystem;


002 using system collections3

#002 usingSystem.Collections;


003 using system data1

#003 usingSystem.Data;


004 using system data sqlclient ms sql server

#004 usingSystem.Data.SqlClient;// MS SQL Server


005 using system web1

#005 usingSystem.Web;


3814611

#006


007 using tracelword5 classes

#007 usingTraceLWord5.Classes;//


3814611

#008


009 namespace tracelword5 sqlservertask

#009 namespaceTraceLWord5.SqlServerTask


3814611

#010 {


011 summary2

#011 ///<summary>


012 lwordtask1

#012 ///LWordTask


013 summary2

#013 ///</summary>


014 public class lwordtask1

#014 publicclassLWordTask


3814611

#015 {


3814611

#016 //


017 private const string db conn @ server 127 0 0 1 uid sa pwd

#017 privateconststringDB_CONN=@"Server=127.0.0.1; uid=sa; pwd=;


Database tracelworddb

DataBase=TraceLWordDb";


3814611

#018


019 summary1

#019 ///<summary>


020 lword1

#020 ///LWord


021 summary2

#021 ///</summary>


022 returns returns1

#022 ///<returns></returns>


023 public lword getlwords

#023 publicLWord[] GetLWords()


3814611

#024 {


3814611

#025 //


026 arraylist lwordlist new arraylist1

#026 ArrayList lwordList=newArrayList();


3814611

#027


028 string cmdtext select from lword order by lwordid desc1

#028 stringcmdText="SELECT * FROM [LWord] ORDER BY [LWordID] DESC";


3814611

#029


030 sqlconnection dbconn new sqlconnection db conn

#030 SqlConnectiondbConn=newSqlConnection(DB_CONN);


031 sqlcommand dbcmd new sqlcommand cmdtext dbconn

#031 SqlCommanddbCmd=newSqlCommand(cmdText, dbConn);


3814611

#032


033 try1

#033 try


3814611

#034 {


035 dbconn open1

#035 dbConn.Open();


036 sqldatareader dr dbcmd executereader

#036 SqlDataReader dr=dbCmd.ExecuteReader();


3814611

#037


038 while dr read1

#038 while(dr.Read())


3814611

#039 {


040 lword lword new lword1

#040 LWord lword=newLWord();


3814611

#041


3814611

#042 //


043 lword uniqueid int dr lwordid1

#043 lword.UniqueID=(int)dr["LWordID"];


3814611

#044 //


045 lword textcontent string dr textcontent1

#045 lword.TextContent=(string)dr["TextContent"];


3814611

#046 //


047 lword posttime datetime dr posttime1

#047 lword.PostTime=(DateTime)dr["PostTime"];


3814611

#048


3814611

#049 //


050 lwordlist add lword1

#050 lwordList.Add(lword);


3814611

#051 }


3814611

#052 }


053 catch1

#053 catch


3814611

#054 {


055 throw1

#055 throw;


3814611

#056 }


057 finally1

#057 finally


3814611

#058 {


059 dbconn close1

#059 dbConn.Close();


3814611

#060 }


3814611

#061


3814611

#062 //


063 return lword lwordlist toarray typeof tracelword5 classes lword

#063 return(LWord[])lwordList.ToArray(typeof(TraceLWord5.Classes.LWord));


3814611

#064 }


3814611

#065


066 summary1

#066 ///<summary>


3814611

#067 ///


068 summary1

#068 ///</summary>


069 param name newlword param1

#069 ///<param name="newLWord"></param>


070 public void addnewlword lword newlword

#070 publicvoidAddNewLWord(LWord newLWord)


3814611

#071 {


3814611

#072 //


073 if newlword null newlword textcontent null newlword textcontent1

#073 if(newLWord==null|| newLWord.TextContent==null|| newLWord.TextContent=="")


074 throw new exception1

#074 thrownewException("");


3814611

#075


076 string cmdtext insert into lword textcontent values @textcontent1

#076 stringcmdText="INSERT INTO [LWord]([TextContent]) VALUES(@TextContent)";


3814611

#077


078 sqlconnection dbconn new sqlconnection db conn

#078 SqlConnectiondbConn=newSqlConnection(DB_CONN);


079 sqlcommand dbcmd new sqlcommand cmdtext dbconn

#079 SqlCommanddbCmd=newSqlCommand(cmdText, dbConn);


3814611

#080


3814611

#081 //


082 dbcmd parameters add new sqlparameter @textcontent sqldbtype ntext

#082 dbCmd.Parameters.Add(newSqlParameter("@TextContent", SqlDbType.NText));


083 dbcmd parameters @textcontent value newlword textcontent1

#083 dbCmd.Parameters["@TextContent"].Value=newLWord.TextContent;


3814611

#084


085 try1

#085 try


3814611

#086 {


087 dbconn open1

#087 dbConn.Open();


088 dbcmd executenonquery1

#088 dbCmd.ExecuteNonQuery();


3814611

#089 }


090 catch1

#090 catch


3814611

#091 {


092 throw1

#092 throw;


3814611

#093 }


094 finally1

#094 finally


3814611

#095 {


096 dbconn close1

#096 dbConn.Close();


3814611

#097 }


3814611

#098 }


3814611

#099 }


3814611

#100 }


Sqlservertask lwordtask

SqlServerTaskLWordTask


Tracelword5 web config

TraceLWord5Web.Config


001 xml version 1 0 encoding utf 8

#001 <?xmlversion="1.0"encoding="utf-8"?>


002 configuration

#002 <configuration>


3814611

#003


004 system web

#004 <system.web>


005 identity impersonate true

#005 <identityimpersonate="true"/>


006 compilation defaultlanguage c debug true

#006 <compilationdefaultLanguage="c#"debug="true"/>


007 customerrors mode remoteonly

#007 <customErrorsmode="RemoteOnly"/>


008 system web

#008 </system.web>


3814611

#009


010 appsettings

#010 <appSettings>


3814611

...


026 sqlserver 2000

#026 <!--// SQLServer 2000 //-->


027 add key assemblyname

#027 <addkey="AssemblyName"


028 value tracelword5 sqlservertask

#028 value="TraceLWord5.SqlServerTask"/>


029 add key constructor

#029 <addkey="Constructor"


030 value tracelword5 sqlservertask lwordtask

#030 value="TraceLWord5.SqlServerTask.LWordTask"/>


3814611

#031


032 appsettings

#032 </appSettings>


3814611

#033


034 configuration

#034 </configuration>


3814611


Tracelword5 listlword aspx

TraceLWord5ListLWord.aspx


3814611

TraceLWord5ListLWord.aspxPage_LoadLWord_DataBindLWord_DataBindLWordServiceListLWordLWordService.ListLWordDALFactory.DbTaskDriverDriveLWordTaskDriveLWordTaskLWordService.ListLWordGetLWordsPostLWord.aspx


3814611


3814611


3814611

TraceLWord5TraceLWord5InsetServiceOracle9iOracleTaskLWordServiceOracleTask


3814611

...


020 public lword listlword1

#020 publicLWord[] ListLWord()


3814611

#021 {


022 object dbtask new dbtaskdriver drivelwordtask1

#022 objectdbTask=(newDbTaskDriver()).DriveLWordTask();


3814611

#023


024 access1

#024 // Access


025 if dbtask is accesstask lwordtask1

#025 if(dbTask isAccessTask.LWordTask)


026 return accesstask lwordtask dbtask listlword1

#026 return((AccessTask.LWordTask)dbTask).ListLWord();


3814611

#027


028 ms sql server1

#028 // MS SQL Server


029 if dbtask is sqlservertask lwordtask1

#029 if(dbTask isSqlServerTask.LWordTask)


030 return sqlservertask lwordtask dbtask getlwords1

#030 return((SqlServerTask.LWordTask)dbTask).GetLWords();


3814611

#031


032 oracle

#032 // Oracle


033 if dbtask is oracletask lwordtask

#033 if(dbTask isOracleTask.LWordTask)


034 return oracletask lwordtask dbtask fetchlwords

#034 return((OracleTask.LWordTask)dbTask).FetchLWords();


3814611

#035


036 return null

#036 returnnull;


3814611

#037 }


3814611

#038


3814611

...


3814611

AccessTaskListLWordSqlServerTaskGetLWordsOracleTaskFetchLWords


3814611


3814611

TraceLWord5TraceLWord5TraceLWord5DALFactoryDbTaskDriverListLWordPostLWord


3814611


3814611

TraceLWord6DbTaskILWordTask.csDbTaskCodePackage/TraceLWord6


Dbtask ilwordtask cs

DbTaskILWordTask.cs


001 using system10

#001 usingSystem;


3814611

#002


003 using tracelword6 classes

#003 usingTraceLWord6.Classes;//


3814611

#004


005 namespace tracelword6 dbtask

#005 namespaceTraceLWord6.DbTask


3814611

#006 {


3814611

...


010 public interface ilwordtask

#010 publicinterfaceILWordTask


3814611

#011 {


3814611

#012 //


013 lword listlword

#013 LWord[] ListLWord();


3814611

#014


3814611

#015 //


016 void postlword lword newlword

#016 voidPostLWord(LWord newLWord);


3814611

#017 }


3814611

#018 }


Accesstask lwordtask cs

AccessTaskLWordTask.cs


3814611

...


007 using tracelword6 classes

#007 usingTraceLWord6.Classes;//


008 using tracelword6 dbtask

#008 usingTraceLWord6.DbTask;//


3814611

#009


010 namespace tracelword6 accesstask

#010 namespaceTraceLWord6.AccessTask


3814611

#011 {


3814611

...


015 public class lwordtask ilwordtask ilwordtask

#015 publicclassLWordTask : ILWordTask// ILWordTask


3814611

#016 {


3814611

...


024 public lword listlword

#024 publicLWord[] ListLWord()...


3814611

...


071 public void postlword lword newlword

#071 publicvoidPostLWord(LWord newLWord)...


3814611

...


3814611

#099 }


3814611

#100 }


Sqlservertask lwordtask cs

SqlServerTaskLWordTask.cs


3814611

...


007 using tracelword6 classes1

#007 usingTraceLWord6.Classes;//


008 using tracelword6 dbtask1

#008 usingTraceLWord6.DbTask;//


3814611

#009


010 namespace tracelword6 sqlservertask

#010 namespaceTraceLWord6.SqlServerTask


3814611

#011 {


3814611

...


015 public class lwordtask ilwordtask ilwordtask1

#015publicclassLWordTask : ILWordTask// ILWordTask


3814611

#016 {


3814611

...


024 public lword listlword1

#024 publicLWord[] ListLWord()...


3814611

...


071 public void postlword lword newlword1

#071 publicvoidPostLWord(LWord newLWord)...


3814611

...


3814611

#100 }


3814611

#101 }


3814611

AccessTaskLWordTaskILWordTaskListLWordPostLWordSqlServerTaskLWordTaskILWordTaskListLWordPostLWordILWordTask


Dalfactory dbtaskdriver cs

DALFactoryDbTaskDriver.cs


3814611

...


026 public ilwordtask drivelwordtask

#026 publicILWordTask DriveLWordTask()


3814611

#027 {


3814611

#028 //


029 string assemblyname configurationsettings appsettings assemblyname

#029 stringassemblyName=ConfigurationSettings.AppSettings["AssemblyName"];


3814611

#030 //


031 string constructor configurationsettings appsettings constructor

#031 stringconstructor=ConfigurationSettings.AppSettings["Constructor"];


3814611

#032


033 ilwordtask

#033 // ILWordTask


034 return ilwordtask assembly load assemblyname createinstance constructor

#034 return(ILWordTask)Assembly.Load(assemblyName).CreateInstance(constructor,


False

false);


3814611

...


3814611

AccessTaskLWordTaskSqlServerTaskLWordTaskILWordTask#034ListLWordPostLWordInterServiceLWordService.cs


3814611

...


008 namespace tracelword6 interservice

#008 namespaceTraceLWord6.InterService


3814611

#009 {


3814611

...


013 public class lwordservice

#013 publicclassLWordService


3814611

#014 {


015 summary3

#015 ///<summary>


016 lword

#016 ///LWord


017 summary2

#017 ///</summary>


018 returns returns1

#018 ///<returns></returns>


019 public lword listlword

#019 publicLWord[] ListLWord()


3814611

#020 {


021 return new dbtaskdriver drivelwordtask listlword

#021 return(newDbTaskDriver()).DriveLWordTask().ListLWord();


3814611

#022 }


3814611

#023


024 summary1

#024 ///<summary>


3814611

#025 ///


026 summary1

#026 ///</summary>


027 param name newlword param

#027 ///<param name="newLWord"></param>


028 public void postlword lword newlword

#028 publicvoidPostLWord(LWord newLWord)


3814611

#029 {


030 new dbtaskdriver drivelwordtask postlword newlword

#030 (newDbTaskDriver()).DriveLWordTask().PostLWord(newLWord);


3814611

#031 }


3814611

#032 }


3814611

#033 }


3814611


Listlword aspx tracelword6 listlword aspx listlword aspx cs

ListLWord.aspxTraceLWord6ListLWord.aspxListLWord.aspx.cs


3814611

...


3814611

#021 //


022 protected system web ui webcontrols datalist m lwordlistctrl

#022 protectedSystem.Web.UI.WebControls.DataList m_lwordListCtrl;


3814611

#023


024 summary2

#024 ///<summary>


025 listlword aspx

#025 ///ListLWord.aspx


3814611

1


3814611

2


3814611

3


3814611

7


3814611

8


026 summary2

#026 ///</summary>


027 private void page load object sender system eventargs e

#027 privatevoidPage_Load(objectsender, System.EventArgs e)


3814611

#028 {


029 lword databind

#029 LWord_DataBind();


3814611

#030 }


3814611

...


045 summary1

#045 ///<summary>


3814611

#046 ///


047 summary2

#047 ///</summary>


048 private void lword databind2

#048 privatevoidLWord_DataBind()


3814611

#049 {


050 m lwordlistctrl datasource new lwordservice listlword

#050 m_lwordListCtrl.DataSource=(newLWordService()).ListLWord();


051 m lwordlistctrl databind

#051 m_lwordListCtrl.DataBind();


3814611

#052 }


3814611

...


Interservice lwordservice

InterServiceLWordService


3814611

...


008 namespace tracelword6 interservice1

#008 namespaceTraceLWord6.InterService


3814611

#009 {


3814611

...


013 public class lwordservice1

#013 publicclassLWordService


016 lword1

#016 ///LWord


017 summary3

#017 ///</summary>


018 returns returns2

#018 ///<returns></returns>


019 public lword listlword1

#019 publicLWord[] ListLWord()


3814611

#020 {


021 return new dbtaskdriver drivelwordtask listlword1

#021 return(newDbTaskDriver()).DriveLWordTask().ListLWord();


3814611

#022 }


3814611

...


3814611

#032 }


3814611

#033 }


3814611


001 xml version 1 0 encoding utf 81

#001 <?xmlversion="1.0"encoding="utf-8"?>


002 configuration1

#002 <configuration>


3814611

...


010 appsettings1

#010 <appSettings>


3814611

...


026 sqlserver 20001

#026 <!--// SQLServer 2000 //-->


027 add key assemblyname1

#027 <addkey="AssemblyName"


028 value tracelword6 sqlservertask

#028 value="TraceLWord6.SqlServerTask"/>


029 add key constructor1

#029 <addkey="Constructor"


030 value tracelword6 sqlservertask lwordtask

#030 value="TraceLWord6.SqlServerTask.LWordTask"/>


3814611

#031


032 appsettings1

#032 </appSettings>


3814611

#033


034 configuration1

#034 </configuration>


Dbtaskdriver

DbTaskDriver


Web config net

Web.Config.NET


3814611

...


007 namespace tracelword6 dalfactory

#007 namespaceTraceLWord6.DALFactory


3814611

#008 {


3814611

...


012 public class dbtaskdriver

#012 publicclassDbTaskDriver


3814611

#013 {


3814611

...


023 summary3

#023 ///<summary>


3814611

#024 ///


025 summary4

#025 ///</summary>


026 public ilwordtask drivelwordtask1

#026 publicILWordTask DriveLWordTask()


3814611

#027 {


3814611

#028 //


029 string assemblyname configurationsettings appsettings assemblyname1

#029 stringassemblyName=ConfigurationSettings.AppSettings["AssemblyName"];


3814611

#030 //


031 string constructor configurationsettings appsettings constructor1

#031 stringconstructor=ConfigurationSettings.AppSettings["Constructor"];


3814611

#032


033 ilwordtask1

#033 // ILWordTask


034 return ilwordtask assembly load assemblyname createinstance constructor1

#034 return(ILWordTask)Assembly.Load(assemblyName).CreateInstance(constructor,


False1

false);


3814611

#035 }


3814611

#036 }


3814611

#037 }


Tracelword6 sqlservertask lwordtask

TraceLWord6.SqlServerTask.LWordTask


3814611

...


010 namespace tracelword6 sqlservertask1

#010 namespaceTraceLWord6.SqlServerTask


3814611

#011 {


3814611

...


015 public class lwordtask ilwordtask

#015 publicclassLWordTask : ILWordTask


3814611

#016 {


3814611

...


020 summary1

#020 ///<summary>


021 lword

#021 ///LWord


022 summary

#022 ///</summary>


023 returns returns

#023 ///<returns></returns>


024 public lword listlword2

#024 publicLWord[] ListLWord()...


3814611

...


3814611

#100 }


3814611

#101 }


3814611


3814611

...


018 asp datalist id m lwordlistctrl runat server2

#018 <asp:DataListID="m_lwordListCtrl"Runat="Server">


019 itemtemplate2

#019 <ItemTemplate>


020 div2

#020 <div>


021 databinder eval container dataitem posttime2

#021 <%# DataBinder.Eval(Container.DataItem, "PostTime") %>


022 databinder eval container dataitem textcontent2

#022 <%# DataBinder.Eval(Container.DataItem, "TextContent") %>


023 div2

#023 </div>


024 itemtemplate2

#024 </ItemTemplate>


025 asp datalist2

#025 </asp:DataList>


3814611

...


3814611

Web


3814611


3814611

2000944@


Tracelword7 rules

TraceLWord7Rules

  • n09111317

  • n40


Codepackage tracelword7

CodePackage/TraceLWord7


3814611


Lwordrules cs

LWordRules.cs


001 using system11

#001 usingSystem;


3814611

#002


003 using tracelword7 classes

#003 usingTraceLWord7.Classes;


004 using tracelword7 dalfactory

#004 usingTraceLWord7.DALFactory;


005 using tracelword7 dbtask

#005 usingTraceLWord7.DbTask;


3814611

#006


007 namespace tracelword7 rules

#007 namespaceTraceLWord7.Rules


3814611

#008 {


009 summary2

#009 ///<summary>


010 lwordrules

#010 ///LWordRules


011 summary3

#011 ///</summary>


012 public class lwordrules

#012 publicclassLWordRules


3814611

#013 {


014 summary1

#014 ///<summary>


3814611

#015 ///


016 summary2

#016 ///</summary>


017 returns returns1

#017 ///<returns></returns>


018 public static bool canpostlword

#018 publicstaticboolCanPostLWord()


3814611

#019 {


3814611

...


027 datetime currtime datetime now

#027 DateTime currTime=DateTime.Now;


3814611

#028


029 09 11

#029 // 09 11


030 13 17

#030 // 13 17


031 if currtime hour 8 currtime hour 11 currtime hour 12 currtime hour 17

#031 if(currTime.Hour<=8|| (currTime.Hour>=11&& currTime.Hour<=12) || currTime.Hour>=17)


032 return false

#032 returnfalse;


3814611

#033


3814611

#034 //


035 lword lwords new dbtaskdriver drivelwordtask listlword

#035 LWord[] lwords=(newDbTaskDriver()).DriveLWordTask().ListLWord(


036 currtime date currtime date adddays 1

#036 currTime.Date, currTime.Date.AddDays(1));


3814611

#037


038 40

#038 // 40


039 if lwords null lwords length 40

#039 if(lwords==null|| lwords.Length<40)


040 return true

#040 returntrue;


3814611

#041


042 return false

#042 returnfalse;


3814611

#043 }


3814611

#044 }


3814611

#045 }


Lwordservice cs3

LWordService.cs


025 summary5

#025 ///<summary>


3814611

#026 ///


027 summary2

#027 ///</summary>


028 param name newlword param

#028 ///<param name="newLWord"></param>


029 public void postlword lword newlword

#029 publicvoidPostLWord(LWord newLWord)


3814611

#030 {


031 if lwordrules canpostlword

#031 if(!LWordRules.CanPostLWord())


032 throw new exception

#032 thrownewException("");


3814611

#033


034 new dbtaskdriver drivelwordtask postlword newlword

#034 (newDbTaskDriver()).DriveLWordTask().PostLWord(newLWord);


3814611

#035 }


3814611


3814611


3814611


3814611

TraceLWord1TraceLWord2ADO.NETTraceLWord6


3814611


3814611


3814611


3814611

40


3814611


Afritxia 01 18 2005

AfritXia01.18/2005


Afritxia

AfritXia


Http www afritxia net http www bincess cn

http://www.afritxia.net/http://www.bincess.cn/


Afritxia@hotmail com afritxia@bincess cn afritxia2003@yahoo com cn

[email protected]@[email protected]


365410315

365410315


  • Login