if (custTypeId == 1) //錯誤
int ORG_CUST_TYPE_ID = 1;
if (custTypeId == ORG_CUST_TYPE_ID) //正確
|
int number = SomeMethod();
switch(number)
{
case 1:
Trace.WriteLine("Case 1:");
break;
case 2:
Trace.WriteLine("Case 2:");
break;
default :
Debug.Assert(false);
break;
}
|
SELECT A.ID, A.NAME, B.ID B_ID, B.NAME B_NAME
FROM CLASS A, SCHOOL B
WHERE A.SCHOOL_ID = B.ID
AND A.STATE = ‘10A’
AND B.STATE = ‘10A’
|
#region Copyright Ztesoft 2004
//
// All rights are reserved. Reproduction or transmission in whole or in part, in
// any form or by any means, electronic, mechanical or otherwise, is prohibited
// without the prior written consent of the copyright owner.
//
// Filename: PatientList.cs
// Author: TangXing
// CreateDate: 2004-08-25
//
// Modified By TangXing
// ChangedDate: 2004-08-27
// Reason: BugId=555
//
#endregion
using System;
using System.Collections;
namespace Ztesoft.BS.PatientList
{
/// <summary>
/// Objects of this class manage a list of patients and their history.
/// </summary>
/// <remarks>
/// This class relies on the <see cref="Patient"/>class.
/// </remarks>
/// <seealso cref="Patient"/>
public class PatientList
{
/// <summary>Holds a list of Patient objects.</summary>
private ArrayList list = new ArrayList();
/// <summary>Maximum number of patients supported.</summary>
private const uint maxPatients = 100;
/// <summary>Defines the gender of the patient.</summary>
public enum Gender
{
/// <summary>The patient is a male.</summary>
Male,
/// <summary>The patient is a female.</summary>
Female,
/// <summary>A phantom object used for testing</summary>
Phantom
}
/// <overloads>
/// Adds new patients to the list.
/// </overloads>
/// <summary>
/// Adds a new patient to the end of the current list.
/// </summary>
/// <remarks>
/// The actual data of the Patient object is not checked or changed.
/// </remarks>
/// <exception cref="NullReferenceException">
/// The <paramref name="patient"/> argument was null.
/// </exception>
/// <param name="patient">The patient object to add.</param>
/// <returns>
/// <b>true</b> if the patient was added, </b>false</b> if the list is
/// full.
/// </returns>
public bool Add(Patient patient)
{
if (null == patient)
{
throw new NullReferenceException(
"patient argument must not be null");
}
bool success = false;
if (list.Count < maxPatients)
{
list.Add(patient);
success = true;
// Raise the event and pass the new patient to the event
// handler.
Added(this, new PatientAddedEventArgs(patient));
}
return success;
}
/// <summary>
/// Adds a new patient at the specified index in the list.
/// </summary>
/// <remarks>
/// The following rules apply.
/// <list type="bullet">
/// <item>
/// The actual data of the Patient object is not checked or
/// changed.
/// </item>
/// <item>
/// The item at the specified <paramref name="index"/> will be
/// moved one place up.
/// </item>
/// </list>
/// </remarks>
/// <exception cref="NullReferenceException">
/// The <paramref name="patient"/> argument was null.
/// </exception>
/// <exception cref="IndexOutOfBounds">
/// The index was invalid.
/// </exception>
/// <param name="patient">The patient object to add.</param>
/// <param name="index">The index to use for inserting.</param>
/// <returns>
/// true if the patient was added, false if the list is full.
/// </returns>
public bool Add(Patient patient, int index)
{
// Code left out for brevity.
}
/// <summary>
/// Searches the contents of the list for patients of a certain gender.
/// </summary>
/// <param name="gender">The gender to use during matching.</param>
/// <returns>
/// Returns an array of <see cref="Patient"/>objects or <b>null</b> if
/// no items have been found.
/// </returns>
public Patient[] GetPatientsByGender(Gender gender)
{
// Code left out for brevity.
}
/// <summary>
/// Gets a value indicating the size of the list.
/// </summary>
/// <value>
/// The current number of entries in the list.
/// </value>
public uint Count
{
get
{
return list.Count;
}
}
/// <summary>
/// Occurs when a new patient is added to the list.
/// </summary>
/// <remarks>
/// This event typically occurs when <see cref="Add"/>has successfully
/// added a new patient. The data is passed through an instance of the
/// <see cref=”PatientAddedEventArgs”/>class.
/// </remarks>
public event EventHandler Added;
}
/// <summary>
/// Holds the data associated with the <see cref="Added"/>event.
/// </summary>
public class PatientAddedEventArgs : EventArgs
{
public PatientAddedEventArgs(Patient newPatient)
{
// Code left out for brevity
}
/// Remainder of the class left out for brevity...
}
}
|
標示符
|
大小寫
|
示例/說明
|
namespace
|
Pascal
|
Ztesoft.BS.Model,以公司名.模塊名[.功能[.設計]]命名
|
class
|
Pascal
|
AppDomain
|
enum
|
Pascal
|
ErrorLevel,enum內的值按照常量來編碼
|
delegate
|
Pascal
|
MouseEventHandler,以Handler爲後綴
|
event
|
Pascal
|
ValueChanged
|
Exception
|
Pascal
|
Exception爲後綴
|
常量
|
全部大寫
|
RED_VALUE
|
接口
|
Pascal
|
IDisposable,總是以I開頭
|
方法
|
Pascal
|
ToString
|
參數
|
camel
|
typeName
|
屬性(Property)
|
Pascal
|
BackColor
|
受保護的實例字段(Field)
|
camel
|
backColor
注意:很少使用。屬性優於使用受保護的實例字段。
|
公用實例字段(Field)
|
Pascal
|
BackColor
注意:很少使用。屬性優於使用公用實例字段。
|
Attribute
|
Pascal
|
XmlElementAttribute,最後要以Attribute結束
|
SECTION TAGS
|
描述
|
位置
|
<summary>
|
簡短描述
|
type or member
|
<remarks>
|
描述前提條件和其他附加信息
|
type or member
|
<param>
|
描述method的參數
|
method
|
<return>
|
描述method的返回值
|
method
|
<exception>
|
方法或者屬性可能拋出的異常列表
|
method,event or property
|
<value>
|
描述property能夠接受的或者返回的數據類型
|
property
|
<example>
|
type或者member的範例(代碼或者文本)
|
type or
|
<seealso>
|
增加一個實體到See Also段
|
type or member
|
<overload>
|
爲method的overload提供一個摘要
|
在重載列表中的第一個方法
|
MARKUP TAGS
|
描述
|
<code>
|
對代碼範例改變縮進策略
|
<c>
|
改變字體爲等寬字體
|
<para>
|
創建一個新段落
|
<list>
|
創建一個列表
|
<b>
|
粗體
|
<i>
|
斜體
|
命名空間
|
說明
|
備註
|
Ztesoft.BS
|
前綴
|
|
Ztesoft.BS.Commons
|
前後臺公用
|
|
Ztesoft.BS.Commons.Logging
|
日誌
|
|
Ztesfot.BS.Commons. XmlWebFuncHelper
|
XML自動序列化
|
|
Ztesoft.BS.Exceptions
|
全局異常類
|
|
Ztesoft.BS.Web
|
Web應用
|
|
Ztesoft.BS.PPM
|
產品管理後臺
|
|
Ztesoft.BS.CM
|
客戶管理後臺
|
|
Ztesoft.BS.CCM
|
客服管理後臺
|
|
Ztesoft.BS.DAO
|
後臺DAO公用
|
|
Ztesoft.BS.Model
|
後臺DTO公用
|
|
後臺模塊舉例
|
||
Ztesoft.BS.CCM.OrderManagement
|
訂單管理
|
應用程序異常、常量定義也放在該命名空間
|
Ztesoft.BS.CCM.OrderManagement.BL
|
訂單管理業務邏輯層
|
|
Ztesoft.BS.CCM.OrderManagement.DAL
|
訂單管理數據訪問層
|
|
Ztesoft.BS.CCM.OrderManagement.SA
|
訂單管理服務代理層
|
|
類名
|
說明
|
備註
|
XxxxDto
|
數據傳輸對象
|
|
XxxDAOFactory
|
DAO工廠
|
|
IXxxxDAO
|
DAO接口
|
|
XxxxDAOOracle/XxxxDAOInfomix
|
DAO的數據庫實現
|
|
XxxxServiceAgent
|
服務代理
|
|
XxxxManager
|
業務邏輯
|
|
XxxxService
|
服務接口
|
|
XxxxFacade
|
業務正面
|
|
BSXxxxException
|
應用程序異常
|
|
數據庫類型
|
.Net數據類型
|
默認值
|
備註
|
varchar/char
|
String
|
null
|
|
number(m,n)
|
BaseType.Double
|
null
|
|
number(n)
|
BaseType.Long
|
null
|
|
Date
|
BaseType.DateTime
|
null
|
|
private CustDto custDto;
public CustDto CustDto
{
get {return custDto;}
set {this.custDto = value;}
}
|
private AcctDto[] acctDtoList;
public AcctDto[] AcctDtoList
{
get {return acctDtoList;}
set {this. acctDtoList = value;}
}
|