/// <summary> /// 添加活动信息 /// </summary> /// <param name="data"></param> /// <param name="user"></param> /// <returns></returns> public bool InsertThirdPartActivity(ThirdPartActivity data, string user) { var result = 0; try { if (data != null) { dbScopeManager.Execute(conn => { result = DALThirdPartActivity.InsertThirdPartActivity(conn, data); }); } } catch (Exception ex) { logger.Log(Level.Error, ex, "InsertThirdPartActivity"); } if (result > 0) { ActivityBoardManager.InsertLog("InsertThirdPartActivity", result.ToString(), $"Data:{JsonConvert.SerializeObject(data)}", result > 0 ? "添加成功" : "添加失败", user, LogType); CallCRMService.NewAddActivity(data.ActivityName, data.StartTime, data.EndTime, data.WebUrl, data.ActivityRules, result.ToString(), CRMSourceType.ActivityBoaardThirdParty, user); } return(result > 0); }
/// <summary> /// 更新活动信息 /// </summary> /// <param name="data"></param> /// <param name="user"></param> /// <returns></returns> public bool UpdateThirdPartActivity(ThirdPartActivity data, string user) { var result = false; try { if (data != null) { result = dbScopeManager.Execute(conn => DALThirdPartActivity.UpdateThirdPartActivity(conn, data)) > 0; } } catch (Exception ex) { logger.Log(Level.Error, ex, "UpdateThirdPartActivity"); } if (result) { ActivityBoardManager.InsertLog("UpdateThirdPartActivity", data.PKID.ToString(), $"Data:{JsonConvert.SerializeObject(data)}", result ? "修改成功" : "修改失败", user, LogType); CallCRMService.NewUpdateActivity(data.ActivityName, data.StartTime, data.EndTime, data.WebUrl, data.ActivityRules, data.PKID.ToString(), CRMSourceType.ActivityBoaardThirdParty, user); } return(result); }
/// <summary> /// 删除活动信息 /// </summary> /// <param name="pkid"></param> /// <returns></returns> public bool DeleteActivityByPKID(int pkid, string user) { var result = false; try { result = dbScopeManager.Execute(conn => DALThirdPartActivity.DeleteActivityByPKID(conn, pkid)) > 0; } catch (Exception ex) { logger.Log(Level.Error, ex, "DeleteActivityByPKID"); } if (result) { ActivityBoardManager.InsertLog("DeleteActivityByPKID", pkid.ToString(), $"删除第三方活动", result ? "删除成功" : "删除失败", user, LogType); CallCRMService.NewDeleteActivityBySourceId(pkid.ToString(), CRMSourceType.ActivityBoaardThirdParty, user); } return(result); }