示例#1
0
        /// <summary>
        /// 获取基础数据
        /// </summary>
        /// <returns></returns>
        public string getData()
        {
            //获取分页数据
            int currentPage = Convert.ToInt32(Request["page"]);

            if (currentPage == 0)
            {
                currentPage = 1;
            }
            TableBuilder tb = new TableBuilder();

            tb.StrTable      = "V_ReplenishMentMononer";
            tb.OrderBy       = "dateTime desc";
            tb.StrColumnlist = "rsMononerID,bookNum,bookName,sum(count) as allnumber,dateTime";
            tb.IntPageSize   = pageSize;
            tb.IntPageNum    = currentPage;
            tb.StrWhere      = "deleteState=0 and saleTaskId='" + saleTaskId + "' group by bookNum,bookName";
            //获取展示的客户数据
            ds = saleBll.selectBypage(tb, out totalCount, out intPageCount);
            //生成table
            StringBuilder strb = new StringBuilder();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                strb.Append("<tr><td>" + (i + 1 + ((currentPage - 1) * pageSize)) + "</td>");
                strb.Append("<td>" + ds.Tables[0].Rows[i]["bookNum"].ToString() + "</td>");
                strb.Append("<td><nobr>" + ds.Tables[0].Rows[i]["bookName"].ToString() + "</nobr></td>");
                strb.Append("<td>" + ds.Tables[0].Rows[i]["allnumber"].ToString() + "</td>");
                strb.Append("<td><nobr>" + ds.Tables[0].Rows[i]["dateTime"].ToString() + "</nobr></td></tr>");
            }
            strb.Append("<input type='hidden' value='" + intPageCount + "' id='intPageCount' />");
            string op = Request["op"];

            if (op == "paging")
            {
                Response.Write(strb.ToString());
                Response.End();
            }
            return(strb.ToString());
        }
示例#2
0
        /// <summary>
        /// 获取基础数据
        /// </summary>
        /// <returns></returns>
        public string getData()
        {
            regionId = Convert.ToInt32(Request["regionId"]);
            string        search = "";
            StringBuilder strb   = new StringBuilder();
            string        op     = Request["op"];

            if (regionId > 0)
            {
                if (user.RoleId.RoleName == "超级管理员")
                {
                    search = " and regionId=" + regionId;
                    region = regionBll.selectById(regionId);
                    kinds  = repBll.getMonkinds(regionId, 0);
                    counts = repBll.getTotalMon(regionId, 0);
                }
            }
            else
            {
                if (user.RoleId.RoleName == "超级管理员")
                {
                    search = "";
                    counts = 0;
                    kinds  = 0;
                    region = "";
                }
                else
                {
                    regionId = user.ReginId.RegionId;
                    search   = " and regionId=" + regionId;
                    kinds    = repBll.getMonkinds(regionId, 0);
                    counts   = repBll.getTotalMon(regionId, 0);
                    region   = regionBll.selectById(regionId);
                }
            }
            //获取分页数据
            int currentPage = Convert.ToInt32(Request["page"]);

            if (currentPage == 0)
            {
                currentPage = 1;
            }
            TableBuilder tb = new TableBuilder();

            tb.StrTable      = "V_ReplenishMentMononer";
            tb.OrderBy       = "rsMononerID";
            tb.StrColumnlist = "regionName,customerName,rsMononerID,bookNum,ISBN,bookName,sum(count) as count,dateTime";
            tb.IntPageSize   = pageSize;
            tb.IntPageNum    = currentPage;
            tb.StrWhere      = "ISNULL(finishTime) and deleteState=0" + search + " group by regionName,customerName,rsMononerID,bookNum,ISBN,bookName";
            //获取展示的客户数据
            ds = saleBll.selectBypage(tb, out totalCount, out intPageCount);
            //生成table
            strb.Append("<tbody>");
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                strb.Append("<tr><td>" + (i + 1 + ((currentPage - 1) * pageSize)) + "</td>");
                strb.Append("<td>" + ds.Tables[0].Rows[i]["ISBN"].ToString() + "</td>");
                strb.Append("<td>" + ds.Tables[0].Rows[i]["bookNum"].ToString() + "</td>");
                strb.Append("<td><nobr>" + ds.Tables[0].Rows[i]["bookName"].ToString() + "</nobr></td>");
                strb.Append("<td>" + ds.Tables[0].Rows[i]["count"].ToString() + "</td>");
                strb.Append("<td>" + ds.Tables[0].Rows[i]["customerName"].ToString() + "</td>");
                strb.Append("<td>" + ds.Tables[0].Rows[i]["regionName"].ToString() + "</td>");
                strb.Append("<td><nobr>" + Convert.ToDateTime(ds.Tables[0].Rows[i]["dateTime"].ToString()).ToString("yyyy/MM/dd") + "</nobr></td></tr>");
            }
            strb.Append("<input type='hidden' value='" + intPageCount + "' id='intPageCount' />");
            strb.Append("</tbody>");
            if (op == "paging")
            {
                Response.Write(strb.ToString() + ":|" + kinds + ":|" + counts + ":|" + region);
                Response.End();
            }
            return(strb.ToString());
        }
