Example #1
0
        //public BitAuto.YanFa.Crm2009.Web.Controls.AjaxPager AjaxPager
        //{
        //    get { return this.AjaxPager_BL; }
        //}

        #endregion

        //public BLHelper helper = new BLHelper();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //加入 年检记录的访问权限
                //int userId = BLL.Util.GetLoginUserID();
                //if (!BLL.Util.CheckRight(userId, "SYS024BUT2205"))
                //{
                //    Response.Write(BLL.Util.GetNotAccessMsgPage("您没有访问该页面的权限"));
                //    Response.End();
                //}
            }
            //查询
            int       totalCount = 0;
            DataTable table      = new DataTable();

            BitAuto.YanFa.Crm2009.Entities.QueryBusinessLicense query = new BitAuto.YanFa.Crm2009.Entities.QueryBusinessLicense();
            query.CustID = this.CustID;

            table = BitAuto.YanFa.Crm2009.BLL.BusinessLicense.Instance.Get(query, PagerHelper.GetCurrentPage(), PageSize, out totalCount);
            //设置数据源
            if (table != null && table.Rows.Count > 0)
            {
                repeater.DataSource = table;
            }
            //绑定列表数据
            repeater.DataBind();
            //分页控件
            AjaxPager1.PageSize = 5;
            AjaxPager1.InitPager(totalCount);
        }
        /// <summary>
        /// 查看链接
        /// </summary>
        /// <param name="taskid"></param>
        /// <param name="carType"></param>
        /// <param name="source"></param>
        /// <param name="htmlstr"></param>
        /// <returns></returns>
        public string getview(string taskid, string carType, string source, string TaskStatus)
        {
            string html = "";

            if (TaskStatus == "180012")
            {
                return(taskid);
            }

            if (taskid.Length > 3 && taskid.Substring(0, 3) == "OLD")
            {
                return(taskid);
            }

            #region 查看URL

            string url = "";

            if (source == "0")//客户核实
            {
                url = "/CRMStopCust/Edit.aspx?TaskID=" + taskid;
            }
            else if (source == "-1")//其他任务
            {
                url = "/OtherTask/OtherTaskDealView.aspx?OtherTaskID=" + taskid;
            }
            else if (source == "2")
            {
                //CRM
                if (carType == "2")
                {
                    url += "/CustCheck/CrmCustCheck/SecondCarView.aspx?TID=" + taskid + "&Page=" + PagerHelper.GetCurrentPage() + "&PageSize=" + PagerHelper.GetPageSize() + "&QueryParams=&Action=view";
                }
                else
                {
                    url += "/CustCheck/CrmCustCheck/View.aspx?TID=" + taskid + "&Page=" + PagerHelper.GetCurrentPage() + "&PageSize=" + PagerHelper.GetPageSize() + "&QueryParams=&Action=view";
                }
            }
            else
            {
                //Excel
                if (carType == "2")
                {
                    url += "/CustCheck/NewCustCheck/SecondCarView.aspx?TID=" + taskid + "&Page=" + PagerHelper.GetCurrentPage() + "&PageSize=" + PagerHelper.GetPageSize() + "&QueryParams=&Action=view";
                }
                else
                {
                    url += "/CustCheck/NewCustCheck/View.aspx?TID=" + taskid + "&Page=" + PagerHelper.GetCurrentPage() + "&PageSize=" + PagerHelper.GetPageSize() + "&QueryParams=&Action=view";
                }
            }
            #endregion

            html += " <a target='_blank' href='" + url + "'>" + taskid + "</a>";

            return(html);
        }
 /// <summary>
 /// 获得请求的当前页码(默认为1)
 /// </summary>
 public static int GetCurrentPage()
 {
     return(PagerHelper.GetCurrentPage(1));
 }
        /// <summary>
        /// 查看链接
        /// </summary>
        /// <param name="taskid"></param>
        /// <param name="carType"></param>
        /// <param name="source"></param>
        /// <param name="htmlstr"></param>
        /// <returns></returns>
        public string getview(string taskid, string carType, string source, string TaskStatus)
        {
            string html = "";

            if (TaskStatus == "180012")
            {
                return(taskid);
            }

            #region 查看URL

            string url = "";

            if (source == "2")
            {
                //CRM
                if (carType == "2")
                {
                    url += "/CustCheck/CrmCustCheck/SecondCarView.aspx?TID=" + taskid + "&Page=" + PagerHelper.GetCurrentPage() + "&PageSize=" + PagerHelper.GetPageSize() + "&QueryParams=" + this.QueryParams + "&Action=view";
                }
                else
                {
                    url += "/CustCheck/CrmCustCheck/View.aspx?TID=" + taskid + "&Page=" + PagerHelper.GetCurrentPage() + "&PageSize=" + PagerHelper.GetPageSize() + "&QueryParams=" + this.QueryParams + "&Action=view";
                }
            }
            else
            {
                //Excel
                if (carType == "2")
                {
                    url += "/CustCheck/NewCustCheck/SecondCarView.aspx?TID=" + taskid + "&Page=" + PagerHelper.GetCurrentPage() + "&PageSize=" + PagerHelper.GetPageSize() + "&QueryParams=" + this.QueryParams + "&Action=view";
                }
                else
                {
                    url += "/CustCheck/NewCustCheck/View.aspx?TID=" + taskid + "&Page=" + PagerHelper.GetCurrentPage() + "&PageSize=" + PagerHelper.GetPageSize() + "&QueryParams=" + this.QueryParams + "&Action=view";
                }
            }
            #endregion

            html += " <a target='_blank' href='" + url + "'>" + taskid + "</a>";

            return(html);
        }