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


C# ConnectionManager.ExecuteNonQueryWrapper方法代码示例

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


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

示例1: ChangePassword

        private void ChangePassword()
        {
            String refSourceString = String.Empty;
            try
            {
                User currentUser = (User)HttpContext.Current.Session["CurrentUserSession"];

                String oldPass = HttpContext.Current.Request.QueryString["OldPassword"];
                String newPass = HttpContext.Current.Request.QueryString["NewPassword"];

                string passwordOld = Enc.Encrypt(oldPass.Trim(), STATIC.StaticInfo.encString);
                string passwordNew = Enc.Encrypt(newPass.Trim(), STATIC.StaticInfo.encString);

                String savedPassword = currentUser.Password;

                if (savedPassword == passwordOld)
                {
                    ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
                    String sql = "Update [User] Set Password = '" + passwordNew + "' where UserCode = '" + currentUser.UserCode + "'";
                    conManager.ExecuteNonQueryWrapper(sql);
                    refSourceString = "True," + "Saved Successfully.";
                }
                else
                {
                    refSourceString = "False," + "Old password do not match.";
                }

                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.ContentType = "text/plain";
                HttpContext.Current.Response.Write(refSourceString);
                HttpContext.Current.Response.Flush();

            }
            catch (Exception ex)
            {
                refSourceString = "False," + ex.Message;
                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.ContentType = "text/plain";
                HttpContext.Current.Response.Write(refSourceString);
                HttpContext.Current.Response.Flush();
                //throw ex;
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:43,代码来源:DataHandler.ashx.cs


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