Example #1
0
    private void getFAQList()
    {
        //strCallWorkBillStatusDrop = PublicMethod.getWorkBillStatusCallCategory(2, false, false, 27);// PublicEnum.EnumBindList_Client<PublicEnum.CallWorkBillStatus>(false, false, intStatus);

        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        //HYTD.BLL.Call_CustomerBLL bll = new HYTD.BLL.Call_CustomerBLL();
        //string strKeyWord = string.Empty;
        //if (!string.IsNullOrEmpty(Request["keyword"]))
        //{
        //    strKeyWord = Request["keyword"].ToString().Trim();
        //}
        //System.Collections.Generic.List<Models.Call_Customer> list = bll.GetCall_CustomerList(strKeyWord);
        //foreach (var m in list)
        //{
        //    sb.Append("{ \"name\":\"" + m.CC_Name + "\", \"to\": \"" + m.CC_ID + "\" },");
        //}
        //strCumstomers = "[" + sb.ToString().Trim(',') + "]";
        sb.Clear();
        HYTD.BLL.Call_FAQListBLL   uBll    = new HYTD.BLL.Call_FAQListBLL();
        List <Models.Call_FAQList> FAQList = new List <Call_FAQList>();

        FAQList = uBll.GetCall_FAQListList();
        foreach (var m in FAQList)
        {
            sb.Append("{ \"name\":\"" + m.CF_ErrorList + "\", \"to\": \"" + m.CF_ID + "\" },");
        }
        strFAQList = "[" + sb.ToString().Trim(',') + "]";
    }
Example #2
0
    private void DataBind()
    {
        Call_FAQListTO sto = new Call_FAQListTO();

        #region 条件
        if (!string.IsNullOrEmpty(Request["sltType"]))
        {
            sto.CF_SoftTypeID = Convert.ToInt32(Request["sltType"].ToString().Trim());//类型
        }
        if (!string.IsNullOrEmpty(Request["pErrorList"]))
        {
            sto.CF_ErrorList = Request["pErrorList"].ToString().Trim();//标题
        }
        //else
        //    sto.CF_SoftTypeID = Convert.ToInt32(Request["uname"].ToString().Trim());//存 用户名称
        if (!string.IsNullOrEmpty(Request["stime"]))
        {
            DateTime dtStime = Convert.ToDateTime("1980-01-01");
            DateTime.TryParse(Request["stime"].ToString().Trim(), out dtStime);
            sto.CF_AddDate = dtStime;//保存操作开始时间
        }
        if (!string.IsNullOrEmpty(Request["etime"]))
        {
            DateTime dtEtime = Convert.ToDateTime("2250-01-01");
            DateTime.TryParse(Request["etime"].ToString().Trim(), out dtEtime);
            sto.CF_EndDate = dtEtime;//保存操作结束时间
        }

        #endregion
        if (!string.IsNullOrEmpty(Request.QueryString["pageIndex"]))
        {
            int.TryParse(Request.QueryString["pageIndex"], out pageIndex);
        }
        HYTD.BLL.Call_FAQListBLL bll = new HYTD.BLL.Call_FAQListBLL();
        DataTable dt = bll.GetCall_FAQListList(sto, pageIndex, pageSize, "", out rowCount);
        //分页
        string getUrl = "";
        if (Request.Url.Query.Length > 0 && Request.Url.Query.IndexOf("pageIndex") > -1 && Request.Url.Query.IndexOf("&") > -1)
        {
            getUrl = Request.Url.Query.Substring(Request.Url.Query.IndexOf("&"));
        }
        else if (Request.Url.Query.Length > 0)
        {
            getUrl = Request.Url.Query.Substring(1);
        }
        string url = "FAQList.aspx?pageIndex={0}&" + getUrl.Trim('&');
        strtt = DividePage.Pager(pageSize, rowCount, pageIndex, url);

        if (dt.Rows.Count > 0)
        {
            int           num       = 0;
            StringBuilder sbContent = new StringBuilder();
            //string strNew = string.Empty;
            string strEdit   = string.Empty;
            string strDelete = string.Empty;
            foreach (DataRow dr in dt.Rows)
            {
                num++;
                //strNew = string.Format("<a href=\"javascript:;\" name=\"NewFAQ\" onclick=\"NewFAQ({0})\" >新建</a>   ", dr["CF_ID"]);
                strEdit   = string.Format("<a href=\"javascript:;\" name=\"EditFAQ\" onclick=\"EditFAQ({0})\">修改</a>", dr["CF_ID"].ToString());
                strDelete = string.Format("<a href=\"javascript:;\" name=\"DeleteFAQ\" onclick=\"DeleteFAQ({0})\">删除</a>", dr["CF_ID"].ToString());
                sbContent.AppendFormat("<tbody>");
                sbContent.AppendFormat("<tr>");
                sbContent.AppendFormat("<td class=\"num\" title=\"{0}\">{0}&nbsp;</td>", num);
                sbContent.AppendFormat("<td class=\"num\" title=\"{0}\"><a href=\"javascript:;\"  onclick=\"ShowFAQ({1})\">{0}</a></td>", dr["CF_ErrorList"].ToString(), dr["CF_ID"].ToString());
                sbContent.AppendFormat("<td class=\"num\" title=\"{0}\">{0}&nbsp;</td>", dr["CF_Describe"]);
                sbContent.AppendFormat("<td class=\"num\" title=\"{0}\">{0}&nbsp;</td>", dr["CF_AddDate"]);
                sbContent.AppendFormat("<td class=\"num\" title=\"{0}\">{0}&nbsp;</td>", getSoftTypename(dr["CF_SoftTypeID"].ToString()));
                sbContent.AppendFormat("<td class=\"num\" title=\"{0}\">{0}&nbsp;</td>", getUsername(dr["CF_UserID"].ToString()));
                sbContent.AppendFormat("<td class=\"num\">{0}&nbsp;&nbsp;&nbsp;&nbsp;{1}</td>", strEdit, strDelete);
                sbContent.AppendFormat("</tr>");
                sbContent.AppendFormat("</tbody>");
            }

            script = sbContent.ToString();
        }
        else
        {
            script = "没有搜索到相关内容!";
        }
        //获取当前页
        //if (rowCount % pageSize == 0)
        //{
        //    pageNum = rowCount / pageSize;
        //}
        //else
        //{
        //    pageNum = (rowCount / pageSize) + 1;
        //}
    }