本文整理汇总了C#中SQLHandler.ExecuteAsScalar方法的典型用法代码示例。如果您正苦于以下问题:C# SQLHandler.ExecuteAsScalar方法的具体用法?C# SQLHandler.ExecuteAsScalar怎么用?C# SQLHandler.ExecuteAsScalar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLHandler
的用法示例。
在下文中一共展示了SQLHandler.ExecuteAsScalar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFullName
public string GetFullName(int portalId, string userName)
{
var paramCol = new List<KeyValuePair<string, object>>();
paramCol.Add(new KeyValuePair<string, object>("@PortalID", portalId));
paramCol.Add(new KeyValuePair<string, object>("@UserName", userName));
var sageSQL = new SQLHandler();
return sageSQL.ExecuteAsScalar<string>("[dbo].[usp_Aspx_GetUserFirstandLastName]", paramCol);
}
示例2: IsAuthenticatedToEdit
private bool IsAuthenticatedToEdit()
{
//To check the authentication of modulecontrol for current users
List<KeyValuePair<string, object>> ParaMeterCollection = new List<KeyValuePair<string, object>>();
ParaMeterCollection.Add(new KeyValuePair<string, object>("@PermissionKey", "EDIT"));
ParaMeterCollection.Add(new KeyValuePair<string, object>("@UserModuleID", Int32.Parse(hdnUserModuleID.Value)));
ParaMeterCollection.Add(new KeyValuePair<string, object>("@Username", GetUsername));
ParaMeterCollection.Add(new KeyValuePair<string, object>("@PortalID", GetPortalID));
SQLHandler sagesql = new SQLHandler();
return sagesql.ExecuteAsScalar<bool>("sp_CheckUserModulePermissionByPermissionKeyADO", ParaMeterCollection);
}
示例3: CountWishItems
public static int CountWishItems(AspxCommonInfo aspxCommonObj)
{
try
{
List<KeyValuePair<string, object>> parameter = CommonParmBuilder.GetParamNoCID(aspxCommonObj);
SQLHandler sqlH = new SQLHandler();
return sqlH.ExecuteAsScalar<int>("usp_Aspx_GetWishItemsCount", parameter);
}
catch (Exception e)
{
throw e;
}
}
示例4: GetShoppingBagSetting
public static string GetShoppingBagSetting(AspxCommonInfo aspxCommonObj)
{
try
{
List<KeyValuePair<string, object>> parameterCollection = CommonParmBuilder.GetParamSPC(aspxCommonObj);
SQLHandler sqlHandle = new SQLHandler();
string bagType = sqlHandle.ExecuteAsScalar<string>("[usp_Aspx_GetShoppingBagSettings]", parameterCollection);
return bagType;
}
catch (Exception e)
{
throw e;
}
}
示例5: DecodeUrl
/// <summary>
/// Decodes the given encrpted URL to user friendly URL.
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public string DecodeUrl(string key)
{
try
{
List<KeyValuePair<string, object>> ParameterCollection = new List<KeyValuePair<string, object>>();
ParameterCollection.Add(new KeyValuePair<string, object>("@Key", key));
SQLHandler objHandler = new SQLHandler();
return objHandler.ExecuteAsScalar<string>("[dbo].[USP_SHORTURL_DECODE]", ParameterCollection);
}
catch
{
throw;
}
}
示例6: StoreClosedPageContent
public string StoreClosedPageContent()
{
try
{
List<KeyValuePair<string, object>> ParaMeterCollection = new List<KeyValuePair<string, object>>();
ParaMeterCollection.Add(new KeyValuePair<string, object>("@StoreID", GetStoreID.ToString()));
ParaMeterCollection.Add(new KeyValuePair<string, object>("@PortalID", GetPortalID.ToString()));
SQLHandler sagesql = new SQLHandler();
return sagesql.ExecuteAsScalar<string>("dbo.usp_ASPX_CheckStoreClosedPageContent", ParaMeterCollection);
}
catch (Exception e)
{
throw e;
}
}
示例7: EncodeUrl
/// <summary>
/// Connects to database and encodes the url.
/// </summary>
/// <param name="url">User readable URL</param>
/// <param name="code">Encrpted url.</param>
/// <returns>Encrypted URL.</returns>
public string EncodeUrl(string url, string code)
{
try
{
List<KeyValuePair<string, object>> ParameterCollection = new List<KeyValuePair<string, object>>();
ParameterCollection.Add(new KeyValuePair<string, object>("@Url", url));
ParameterCollection.Add(new KeyValuePair<string, object>("@Code", code));
SQLHandler objHandler = new SQLHandler();
return objHandler.ExecuteAsScalar<string>("[dbo].[USP_SHORTURL_ENCODE]", ParameterCollection);
}
catch
{
//SageFrame.Web.ProcessException(ex);
throw;
}
}
示例8: GetModuleName
/// <summary>
/// Connect to database and obtain module name based on UserModuleID.
/// </summary>
/// <param name="UserModuleID">UserModuleID</param>
/// <returns>Module name.</returns>
public static string GetModuleName(int UserModuleID)
{
SQLHandler Objsql = new SQLHandler();
try
{
List<KeyValuePair<string, object>> ParaMeterCollection = new List<KeyValuePair<string, object>>();
ParaMeterCollection.Add(new KeyValuePair<string, object>("@UserModuleID", UserModuleID));
SQLHandler sqlh = new SQLHandler();
string ModuleName = "";
ModuleName = sqlh.ExecuteAsScalar<string>("[dbo].[usp_ModuleControlGetModuleNameFromUserModuleId]", ParaMeterCollection);
return ModuleName;
}
catch (Exception ex)
{
throw ex;
}
}
示例9: CheckIp
private bool CheckIp(System.Net.IPAddress ipAddress, int portalId)
{
try
{
var paraMeterCollection = new List<KeyValuePair<string, object>>
{
new KeyValuePair<string, object>("@IPAddress", ipAddress.ToString()),
new KeyValuePair<string, object>("@PortalID", portalId)
};
var sqlH = new SQLHandler();
var value = sqlH.ExecuteAsScalar<bool>("dbo.usp_sf_CheckIpAccess", paraMeterCollection);
return value;
}
catch (Exception e)
{
throw e;
}
}
示例10: GetCategoryForItem
public static string GetCategoryForItem(int storeID, int portalID, string itemSku,string cultureName)
{
try
{
List<KeyValuePair<string, object>> parameter = new List<KeyValuePair<string, object>>();
parameter.Add(new KeyValuePair<string, object>("@StoreID", storeID));
parameter.Add(new KeyValuePair<string, object>("@PortalID", portalID));
parameter.Add(new KeyValuePair<string, object>("@ItemSku", itemSku));
parameter.Add(new KeyValuePair<string, object>("@CultureName", cultureName));
SQLHandler sqlH = new SQLHandler();
string retString= sqlH.ExecuteAsScalar<string>("usp_Aspx_GetCategoryforItems", parameter);
return retString;
}
catch (Exception e)
{
throw e;
}
}
示例11: CheckGiftCardUsed
public static bool CheckGiftCardUsed(AspxCommonInfo aspxCommonObj, string giftCardCode, decimal amount)
{
try
{
List<KeyValuePair<string, object>> paramCol = CommonParmBuilder.GetParamSP(aspxCommonObj);
paramCol.Add(new KeyValuePair<string, object>("@Amount", amount));
paramCol.Add(new KeyValuePair<string, object>("@GiftCardCode", giftCardCode));
SQLHandler sqlHl = new SQLHandler();
int allowToCheckOut = sqlHl.ExecuteAsScalar<int>("[dbo].[usp_Aspx_CheckGiftCardIsUsed]",
paramCol);
return allowToCheckOut == 1;
}
catch (Exception e)
{
throw e;
}
}
示例12: IsPostAuthenticatedView
/// <summary>
/// authenticates method for view controls.
/// </summary>
/// <param name="portalId">portalId</param>
/// <param name="userModuleId">userModuleId</param>
/// <param name="userName">userName</param>
/// <returns>bool </returns>
public bool IsPostAuthenticatedView(int portalId, int userModuleId, string userName, string authToken)
{
string user = GetUsername(portalId, authToken);
if (user == "superuser")
{
return true;
}
else if (user != "anonymoususer" && user == userName)
{
List<KeyValuePair<string, object>> para = new List<KeyValuePair<string, object>>();
para.Add(new KeyValuePair<string, object>("@UserModuleID", userModuleId));
para.Add(new KeyValuePair<string, object>("@PortalID", portalId));
para.Add(new KeyValuePair<string, object>("@userName", userName));
SQLHandler handler = new SQLHandler();
int flag = handler.ExecuteAsScalar<int>("usp_CheckModulePermissionView", para);
if (flag == 1)
return true;
else
return false;
}
return false;
}
示例13: GetMinWeekDay
public static int GetMinWeekDay(int ScheduleID)
{
List<KeyValuePair<string, object>> ParaMeterCollection = new List<KeyValuePair<string, object>>();
ParaMeterCollection.Add(new KeyValuePair<string, object>("@ScheduleId", ScheduleID));
try
{
SQLHandler sagesql = new SQLHandler();
int value = sagesql.ExecuteAsScalar<int>("usp_ScheduleLowestWeekGetNextWeek", ParaMeterCollection);
return value;
}
catch (Exception) { throw; }
}
示例14: IsStoreExists
public bool IsStoreExists(string storeName)
{
bool i = false;
var paraMeter = new List<KeyValuePair<string, object>>();
paraMeter.Add(new KeyValuePair<string, object>("@PortalName", storeName));
var sqlH = new SQLHandler();
i = sqlH.ExecuteAsScalar<bool>("usp_Aspx_CheckPortal", paraMeter);
return i;
}
示例15: GetCompareItemsCount
public int GetCompareItemsCount(int storeID, int portalID, string sessionCode,string userName)
{
try
{
List<KeyValuePair<string, object>> parameter = new List<KeyValuePair<string, object>>();
parameter.Add(new KeyValuePair<string, object>("@StoreID", storeID));
parameter.Add(new KeyValuePair<string, object>("@PortalID", portalID));
parameter.Add(new KeyValuePair<string, object>("@SessionCode", sessionCode));
parameter.Add(new KeyValuePair<string, object>("@UserName", userName));
SQLHandler sqlH = new SQLHandler();
return sqlH.ExecuteAsScalar<int>("usp_Aspx_GetCompareItemsCount", parameter);
}
catch (Exception ex)
{
throw ex;
}
}