示例#3
0
        /// <summary>
        /// 获取基础数据及查询方法
        /// </summary>
        public string getData()
        {
            User   user     = (User)Session["user"];
            int    regionId = user.ReginId.RegionId;
            string roleName = user.RoleId.RoleName;
            //获取分页数据
            int currentPage = Convert.ToInt32(Request["page"]);

            if (currentPage == 0)
            {
                currentPage = 1;
            }
            string search = Request["search"];

            if (search == "" || search == null)
            {
                if (roleName == "超级管理员")
                {
                    search = "deleteState=0";
                }
                else
                {
                    search = "deleteState=0 and regionId=" + regionId;
                }
            }
            else
            {
                if (roleName == "超级管理员")
                {
                    search = String.Format(" saleTaskId {0} or userName {0} or customerName {0} and deleteState=0 ", "like '%" + search + "%'");
                }
                else
                {
                    search = String.Format(" saleTaskId {0} or userName {0} or customerName {0} and deleteState=0 and regionId=" + regionId, "like '%" + search + "%'");
                }
            }

            TableBuilder tb = new TableBuilder();

            tb.StrTable      = "V_SaleTask";
            tb.OrderBy       = "startTime desc";
            tb.StrColumnlist = "saleTaskId,defaultDiscount,defaultCopy,priceLimit,numberLimit,totalPriceLimit,startTime,finishTime,userId,userName,customerName,regionId";
            tb.IntPageSize   = pageSize;
            tb.IntPageNum    = currentPage;
            tb.StrWhere      = search;
            //获取展示的客户数据
            ds = saleBll.selectBypage(tb, out totalCount, out intPageCount);
            //获取客户下拉数据
            customerds = custBll.select();
            //生成table
            StringBuilder strb = new StringBuilder();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                string time = ds.Tables[0].Rows[i]["finishTime"].ToString();
                if (time == "" || time == null)
                {
                    time = "销售任务采集中";
                }
                strb.Append("<tr><td>" + ds.Tables[0].Rows[i]["saleTaskId"].ToString() + "</td>");
                strb.Append("<td><nobr>" + ds.Tables[0].Rows[i]["customerName"].ToString() + "</nobr></td>");
                strb.Append("<td>" + ds.Tables[0].Rows[i]["userName"].ToString() + "</td>");
                string defaultDiscount = ds.Tables[0].Rows[i]["defaultDiscount"].ToString();
                if (defaultDiscount == "-1")
                {
                    defaultDiscount = "";
                }
                strb.Append("<td>" + defaultDiscount + "</td>");
                strb.Append("<td>" + ds.Tables[0].Rows[i]["numberLimit"].ToString() + "</td>");
                strb.Append("<td>" + ds.Tables[0].Rows[i]["defaultCopy"].ToString() + "</td>");
                strb.Append("<td>" + (ds.Tables[0].Rows[i]["priceLimit"].ToString() + ".00") + "</td>");
                strb.Append("<td><nobr>" + ds.Tables[0].Rows[i]["startTime"].ToString() + "</nobr></td>");
                strb.Append("<td><nobr>" + time + "</nobr></td>");
                strb.Append("<td style='width:100px;'>" + "<button class='btn btn-success btn-sm btn_sale'>销售</button>");
                strb.Append("<button class='btn btn-success btn-sm btn_back'>销退</button></td>");
                strb.Append("<td><button class='btn btn-success btn-sm btn_search'>查看</button> <button class='btn btn-sm btn-success edited' value='" + ds.Tables[0].Rows[i]["totalPriceLimit"].ToString() + "' >编辑</button>");
                strb.Append("<button class='btn btn-danger btn-sm btn_del'><i class='fa fa-trash'></i></button>" + "</td></tr>");
            }
            strb.Append("<input type='hidden' value='" + intPageCount + "' id='intPageCount' />");
            string op = Request["op"];

            if (op == "paging")
            {
                Response.Write(strb.ToString());
                Response.End();
            }
            return(strb.ToString());
        }
