public static void Delete(Guid id, string operatorAccount) { var repository = Factory.CreateVIPManagerRepository(); repository.Delete(id); // 记录日志 var management = VIPManageService.Query(id); saveDeleteLog("VIP帐号", string.Format("公司Id:{0},是否VIP:{1}",management.Company,management.IsVip), id.ToString(), operatorAccount); }
/// <summary> /// 修改是否是VIP帐号 /// </summary> /// <param name="id">VIP帐号Id</param> /// <param name="enabled">ture/false</param> /// <param name="operatorAccount">操作员帐号</param> public static void Update(Guid id, bool enabled, string operatorAccount) { var repository = Factory.CreateVIPManagerRepository(); repository.Update(id, enabled); // 记录日志 var vipManageView = VIPManageService.Query(id); string originalContent = string.Format("公司Id:{0},是否VIP:{1}",vipManageView.Company, vipManageView.IsVip); string newContent = string.Format("公司Id:{0},是否VIP:{1}", vipManageView.Company, enabled); saveUpdateLog("VIP帐号管理", originalContent, newContent, id.ToString(), operatorAccount); }
public static void Delete(IEnumerable<Guid> ids, string operatorAccount) { var reposity = Factory.CreateVIPManagerRepository(); reposity.Delete(ids); //记录日志 string content = ""; foreach (var item in ids) { var managerment = VIPManageService.Query(item); content += string.Format("公司Id:{0},是否VIP:{1}",managerment.Company,managerment.IsVip); } saveDeleteLog("批量VIP帐号", content, ids.Join(",", item => item.ToString()), operatorAccount); }
/// <summary> /// 批量修改是否为VIP /// </summary> /// <param name="ids">VIP帐号管理中Id</param> /// <param name="enabled">true/false</param> /// <param name="operatorAccount">操作员帐号</param> public static void Update(IEnumerable<Guid> ids, bool enabled, string operatorAccount) { var repository = Factory.CreateVIPManagerRepository(); repository.Update(ids, enabled); // 记录日志 string originalContent = ""; foreach (var item in ids) { var originalView = VIPManageService.Query(item); originalContent += string.Format("公司Id:{0},是否VIP:{1}",originalView.Company,originalView.IsVip); } string newContent = ""; foreach (var item in ids) { var vipManageView = VIPManageService.Query(item); newContent += string.Format("公司Id:{0},是否VIP:{1}", vipManageView.Company, enabled); } saveUpdateLog("VIP帐号管理", originalContent, newContent, ids.Join(",",item=>item.ToString()), operatorAccount); }