Example #1
0
 protected bool IsDelete; //是否有删除权限
 protected void Page_Load(object sender, EventArgs e)
 {
     #region 判断权限
     if (!CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_营销活动_栏目))
     {
         Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.客户关系管理_营销活动_栏目, true);
         return;
     }
     if (CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_营销活动_删除活动))
     {
         IsDelete = true;
     }
     if (CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_营销活动_新增活动))
     {
         IsAdd = true;
     }
     if (CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_营销活动_修改活动))
     {
         IsUpdate = true;
     }
     #endregion
     pageIndex = Utils.GetInt(Utils.GetQueryStringValue("Page"), 1);
     //获取查询条件
     EyouSoft.BLL.CompanyStructure.Customer custBll = new EyouSoft.BLL.CompanyStructure.Customer();
     string method = Utils.GetFormValue("method");
     if (method == "del")
     {   //删除
         int[] ids    = Utils.GetFormValue("ids").Split(',').Select(i => Utils.GetInt(i)).ToArray();
         bool  result = custBll.DeleteCustomerMarketingS(ids);
         Utils.ResponseMeg(result, result? "删除成功!":"删除失败!");
         return;
     }
     string active = Request.QueryString["active"];               //活动主题
     active = !string.IsNullOrEmpty(active) ? Utils.InputText(Server.UrlDecode(active)) : "";
     string activeDate = Utils.GetQueryStringValue("activeDate"); //活动时间
     int    pageCount  = 0;
     //绑定营销活动
     IList <EyouSoft.Model.CompanyStructure.CustomerMarketingInfo> list = custBll.SearchCustomerMarketList(pageSize, pageIndex, CurrentUserCompanyID, active, activeDate, ref recordCount, ref pageCount);
     if (list != null && list.Count > 0)
     {
         rptCustomer.DataSource = list;
         rptCustomer.DataBind();
         BindExportPage();
     }
     else
     {
         rptCustomer.EmptyText   = "<tr><td colspan='10' align='center'>对不起,暂无营销活动信息!</td></tr>";
         ExportPageInfo1.Visible = false;
     }
     //恢复查询关键字
     txtActive.Value     = active;     //活动主题
     txtActiveDate.Value = activeDate; //活动时间
 }