public static void CreateOrUpdate(RoleInfo model) { if (model.Id < 0) { if (SimpleOrmOperator.Create(model)) { LogInfoOperator.LogSystem("添加角色", "添加角色" + model.RoleName); WebTools.Alert("添加成功!"); } else { WebTools.Alert("添加失败!"); } } else { if (SimpleOrmOperator.Update(model)) { LogInfoOperator.LogSystem("修改角色", "修改角色" + model.RoleName); WebTools.Alert("修改成功!"); } else { WebTools.Alert("修改失败!"); } } }
public static void CreateOrUpdate(DepartmentInfo dep) { if (dep.Id < 0) { if (SimpleOrmOperator.Create(dep)) { LogInfoOperator.LogSystem("添加车管所部门", "添加车管所部门" + dep.DepFullName); WebTools.Alert("添加成功!"); } else { WebTools.Alert("添加失败!"); } } else { if (SimpleOrmOperator.Update(dep)) { LogInfoOperator.LogSystem("修改车管所部门", "修改车管所部门" + dep.DepFullName); WebTools.Alert("修改成功!"); } else { WebTools.Alert("修改失败!"); } } }
public static bool ResetPwd(int id, string newpwd) { bool result = DataAccessFactory.GetDataAccess().ExecuteSql("update table_user_info set c_pwd='" + SecurityFactory.GetSecurity().Encrypt(newpwd) + "' where id=" + id); if (result) { LogInfoOperator.LogSystem("密码复位", "复位ID为" + id + "的密码"); //log.Operator= } return(result); }
public static string ChangePwd(UserInfo user, string oldpwd, string newpwd) { if (user.Password != SecurityFactory.GetSecurity().Encrypt(oldpwd)) { return("旧密码输入错误!"); } bool result = DataAccessFactory.GetDataAccess().ExecuteSql("update table_user_info set c_pwd='" + SecurityFactory.GetSecurity().Encrypt(newpwd) + "' where id=" + user.Id); if (result) { LogInfoOperator.LogSystem("修改密码", user.FullName + "修改自己的密码"); return(string.Empty); } else { return("修改密码失败!"); } }
public static void Delete(int id) { LogInfoOperator.LogSystem("删除车管所部门", "删除车管所部门ID为" + id.ToString()); SimpleOrmOperator.Delete <DepartmentInfo>(id); }
public static void Delete(int id) { LogInfoOperator.LogSystem("删除角色", "删除角色ID为" + id.ToString()); SimpleOrmOperator.Delete <RoleInfo>(id); }
public static void Delete(int id) { LogInfoOperator.LogSystem("删除用户", "删除用户ID为" + id + "的密码"); SimpleOrmOperator.Delete <UserInfo>(id); }