/// <summary> /// 获取收款提醒合计 /// </summary> /// <param name="companyId">公司编号</param> /// <param name="receiptRemindType">收款提醒配置</param> /// <param name="sellerId">销售员编号 收款提醒配置成EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller时不可为空</param> /// <param name="searchInfo">查询信息</param> /// <returns></returns> public void GetReceiptRemind(int companyId, EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType receiptRemindType, int?sellerId , EyouSoft.Model.PersonalCenterStructure.ReceiptRemindSearchInfo searchInfo, out decimal daiShouKuanHeJi) { daiShouKuanHeJi = 0; if (CompanyId <= 0) { return; } if (receiptRemindType == EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller && !sellerId.HasValue) { return; } //结算日之前不提醒 DateTime today = DateTime.Today; int accountDay = today.Day; if (DateTime.DaysInMonth(today.Year, today.Month) == today.Day) { accountDay = 31; } //结算星期几开始往后提醒4天 int[] accountDayWeek = null; DayOfWeek dayOfWeek = today.DayOfWeek; switch (dayOfWeek) { case DayOfWeek.Monday: accountDayWeek = new int[] { 0, 5, 6, 7, 1 }; break; case DayOfWeek.Tuesday: accountDayWeek = new int[] { 0, 6, 7, 1, 2 }; break; case DayOfWeek.Wednesday: accountDayWeek = new int[] { 0, 7, 1, 2, 3 }; break; case DayOfWeek.Thursday: accountDayWeek = new int[] { 0, 1, 2, 3, 4 }; break; case DayOfWeek.Friday: accountDayWeek = new int[] { 0, 2, 3, 4, 5 }; break; case DayOfWeek.Saturday: accountDayWeek = new int[] { 0, 3, 4, 5, 6 }; break; case DayOfWeek.Sunday: accountDayWeek = new int[] { 0, 4, 5, 6, 7 }; break; } string sellers = string.Empty; if (receiptRemindType == EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller && sellerId.HasValue) { sellers = sellerId.ToString(); } if (!string.IsNullOrEmpty(sellers)) { idalCustomer.GetReceiptRemindByOrderSeller(CompanyId, accountDay, accountDayWeek, sellers, searchInfo, out daiShouKuanHeJi); return; } idalCustomer.GetReceiptRemind(CompanyId, accountDay, accountDayWeek, searchInfo, out daiShouKuanHeJi); }
/// <summary> /// 获取收款提醒配置 /// </summary> /// <param name="companyId">公司编号(专线)</param> /// <returns></returns> public EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType GetReceiptRemindType(int companyId) { EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType receiptRemindType = EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.AllUser; EyouSoft.Model.CompanyStructure.CompanyFieldSetting settings = this.GetSetting(companyId); if (settings != null) { receiptRemindType = settings.ReceiptRemindType; } return(receiptRemindType); }
/// <summary> /// 初使化 /// </summary> private void DataInit() { if (!CheckGrant(global::Common.Enum.TravelPermission.个人中心_事务提醒_收款提醒栏目)) { tbShow.Visible = false; tbinfo.InnerHtml = "欢迎 " + SiteUserInfo.UserName + " 登录系统!"; } else { EyouSoft.Model.PersonalCenterStructure.ReceiptRemindSearchInfo searchInfo = new EyouSoft.Model.PersonalCenterStructure.ReceiptRemindSearchInfo(); searchInfo.QianKuanDanWei = S_QianKuanDanWei = Utils.GetQueryStringValue("sn"); searchInfo.LSDate = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("lsdate")); searchInfo.LEDate = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("ledate")); searchInfo.OperatorDepartIds = Utils.GetIntArray(Utils.GetQueryStringValue("departids"), ","); searchInfo.OperatorIds = Utils.GetIntArray(Utils.GetQueryStringValue("operatorids"), ","); pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1); EyouSoft.BLL.CompanyStructure.CompanySetting csBll = new EyouSoft.BLL.CompanyStructure.CompanySetting(); EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType rrt = csBll.GetReceiptRemindType(CurrentUserCompanyID); int?sellerId = null; if (rrt == EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller) { sellerId = SiteUserInfo.ID; } IList <EyouSoft.Model.PersonalCenterStructure.ReceiptRemind> list = null; list = trBll.GetReceiptRemind(pageSize, pageIndex, ref recordCount, CurrentUserCompanyID, rrt, sellerId, searchInfo); len = list == null ? 0 : list.Count; this.rptlist.DataSource = list; this.rptlist.DataBind(); if (list != null && list.Count > 0) { phDaiShouKuanHeJi.Visible = true; decimal daiShouKuanHeJi = 0; trBll.GetReceiptRemind(CurrentUserCompanyID, rrt, sellerId, searchInfo, out daiShouKuanHeJi); ltrDaiShouKuanHeJi.Text = daiShouKuanHeJi.ToString("C2"); } BindPage(); RegisterScript(string.Format("var recordCount={0};", recordCount)); } }
/// <summary> /// 分页获取收款提醒 /// </summary> /// <param name="pageSize">每页显示数</param> /// <param name="pageIndex">当前页索引</param> /// <param name="recordCount">总记录数</param> /// <param name="CompanyId">公司编号</param> /// <param name="receiptRemindType">收款提醒配置</param> /// <param name="sellerId">销售员编号 收款提醒配置成EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller时不可为空</param> /// <param name="searchInfo">查询信息</param> /// <returns></returns> public IList <EyouSoft.Model.PersonalCenterStructure.ReceiptRemind> GetReceiptRemind(int pageSize, int pageIndex, ref int recordCount, int CompanyId , EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType receiptRemindType, int?sellerId , EyouSoft.Model.PersonalCenterStructure.ReceiptRemindSearchInfo searchInfo) { if (CompanyId <= 0) { return(null); } if (receiptRemindType == EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller && !sellerId.HasValue) { return(null); } //结算日之前不提醒 DateTime today = DateTime.Today; int accountDay = today.Day; if (DateTime.DaysInMonth(today.Year, today.Month) == today.Day) { accountDay = 31; } //结算星期几开始往后提醒4天 int[] accountDayWeek = null; DayOfWeek dayOfWeek = today.DayOfWeek; switch (dayOfWeek) { case DayOfWeek.Monday: accountDayWeek = new int[] { 0, 5, 6, 7, 1 }; break; case DayOfWeek.Tuesday: accountDayWeek = new int[] { 0, 6, 7, 1, 2 }; break; case DayOfWeek.Wednesday: accountDayWeek = new int[] { 0, 7, 1, 2, 3 }; break; case DayOfWeek.Thursday: accountDayWeek = new int[] { 0, 1, 2, 3, 4 }; break; case DayOfWeek.Friday: accountDayWeek = new int[] { 0, 2, 3, 4, 5 }; break; case DayOfWeek.Saturday: accountDayWeek = new int[] { 0, 3, 4, 5, 6 }; break; case DayOfWeek.Sunday: accountDayWeek = new int[] { 0, 4, 5, 6, 7 }; break; } string sellers = string.Empty; if (receiptRemindType == EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller && sellerId.HasValue) { sellers = sellerId.ToString(); } if (!string.IsNullOrEmpty(sellers)) { return(idalCustomer.GetReceiptRemindByOrderSeller(pageSize, pageIndex, ref recordCount, CompanyId, accountDay, accountDayWeek, sellers, searchInfo)); } return(idalCustomer.GetReceiptRemind(pageSize, pageIndex, ref recordCount, CompanyId, accountDay, accountDayWeek, searchInfo)); }
private void GetAjaxHtml() { Response.Clear(); EyouSoft.BLL.PersonalCenterStructure.TranRemind trBll = new EyouSoft.BLL.PersonalCenterStructure.TranRemind(SiteUserInfo); EyouSoft.BLL.CompanyStructure.CompanySetting csBll = new EyouSoft.BLL.CompanyStructure.CompanySetting(); StringBuilder sb = new StringBuilder(); if (SiteUserInfo != null) { if (CheckGrant(global::Common.Enum.TravelPermission.个人中心_事务提醒_收款提醒栏目)) { EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType rrt = csBll.GetReceiptRemindType(CurrentUserCompanyID); int?sellerId = null; if (rrt == EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller) { sellerId = SiteUserInfo.ID; } int awakenum = 0; trBll.GetReceiptRemind(1, 0, ref awakenum, CurrentUserCompanyID, rrt, sellerId, null); if (awakenum > 0) { sb.AppendFormat("<p><a href=\"javascript:window.opener.location.href='http/UserCenter/WorkAwake/AppectAwake.aspx';window.opener.focus();\"; >您有{0}条收款未处理!</a></p>", awakenum); } } if (CheckGrant(global::Common.Enum.TravelPermission.个人中心_事务提醒_付款提醒栏目)) { int awakenum = trBll.GetPayRemind(this.CurrentUserCompanyID); if (awakenum > 0) { sb.AppendFormat("<p><a href=\"javascript:window.opener.location.href='http/UserCenter/WorkAwake/PayAwake.aspx';window.opener.focus();\"; >您有{0}条付款未处理!</a></p>", awakenum); } } if (CheckGrant(global::Common.Enum.TravelPermission.个人中心_事务提醒_出团提醒栏目)) { int day = csBll.GetLeaveTourReminderDays(CurrentUserCompanyID); int awakenum = trBll.GetLeaveTourRemind(this.CurrentUserCompanyID, day); if (awakenum > 0) { sb.AppendFormat("<p><a href=\"javascript:window.opener.location.href='http/UserCenter/WorkAwake/OutAwake.aspx';window.opener.focus();\"; >{0}天内有{1}个团出团!</a></p>", day, awakenum); } } if (CheckGrant(global::Common.Enum.TravelPermission.个人中心_事务提醒_回团提醒栏目)) { int day = csBll.GetBackTourReminderDays(this.CurrentUserCompanyID); int awakenum = trBll.GetBackTourRemind(this.CurrentUserCompanyID, day); if (awakenum > 0) { sb.AppendFormat("<p><a href=\"javascript:window.opener.location.href='http/UserCenter/WorkAwake/BackAwake.aspx';window.opener.focus();\"; >{0}天内有{1}个团回团!</a></p>", day, awakenum); } } if (SiteUserInfo.PermissionList.Contains(5)) { int day = csBll.GetContractReminderDays(this.CurrentUserCompanyID); int awakenum = trBll.GetTotalContractRemind(day, CurrentUserCompanyID); if (awakenum > 0) { sb.AppendFormat("<p><a href=\"javascript:window.opener.location.href='http/UserCenter/WorkAwake/DueAwake.aspx';window.opener.focus();\"; >{0}天内有{1}个员工劳动合同到期!</a></p>", day, awakenum); } } if (SiteUserInfo.PermissionList.Contains((int)global::Common.Enum.TravelPermission.个人中心_事务提醒_订单提醒栏目)) { var searchInfo = new EyouSoft.Model.TourStructure.MDingDanTiXingInfo(); int recordCount = 0; var items = new EyouSoft.BLL.TourStructure.TourOrder(SiteUserInfo).GetDingDanTiXing(CurrentUserCompanyID, 1, 1, ref recordCount, searchInfo); if (recordCount > 0) { sb.AppendFormat("<p><a href=\"javascript:window.opener.location.href='http/UserCenter/WorkAwake/DingDanTiXing.aspx';window.opener.focus();\"; >您有<b>{0}</b>个未处理订单!</a></p>", recordCount); } } } Utils.SetCookie(CookieKeyManage.LAST_LOGIN_TIME_COOKIE_KEY, DateTime.Now.ToString("yyyy-M-d-H-m-s")); Response.Write(sb.ToString()); Response.End(); }