当前位置: 首页>>代码示例>>C#>>正文


C# SQLHandler.ExecuteAsScalar方法代码示例

本文整理汇总了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);
 }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:8,代码来源:AspxStartUpController.cs

示例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);            
 }
开发者ID:electrono,项目名称:veg-web,代码行数:11,代码来源:HTMLView.ascx.cs

示例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;
     }
 }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:13,代码来源:AspxHeaderProvider.cs

示例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;
     }
 }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:14,代码来源:AspxShoppingBagProvider.cs

示例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;
     }
 }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:19,代码来源:ShortUrlProvider.cs

示例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;
     }
 }
开发者ID:electrono,项目名称:veg-web,代码行数:15,代码来源:Store-Closed.aspx.cs

示例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;
     }
 }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:22,代码来源:ShortUrlProvider.cs

示例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;

            }
        }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:23,代码来源:ModuleControlDataProvider.cs

示例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;
     }
 }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:18,代码来源:Ipv4.cs

示例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;
     }
 }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:18,代码来源:AspxBreadCrumbProvider.cs

示例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;
             }
         }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:21,代码来源:AspxGiftCardProvider.cs

示例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;
 }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:29,代码来源:AuthenticateService.cs

示例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; }
        }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:14,代码来源:SchedulerDataProvider.cs

示例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;
 }
开发者ID:Dashboard-X,项目名称:Aspxcommerce,代码行数:9,代码来源:AspxCommerceWebService.cs

示例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;
            }
        }
开发者ID:Dashboard-X,项目名称:Aspxcommerce,代码行数:18,代码来源:AspxCommerceWebService.cs


注:本文中的SQLHandler.ExecuteAsScalar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。