1 DevExpress. XtraEditors. ImageComboBoxEdit User Experience
Protected void GetAuxDataDDL (CommonEnum. AuxDataType pnum_enumAuxDataType, ImageComboBoxEdit pcbo_Name)
{
// Execute an SQL statement to return the dataTable
DataTable pobj_DT = GetAuxData (pnum_enumAuxDataType );
For (int I = 0; I <pobj_DT.Rows.Count; I ++)
{
ImageComboBoxItem pimg_Comb = new ImageComboBoxItem ();
Pimg_Comb.Description = pobj_DT.Rows [I] [4]. ToString ();
Pimg_Comb.Value = pobj_DT.Rows [I] [1]. ToString ();
Pcbo_Name.Properties.Items.Add (pimg_Comb );
}
}
CommonEnum. AuxDataType. Worksequence annotation:
Public class CommonEnum
{
Auxiliary Data Type # region Auxiliary Data Type
/** // <Summary>
/// Auxiliary Data Type
/// </Summary>
Public enum AuxDataType
{
/** // <Summary>
/// Fixed asset type
/// </Summary>
AssetType,
/** // <Summary>
/// Storage location of Fixed Assets
/// </Summary>
AssetPosition,
/** // <Summary>
/// Position
/// </Summary>
Job,
/** // <Summary>
/// Personnel type
/// </Summary>
PersonType,
/** // <Summary>
/// Personnel position
/// </Summary>
JobGuid,
/** // <Summary>
/// Country
/// </Summary>
Nation,
/** // <Summary>
/// Nationality
/// </Summary>
Province,
/** // <Summary>
/// Political outlook
/// </Summary>
PoliticsVisage,
/** // <Summary>
/// Marital status
/// </Summary>
MarriageStatus,
/** // <Summary>
/// Health status
/// </Summary>
HealthStatus,
/** // <Summary>
/// Job name
/// </Summary>
StationName,
/** // <Summary>
/// Check the location
/// </Summary>
ExamePart,
/** // <Summary>
/// Check content
/// </Summary>
ExameContent,
/** // <Summary>
/// Post check content
/// </Summary>
WorkExameContent,
/** // <Summary>
/// Region
/// </Summary>
Area,
/** // <Summary>
/// Industry
/// </Summary>
Trade,
/** // <Summary>
/// Type
/// </Summary>
Type,
/** // <Summary>
/// Customer level
/// </Summary>
CustomerLevel,
/** // <Summary>
/// Shift
/// </Summary>
Worksequence,
/** // <Summary>
/// File type
/// </Summary>
Achivestype,
/** // <Summary>
/// File storage location
/// </Summary>
KeepingDept,
/** // <Summary>
/// Class Name
/// </Summary>
ClassName,
/** // <Summary>
/// Inspection site number
/// </Summary>
CheckPlace,
/** // <Summary>
/// Property type
/// </Summary>
PropType,
/** // <Summary>
/// Cleaning check: Check Results
/// </Summary>
CheckResult,
}
# Endregion
}
/** // <Summary>
/// Obtain the Guid of the secondary data category
/// </Summary>
/// <Param name = "enumAuxDataType"> data category enumeration </param>
/// <Returns> </returns>
Protected string GetAuxDataType (CommonEnum. AuxDataType enumAuxDataType)
{
Switch (enumAuxDataType)
{
Case CommonEnum. AuxDataType. AssetType:
Return "096c162b-fd48-4551-bd87-251aa249bd4c ";
Case CommonEnum. AuxDataType. AssetPosition:
Return "704220cc-9aae-4093-b2cf-cf02857d24c1"; // fixed asset storage location
Case CommonEnum. AuxDataType. Job:
Return "c3c39af0-ec43-46e7-b18f-7ecb80120cc6 ";
}
}
Use of the dialog box
Dialog Box # region dialog box
/** // <Summary>
/// Confirmation dialog box
/// </Summary>
/// <Param name = "strString"> content </param>
/// <Returns> User click result </returns>
Public DialogResult Confirm (string strString)
{
Return DevExpress. XtraEditors. XtraMessageBox. Show (strString, "prompt", MessageBoxButtons. OKCancel, MessageBoxIcon. Question );
}
/** // <Summary>
/// Confirmation dialog box
/// </Summary>
/// <Param name = "strSting"> content </param>
Public void ShowMessage (string strSting)
{
DevExpress. XtraEditors. XtraMessageBox. Show (strSting, "prompt", MessageBoxButtons. OK, MessageBoxIcon. Information );
}
/** // <Summary>
/// Confirm deletion dialog box
/// </Summary>
////// <Returns> User click result </returns>
Public DialogResult ConfirmDelete ()
{
Return DevExpress. XtraEditors. XtraMessageBox. Show ("are you sure you want to delete it? "," Prompt ", MessageBoxButtons. OKCancel, MessageBoxIcon. Question );
}
# Endregion
Use Cases:
If (this. Confirm ("are you sure you want to delete it? ") = DialogResult. Cancel)
Return;