本文整理汇总了C#中User.PostModify方法的典型用法代码示例。如果您正苦于以下问题:C# User.PostModify方法的具体用法?C# User.PostModify怎么用?C# User.PostModify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User
的用法示例。
在下文中一共展示了User.PostModify方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChangePassword
public ActionResult ChangePassword(string password, string newpassword, string confirm)
{
string userName = System.Web.HttpContext.Current.User.Identity.Name;
var user = new User().Find(userName);
if (user.Password == AesAlgorithm.Encrypt(password))
{
if (newpassword == confirm)
{
user.Password = AesAlgorithm.Encrypt(newpassword);
user.PostModify();
if (user != null)
{
return Content("1");
}
else
{
return Content("0");
}
}
else
{
return Content("-2");
}
}
else
{
return Content("-1");
}
}
示例2: DeleteUser
public static User DeleteUser(string userName)
{
try
{
var user = new User().Find(userName);
user.Status = ItemStatus.Delete;
//user.Password = AesAlgorithm.Encrypt(userName);
user = user.PostModify();
UserModuleBiz.UserAuthorizeDelete(userName);
return user;
}
catch (Exception ex)
{
LogHelper.Write(CommonLogger.Web, ex);
}
return null;
}
示例3: EditUser
public static User EditUser(string userName, string realName, string telePhone, string handPhone)
{
try
{
var user = new User().Find(userName);
user.RealName = realName;
user.TelePhone = telePhone;
user.HandPhone = handPhone;
//user.Password = AesAlgorithm.Encrypt(userName);
user = user.PostModify();
return user;
}
catch (Exception ex)
{
LogHelper.Write(CommonLogger.Web, ex);
}
return null;
}
示例4: ChangeStatus
public static User ChangeStatus(string userName, int status)
{
try
{
var user = new User().Find(userName);
user.Status = (ItemStatus)status;
user = user.PostModify();
if (status == -1)
{
UserModuleBiz.UserAuthorizeDelete(userName);
}
return user;
}
catch (Exception ex)
{
LogHelper.Write(CommonLogger.Web, ex);
}
return null;
}