本文整理汇总了C#中InfoType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# InfoType.ToString方法的具体用法?C# InfoType.ToString怎么用?C# InfoType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InfoType
的用法示例。
在下文中一共展示了InfoType.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Show
/// <summary>
/// 提示框,针对easyUi
/// </summary>
/// <param name="page">当前页面指针,一般为this</param>
/// <param name="script">输出脚本</param>
/// <param name="script">提示类型</param>
/// <param name="Fun">回调函数</param>
public static void Show(System.Web.UI.Page page, string msg, InfoType it,string Fun)
{
page.ClientScript.RegisterStartupScript(page.GetType(), UnionID().ToString(), "<script language='javascript' defer>using('messager',function(){$.messager.alert('系统提示','" + msg.Replace("'", "\"").Replace("\n", "").Replace("\r", "") + "。','" + it.ToString() + "'," + Fun + ")});</script>");
}
示例2: GetDB
//public static List<ContractorDL> GetContractorsByCategoryArea(string cateId, string areaId)
//{
// List<ContractorDL> contractors = new List<ContractorDL>();
// SqlConnection conn = new SqlConnection(BWConfig.ConnectionString);
// SqlDataReader rdr = null;
// try
// {
// conn.Open();
// string strSQL = "SELECT metakey, metadesc, metatitle FROM ContractorCategoryArea WHERE ContractorCategoryAreaID = @ID";
// SqlCommand sqlCommand = new SqlCommand(strSQL, conn);
// //sqlCommand.Parameters.Add("ID", SqlDbType.Int).Value = contractorCategoryAreaID;
// rdr = sqlCommand.ExecuteReader();
// if (rdr.HasRows)
// {
// if (rdr.Read())
// {
// //string key = "";
// //if (!String.IsNullOrEmpty(rdr["metakey"].ToString().Trim()))
// // key = rdr["metakey"].ToString().Trim();
// //string desc = "";
// //if (!String.IsNullOrEmpty(rdr["metadesc"].ToString().Trim()))
// // desc = rdr["metadesc"].ToString().Trim();
// //string title = "";
// //if (!String.IsNullOrEmpty(rdr["metatitle"].ToString().Trim()))
// // title = rdr["metatitle"].ToString().Trim();
// //metaData = new MetaDataDL(key, desc, title);
// }
// }
// }
// finally
// {
// if (rdr != null)
// {
// if (!rdr.IsClosed)
// rdr.Close();
// rdr.Dispose();
// }
// if (conn != null)
// {
// if (conn.State == ConnectionState.Open)
// conn.Close();
// conn.Dispose();
// }
// }
// return contractors;
//}
private static ContractorDL GetDB(InfoType infoType, int objectID)
{
ContractorDL tempContractor = null;
string tableName = infoType.ToString();
string columnName = InfoTypeDL.GetColumnName(infoType);
SqlConnection conn = new SqlConnection(BWConfig.ConnectionString);
SqlDataReader rdr = null;
try
{
conn.Open();
string strSQL = "SELECT * FROM Info I JOIN " + tableName + " C ON (I.infoID = C.InfoID) WHERE " + columnName + " = @ID";
SqlCommand sqlCommand = new SqlCommand(strSQL, conn);
sqlCommand.Parameters.Add("ID", SqlDbType.Int).Value = objectID;
rdr = sqlCommand.ExecuteReader();
if (rdr.HasRows)
{
while (rdr.Read())
{
string cName = rdr["displayName"].ToString();
int cID = Convert.ToInt32(rdr["infoID"]);
tempContractor = new ContractorDL(cName, cID);
tempContractor.reviewSummary = rdr["reviewSummary"].ToString();
tempContractor.urlName = rdr["urlName"].ToString();
tempContractor.email = rdr["email"].ToString();
if (!String.IsNullOrEmpty(rdr["phone"].ToString()))
tempContractor.phoneNumbers.Add(new PhoneDL(rdr["phone"].ToString(), PhoneType.regular));
if (!String.IsNullOrEmpty(rdr["organicPhone"].ToString()))
tempContractor.phoneNumbers.Add(new PhoneDL(rdr["organicPhone"].ToString(), PhoneType.organic));
if (!String.IsNullOrEmpty(rdr["ppcPhone"].ToString()))
tempContractor.phoneNumbers.Add(new PhoneDL(rdr["ppcPhone"].ToString(), PhoneType.ppc));
if (!String.IsNullOrEmpty(rdr["facebookPhone"].ToString()))
tempContractor.phoneNumbers.Add(new PhoneDL(rdr["facebookPhone"].ToString(), PhoneType.facebook));
if (rdr["workersCompensation"] != DBNull.Value)
tempContractor.workersCompensation = rdr["workersCompensation"].ToString()[0];
tempContractor.hasLiability = Convert.ToBoolean(rdr["hasliability"]);
tempContractor.shortDescription = rdr["shortdesc"].ToString();
tempContractor.bestPickText = rdr["bestPickText"].ToString();
tempContractor.servicesOffered = rdr["servicesOffered"].ToString();
tempContractor.servicesNotOffered = rdr["servicesNotOffered"].ToString();
tempContractor.specializations = rdr["specializations"].ToString();
tempContractor.minimumJob = rdr["minimumJob"].ToString();
tempContractor.warranty = rdr["warranty"].ToString();
tempContractor.licenseNumber = rdr["licenseNumber"].ToString();
tempContractor.awardsAndCertifications = rdr["awardscertifications"].ToString();
//.........这里部分代码省略.........