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


C# Database.StoreprocedureExecuteQueryReturned方法代码示例

本文整理汇总了C#中Database.StoreprocedureExecuteQueryReturned方法的典型用法代码示例。如果您正苦于以下问题:C# Database.StoreprocedureExecuteQueryReturned方法的具体用法?C# Database.StoreprocedureExecuteQueryReturned怎么用?C# Database.StoreprocedureExecuteQueryReturned使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Database的用法示例。


在下文中一共展示了Database.StoreprocedureExecuteQueryReturned方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetUserDetails

        public UserLoginResult GetUserDetails(string email, string password,ref UserDetails userDetailsOu)
        {
            var result = new UserDetails();
            Database db = new Database();
            string[,] str = new string[1, 2];
            str[0, 0] = "@Email";
            str[0, 1] = email;
            string xmlResult = db.StoreprocedureExecuteQueryReturned("usp_GetUserDetails", str);
            var serializer = new XmlSerializer(typeof(UserDetails));
            if (!string.IsNullOrEmpty(xmlResult))
            {
                using (var reader = new StringReader(xmlResult))
                {
                    result = (UserDetails)serializer.Deserialize(reader);
                }
            }

            if (result != null)
            {
                //string pswd = encryptionService.CreatePasswordHash(password, "SHA1");
                if (encriptDecript.Decrypt(result.Password) == password)
                {
                    userDetailsOu = result;
                    return UserLoginResult.Successful;
                }
                else
                {
                    return UserLoginResult.WrongPassword;
                }
            }
            return UserLoginResult.NotRegistered;
        }
开发者ID:soorajm,项目名称:GPS,代码行数:32,代码来源:LoginService.cs

示例2: GetPEDOnCategory

        public PEDOnCategory GetPEDOnCategory(string product, string store)
        {
            var result = new PEDOnCategory();
            Database db = new Database();

            string[,] str = new string[2, 2];
            str[0, 0] = "@productId";
            str[0, 1] = product;
            str[1, 0] = "@storeId";
            str[1, 1] = store;
            try
            {
                string xmlResult = db.StoreprocedureExecuteQueryReturned("usp_GetPEDOnCategory", str);
                var serializer = new XmlSerializer(typeof(PEDOnCategory));

                    using (var reader = new StringReader(xmlResult))
                    {
                     result = (PEDOnCategory)serializer.Deserialize(reader);
                     return result;
                    }

            }
            catch (Exception)
            {
                return new PEDOnCategory();
            }
        }
开发者ID:soorajm,项目名称:GPS,代码行数:27,代码来源:PriceOptimizeServices.cs

示例3: ChangePassword

 public void ChangePassword(string Email, string Password)
 {
     Database db = new Database();
     string[,] str = new string[2, 2];
     str[0, 0] = "@Email";
     str[0, 1] = Email;
     str[1, 0] = "@Password";
     str[1, 1] =encriptDecript.Encrypt(Password);
     db.StoreprocedureExecuteQueryReturned("usp_ChangeUserPassword", str);
 }
开发者ID:soorajm,项目名称:GPS,代码行数:10,代码来源:LoginService.cs

示例4: UpdateUploadedDate

 public int UpdateUploadedDate()
 {
     Database db = new Database();
     var user = System.Web.HttpContext.Current.Cache["AdminInfo"] as UserDetails;
     string[,] str = new string[1, 2];
     str[0, 0] = "@Email";
     str[0, 1] = user.Username;
     db.StoreprocedureExecuteQueryReturned("usp_UpdateUploadedDate", str);
     return 1;
 }
开发者ID:soorajm,项目名称:GPS,代码行数:10,代码来源:ExcelUploadServices.cs

示例5: UpdateUser

        public string UpdateUser(string name, string contact, string password, string email)
        {
            Database db = new Database();
            string[,] str = new string[4, 2];
            str[0, 0] = "@Name";
            str[0, 1] = name;

            str[1, 0] = "@Contact";
            str[1, 1] = contact;

            str[2, 0] = "@Password";
            str[2, 1] = encriptDecript.Encrypt(password);

            str[3, 0] = "@Email";
            str[3, 1] = email;
            string result = db.StoreprocedureExecuteQueryReturned("usp_UpdateUserDetails", str);
            return result;
        }
