public ActionResult UserList(string itemKey, string itemName = StringHelper.Empty) { List <BusinessUser> userList = new List <BusinessUser>(); if (GuidHelper.IsInvalidOrEmpty(itemKey) == false) { Guid itemGuid = GuidHelper.TryConvert(itemKey); string whereClause = string.Format("EnterpriseKey='{0}'", itemGuid.ToString()); userList = BusinessUserBLL.GetList(whereClause); } this.ViewBag.EnterpriseKey = itemKey; this.ViewBag.EnterpriseName = itemName; return(View(userList)); }
private void DispatchRemindMessage(List <EnterpriseContractEntity> enterpriseContractList) { RemindEntity remindEntity = CreateRemindEntity(); foreach (EnterpriseContractEntity enterpriseContractEntity in enterpriseContractList) { remindEntity.RemindTitle = string.Format("企业【{0}】的合同【{1}】将在{2}到期", enterpriseContractEntity.EnterpriseInfo, enterpriseContractEntity.ContractTitle, enterpriseContractEntity.ContractStopDate.ToShortDateString()); remindEntity.RemindCategory = RemindCategories.ContractRemindOfEnterprise; remindEntity.RemindUrl = string.Empty; List <BusinessUser> employeeList = BusinessUserBLL.GetList(UserTypes.Manager, UserStatuses.Normal); foreach (BusinessUser item in employeeList) { RemindBLL.Instance.Create(item.ExecutorGuid, ExecutorTypes.User, remindEntity); } } }
/// <summary> /// Job执行的具体实现 /// </summary> /// <param name="context"></param> protected override void ExecuteDetails(JobExecutionContext context) { int daysOffToday = 3; if (SystemTaskInConfig != null) { daysOffToday = Converter.ChangeType(SystemTaskInConfig.GetAddonItemValue("aheadDays"), 3); } int dayOfYear = DateTime.Today.DayOfYear; int dateLower = dayOfYear + daysOffToday; int dateUpper = dateLower + 1; List <BusinessUser> birthdayUserList = BusinessUserBLL.GetList(string.Format("[UserType] ={0} AND DATEPART(DY,UserBirthDay)>= {1} AND DATEPART(DY,UserBirthDay)<{2} ", (int)this.UserType, dateLower, dateUpper)); DispatchRemindMessage(birthdayUserList); }