本文整理汇总了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;
}
}