开发者ID:soorajm,项目名称:GPS,代码行数:18,代码来源:LoginService.cs

示例6: GetItemDetails

        public void GetItemDetails()
        {
            var result = new ItemDetails();
            Database db = new Database();
            string[,] str = new string[1, 2];
            str[0, 0] = "@action";
            str[0, 1] = "all";
            string xmlResult = db.StoreprocedureExecuteQueryReturned("usp_GetDashboardCountDetails", str);
            var serializer = new XmlSerializer(typeof(ItemDetails));
            if (!string.IsNullOrEmpty(xmlResult))
            {
                using (var reader = new StringReader(xmlResult))
                {
                    result = (ItemDetails)serializer.Deserialize(reader);
                }
            }

            HttpContext.Current.Cache["ItemDetails"] = result;
        }
开发者ID:soorajm,项目名称:GPS,代码行数:19,代码来源:DashboardServices.cs

示例7: GetMultipleItemPEDDetails

 public ItemPEDDetails GetMultipleItemPEDDetails(string xEle)
 {
     Database db = new Database();
     string[,] str = new string[1, 2];
     str[0, 0] = "@xml";
     str[0, 1] = xEle;
     try
     {
         string xmlResult = db.StoreprocedureExecuteQueryReturned("usp_GetMultipleItemPEDDetails", str);
         var serializer = new XmlSerializer(typeof(ItemPEDDetails));
         using (var reader = new StringReader(xmlResult))
         {
             var result = (ItemPEDDetails)serializer.Deserialize(reader);
             return result;
         }
     }
     catch (Exception)
     {
         return new ItemPEDDetails();
     }
 }
开发者ID:soorajm,项目名称:GPS,代码行数:21,代码来源:PriceOptimizeServices.cs

示例8: ValidateEmail

 public string ValidateEmail(string email)
 {
     Database db = new Database();
     string[,] str = new string[1, 2];
     str[0, 0] = "@Email";
     str[0, 1] = email;
     string result = db.StoreprocedureExecuteQueryReturned("usp_GetUserDetails", str);
     return result;
 }
开发者ID:soorajm,项目名称:GPS,代码行数:9,代码来源:LoginService.cs

示例9: SaveMultipleProductOptimizedPrice

        public int SaveMultipleProductOptimizedPrice(string xML, string optimizedValue)
        {
            Database db = new Database();
            string[,] str = new string[2, 2];
            str[0, 0] = "@XML";
            str[0, 1] = xML;
            str[1, 0] = "@OptimizedValue";
            str[1, 1] = optimizedValue;

            try
            {
                string Result = db.StoreprocedureExecuteQueryReturned("usp_SaveOptimizedPrice_MultipleProduct", str);
                return Convert.ToInt32(Result);

            }
            catch (Exception)
            {
                return 0;
            }
        }
开发者ID:soorajm,项目名称:GPS,代码行数:20,代码来源:PriceOptimizeServices.cs

示例10: SaveSingleProductOptimizedPrice

        public int SaveSingleProductOptimizedPrice(string product, string store, decimal price, string optimizedPrice)
        {
            Database db = new Database();
            string[,] str = new string[4, 2];
            str[0, 0] = "@Product";
            str[0, 1] = product;
            str[1, 0] = "@Store";
            str[1, 1] = store;
            str[2, 0] = "@Price";
            str[2, 1] = price.ToString();
            str[3, 0] = "@OptimizedPrice";
            str[3, 1] = optimizedPrice;

            try
            {
                string Result = db.StoreprocedureExecuteQueryReturned("usp_SaveOptimizedPrice_SingleProduct", str);
                return Convert.ToInt32(Result);

            }
            catch (Exception)
            {
                return 0;
            }
        }
开发者ID:soorajm,项目名称:GPS,代码行数:24,代码来源:PriceOptimizeServices.cs


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