示例#4
0
        public string getData()
        {
            User   user     = (User)Session["user"];
            int    regionId = user.ReginId.RegionId;
            string roleName = user.RoleId.RoleName;
            //获取分页数据
            int currentPage = Convert.ToInt32(Request["page"]);

            if (currentPage == 0)
            {
                currentPage = 1;
            }
            string search = Request["search"];

            if (search == "" || search == null)
            {
                if (roleName == "超级管理员")
                {
                    search = "deleteState=0";
                }
                else
                {
                    search = "deleteState=0 and regionId=" + regionId;
                }
            }
            else
            {
                if (roleName == "超级管理员")
                {
                    search = String.Format(" customerName {0} and deleteState=0 ", "like '%" + search + "%'");
                }
                else
                {
                    search = String.Format(" customerName {0} and deleteState=0 and regionId=" + regionId, "like '%" + search + "%'");
                }
            }

            TableBuilder tb = new TableBuilder();

            tb.StrTable      = "V_ReplenishMentHead";
            tb.OrderBy       = "saleTaskId";
            tb.StrColumnlist = "saleTaskId,customerName,userName,kingdsNum,number,dateTime,state";
            tb.IntPageSize   = pageSize;
            tb.IntPageNum    = currentPage;
            tb.StrWhere      = search;
            //获取展示的客户数据
            ds = saleBll.selectBypage(tb, out totalCount, out intPageCount);
            //生成table
            StringBuilder strb = new StringBuilder();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                string state = ds.Tables[0].Rows[i]["state"].ToString();
                if (state == "0")
                {
                    state = "未完成";
                }
                else
                {
                    state = "已完成";
                }
                strb.Append("<tr><td><nobr>" + ds.Tables[0].Rows[i]["saleTaskId"].ToString() + "</nobr></td>");
                strb.Append("<td>" + ds.Tables[0].Rows[i]["customerName"].ToString() + "</td>");
                strb.Append("<td>" + ds.Tables[0].Rows[i]["userName"].ToString() + "</td>");
                strb.Append("<td>" + ds.Tables[0].Rows[i]["kingdsNum"].ToString() + "</td>");
                strb.Append("<td>" + ds.Tables[0].Rows[i]["number"].ToString() + "</td>");
                strb.Append("<td><nobr>" + state + "</nobr></td>");
                strb.Append("<td style='width:150px;'><button class='btn btn-success btn-sm btn_search'><i class='fa fa-search'></i></button>");
                strb.Append("<button class='btn btn-danger btn-sm btn_del'><i class='fa fa-trash'></i></button>" + "</td></tr>");
            }
            strb.Append("<input type='hidden' value='" + intPageCount + "' id='intPageCount' />");
            string op = Request["op"];

            if (op == "paging")
            {
                Response.Write(strb.ToString());
                Response.End();
            }
            return(strb.ToString());
        }
示例#5
0
        private void Load(HttpContext context)
        {
            Page page = new Page();
            //获取分页数据
            int    currentPage = Convert.ToInt32(context.Request["page"]);
            string userId      = context.Request["userId"];
            string opeartion   = context.Request["opeartion"];


            UserBll userbll  = new UserBll();
            DataSet userds   = userbll.selectByUserId(userId);
            int     regionId = Int32.Parse(userds.Tables[0].Rows[0]["regionId"].ToString());

            if (currentPage == 0)
            {
                currentPage = 1;
            }
            TableBuilder tb = new TableBuilder();

            tb.StrTable = "V_SaleTask";
            tb.OrderBy  = "saleTaskId";
            // tb.StrColumnlist = "saleTaskId,defaultDiscount,defaultCopy,priceLimit,numberLimit,totalPriceLimit,startTime,finishTime,userId,userName,customerName,regionId";
            tb.StrColumnlist = "saleTaskId,customerName";
            tb.IntPageSize   = pageSize;
            tb.IntPageNum    = currentPage;
            //tb.StrWhere = "deleteState=0 and (state=0 or state=1) and saleTaskId='" + saleTaskId + "'";
            if (opeartion != null && opeartion != "")
            {
                string condition = " and (saleTaskId like '%" + opeartion + "%' or customerName like'%" + opeartion + "%')";
                tb.StrWhere = "deleteState=0 and regionId='" + regionId + "'" + condition + " and ISNULL(finishTime)";
            }
            else
            {
                tb.StrWhere = "deleteState=0 and regionId='" + regionId + "' and ISNULL(finishTime)";
            }
            //获取展示的客户数据
            DataSet ds = taskbll.selectBypage(tb, out totalCount, out intPageCount);

            DataTable dt = new DataTable();

            dt.Columns.Add("saleTaskId");
            dt.Columns.Add("customerName");
            DataTable datadt = ds.Tables[0];

            if (datadt != null)
            {
                for (int i = 0; i < datadt.Rows.Count; i++)
                {
                    string taskid     = datadt.Rows[i]["saleTaskId"].ToString();
                    string saleTaskid = taskid.Insert(12, "\n");
                    string name       = datadt.Rows[i]["customerName"].ToString();
                    string customerName;
                    //for (int k=0;k< name.Length;k++)
                    //{
                    //    if (name.Length >= k*7)
                    //    {
                    //        customerName = name.Insert(7, "\n");
                    //    }
                    //    else
                    //    {
                    //        customerName = name;
                    //    }
                    //}
                    if (name.Length >= 7)
                    {
                        customerName = name.Insert(7, "\n");
                    }
                    else
                    {
                        customerName = name;
                    }
                    dt.Rows.Add(saleTaskid, customerName);
                }
            }
            string json = JsonHelper.ToJson(dt, "detail");

            context.Response.Write(json);
            context.Response.End();
        }