示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserIdentity"] != "merchant" && Session["UserIdentity"] != "manager")
        {
            Response.Redirect("error1.html");
        }

        if (!IsPostBack)
        {
            

            //超级管理员导航
            string adminIndex = "<li><a href='/Admin/AdminIndexMain.aspx' target='rightFrm'>" + "待办事项" + "</a></li>";
            string addOrder = "<li><a href='' target='rightFrm'>" + "添加工单" + "</a></li>";
            string orderManage = "<li><a href='OrderManage.aspx' target='rightFrm'>" + "工单管理" + "</a></li>";
            string adminManage = "<li><a href='' target='rightFrm'>" + "用户管理" + "</a></li>"; //时间
            string workerManage = "<li><a href='' target='rightFrm'>" + "师傅管理" + "</a></li>";
            string feeSetting = "<li><a href='' target='rightFrm'>" + "系统设置" + "</a></li>";
            string addressManage = "<li><a href='' target='rightFrm'>" + "地址管理" + "</a></li>";
            string webLog = "<li><a href='' target='rightFrm'>" + "系统日志" + "</a></li>";
            
            //合作商导航
            string checkOrder = "<li><a href='' target='rightFrm'>" + "工单查询" + "</a></li>";

            SqlServerProvider conn = new SqlServerProvider();
            conn.Open();
            DataSet ds = new DataSet();
            string strMenuone = "<div><ul>";
            if (Session["UserIdentity"] == "manager")
            {
                strMenuone += adminIndex;
                ds = conn.GetDataSet("select id,checkWorker,addOrder,editWorker,departName from Y_Admin where userName='******'", ds, "t1");
                UserName.InnerText = ds.Tables["t1"].Rows[0]["departName"] + " " +Convert.ToString(Session["userName"]);
                if ((bool)ds.Tables["t1"].Rows[0]["addOrder"])//有导入工单的权限
                {
                    strMenuone += addOrder;
                }
                strMenuone += orderManage;
                if ((int)ds.Tables["t1"].Rows[0]["id"] == 1)//是超级管理员,id只能是1,数据库不可乱改
                {
                    strMenuone += adminManage;
                }
                if ((bool)ds.Tables["t1"].Rows[0]["checkWorker"])//查看师傅的权限
                {
                    strMenuone += workerManage;
                }
                if ((bool)ds.Tables["t1"].Rows[0]["editWorker"])//有编辑师傅的权限时,显示系统设置(费用设置),和地址管理
                {
                    strMenuone += feeSetting + addressManage ;
                }
                strMenuone +=  webLog + "</ul></div>";
                
            }
            if (Session["UserIdentity"] == "merchant")
            {
                strMenuone += adminIndex;
                ds = conn.GetDataSet("select addOrder,name from Y_Merchant where userName='******'", ds, "t2");
                UserName.InnerText = ds.Tables["t2"].Rows[0]["name"] + " " + Convert.ToString(Session["userName"]);
                if ((bool)ds.Tables["t2"].Rows[0]["addOrder"])
                {
                    strMenuone += addOrder;
                }
                strMenuone += checkOrder + "</ul></div>";
            }
            conn.Close();
            nav.InnerHtml += strMenuone;
            
        }
    }
示例#2
0
 protected void DropDownListProvince2_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (DropDownListProvince2.SelectedValue != "0")
     {
         DropDownListCity.Items.Clear();
         SqlServerProvider conn = new SqlServerProvider();
         conn.Open();
         DataSet ds = new DataSet();
         ds = conn.GetDataSet("select cityId,cityName from Y_City where provinceId='" + DropDownListProvince2.SelectedValue + "'", ds, "t3");
         DropDownListCity.Items.Add(new ListItem("--请选择--", "0"));
         for (int i = 0; i < ds.Tables["t3"].Rows.Count; i++)
         {
             DropDownListCity.Items.Add(new ListItem(ds.Tables["t3"].Rows[i]["cityName"].ToString(), ds.Tables["t3"].Rows[i]["cityId"].ToString()));
         }
         conn.Close();
     }
     else
     {
         DropDownListCity.Items.Clear();
     }
 }
示例#3
0
    protected void GetAllList(int this_nav)
    {
        SqlServerProvider conn = new SqlServerProvider();
        conn.Open();
        int pagestart = (this_nav - 1) * 10 + 1;
        int pageend = this_nav * 10;
        string sql = "select * from(select o.orderId,o.sendTime,o.customerName,o.customerAddress,o.customerMobile,o.isJiesuan,o.chuliId,s.sendType,company,w.name,w.mobile,w.qq,c.conditionType,row_number() over (order by o.orderId asc) as num from Y_Order o left outer join Y_OrderCondition c on c.conditionId=o.conditionId left outer join Y_Worker w on w.workerId=o.workerId left outer join Y_OrderSendType s on s.sendTypeId=o.sendTypeId) as s where s.num between '" + pagestart + "' and '" + pageend + "'";
        DataSet ds = new DataSet();
        ds = conn.GetDataSet(sql, ds, "tb1");
        string p_list = "";
        if (ds.Tables["tb1"].Rows.Count > 0)
        {
            
            for (int i = 0; i < ds.Tables["tb1"].Rows.Count; i++)
            {

                p_list += "<div class='infoBox'><p>" + (i + 1) + ".派单时间:" + ds.Tables["tb1"].Rows[i]["sendTime"];
                if (Convert.ToInt32(ds.Tables["tb1"].Rows[i]["chuliId"]) == 3)
                {
                    p_list += "<span>紧急处理</span>";
                }
                else if (Convert.ToInt32(ds.Tables["tb1"].Rows[i]["chuliId"]) == 2)
                {
                    p_list += "<span>加急处理</span>";
                }
                if (CommonFunction.BoolenYanzhong(Convert.ToInt32(ds.Tables["tb1"].Rows[i]["orderId"])))
                {
                    p_list += "<span>严重超时</span>";
                }
                else if (CommonFunction.BoolenYiban(Convert.ToInt32(ds.Tables["tb1"].Rows[i]["orderId"])))
                {
                    p_list += "<span>一般超时</span>";
                }
                
                p_list += "</p>";
                p_list += "<ul><li class='liInput'><input name='subBox' type='checkbox' value='' /></li><li class='listCustomer'><span class='spanName'>客户姓名:" + ds.Tables["tb1"].Rows[i]["customerName"] + "&nbsp;&nbsp;客户手机:" + ds.Tables["tb1"].Rows[i]["customerMobile"] + "</span>";
                p_list += "<span class='spanAddress'>客户地址:" + ds.Tables["tb1"].Rows[i]["customerAddress"] + "</li><li>" + ds.Tables["tb1"].Rows[i]["company"] + "</li><li>" + ds.Tables["tb1"].Rows[i]["sendType"] + "</li><li>" + ds.Tables["tb1"].Rows[i]["conditionType"] + "</li><li>" + ds.Tables["tb1"].Rows[i]["name"] + ds.Tables["tb1"].Rows[i]["mobile"] + "</li><li class='liEdit'><a href='?act=edit&id=" + ds.Tables["tb1"].Rows[i]["orderId"] + "'>编辑</a><a href='?act=update&id=" + ds.Tables["tb1"].Rows[i]["orderId"] + "'>更新状态</a></li></ul></div>";
            }
            
        }
        else
        {
            p_list = "<span>暂无该类型的工单</span>";
        }
        conn.Close();
        InfoList.InnerHtml = p_list;
    }
示例#4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string act = Request.QueryString["act"];
            string page = Request.QueryString["page"];
            string id =Request.QueryString["id"];
            int idd=Convert.ToInt32(id);
            Int32 this_nav = 1;
            if (page != null && CommonFunction.IsInt(page))
            {
                this_nav = Convert.ToInt32(page);
            }
            SqlServerProvider conn = new SqlServerProvider();
            conn.Open();
            switch (act)
            {
                case "menage":
                    ProvinceTable.Visible = false;
                    CityTable.Visible = false;
                    AreaTable.Visible = false;
                    EditTable.Visible = false;
                    PanelAddressList.Visible = true;
                    GetAddressList(this_nav);
                    break;
                case "addp":
                    ProvinceTable.Visible = true;
                    CityTable.Visible = false;
                    AreaTable.Visible = false;
                    EditTable.Visible = false;
                    PanelAddressList.Visible = false;
                    break;
                case "addc":
                    ProvinceTable.Visible = false;
                    CityTable.Visible = true;
                    AreaTable.Visible = false;
                    EditTable.Visible = false;
                    PanelAddressList.Visible = false;
                    GetProvince1();

                    break;
                case "adda":
                    ProvinceTable.Visible = false;
                    CityTable.Visible = false;
                    AreaTable.Visible = true;
                    EditTable.Visible = false;
                    PanelAddressList.Visible = false;
                    GetProvince2();
                    
                    break;
                case "edit":
                    ProvinceTable.Visible = false;
                    CityTable.Visible = false;
                    AreaTable.Visible = false;
                    PanelAddressList.Visible = false;
                    EditTable.Visible = true;
                    DataSet dss = new DataSet();
                    dss = conn.GetDataSet("select a.areaName,c.cityName,p.provinceName from Y_Area a left outer join Y_City c on c.cityId=a.cityId left outer join Y_Province p on p.provinceId=c.provinceId where a.areaId='" + idd + "'", dss, "t4");
                    if (dss.Tables["t4"].Rows.Count > 0)
                    {
                        TxtEditPro.Text = dss.Tables["t4"].Rows[0]["provinceName"].ToString();
                        TxtEditCity.Text = dss.Tables["t4"].Rows[0]["cityName"].ToString();
                        TxtEditArea.Text = dss.Tables["t4"].Rows[0]["areaName"].ToString();
                    }

                    break;
                default:
                    ProvinceTable.Visible = false;
                    CityTable.Visible = false;
                    AreaTable.Visible = false;
                    PanelAddressList.Visible = true;
                    EditTable.Visible = false;
                    GetAddressList(this_nav);
                    break;
            }
            conn.Close();
        }
           
        
            



        
    }
示例#5
0
    private void GetAddressList(int this_nav)
    {
        SqlServerProvider conn = new SqlServerProvider();
        conn.Open();
        int pagestart = (this_nav - 1) * 10 + 1;
        int pageend = this_nav * 10;
        string sql = "select * from(select p.provinceName,c.cityName,a.areaName,a.areaId,row_number() over (order by p.provinceId) as num from Y_Province p left outer join Y_City c on c.provinceId=p.provinceId left outer join Y_Area a on a.cityId=c.cityId) as s where s.num between '" + pagestart + "' and '" + pageend + "'";
        DataSet ds = new DataSet();
        ds = conn.GetDataSet(sql, ds, "tb1");
        string p_list = "<table><tr><td>省</td><td>市</td><td>区/县</td><td>操作</td></tr>";
        if (ds.Tables["tb1"].Rows.Count > 0)
        {

            for (int i = 0; i < ds.Tables["tb1"].Rows.Count; i++)
            {
                p_list += "<tr><td>" + ds.Tables["tb1"].Rows[i]["provinceName"] + "</td><td>" + ds.Tables["tb1"].Rows[i]["cityName"] + "</td><td>" + ds.Tables["tb1"].Rows[i]["areaName"] + "</td><td><a href='?act=edit&id=" + ds.Tables["tb1"].Rows[i]["areaId"] + "'>编辑</a><a href='?act=deletd&id=" + ds.Tables["tb1"].Rows[i]["areaId"] + "'>删除</a></td></tr>";
            }

        }
        else
        {
            p_list = "<span>暂无地址信息</span>";
        }
        AddressList.InnerHtml = p_list;
        int countAll = 0;
        countAll = Convert.ToInt32(conn.GetCmd("Select Count(distinct areaId) as Alldata From Y_Area").ExecuteScalar());//获取多少条数据
        int pageCount = (int)Math.Ceiling(countAll / 10.0);
        string pagenav = "";
        int num = 1;
        if (this_nav <= 10)
        {
            num = this_nav;
        }
        else
        {
            string this_num = this_nav.ToString();
            num = Convert.ToInt32(this_num.Substring(this_num.Length - 1, 1));
        }
        int start = this_nav - num + 1;
        int end = this_nav - num + 10;
        for (int i = start; i <= end; i++)
        {
            if (i <= pageCount)
            {
                if (i == start && i > 10)
                {
                    pagenav += "<ul><li><a href='?page=1'>←</a></li>";
                    pagenav += "<li><a href='?page=" + (i - 10) + "'>...</a></li>";
                }
                pagenav += "<li><a";
                if (this_nav == i)
                {
                    pagenav += " class='current'";
                }
                pagenav += " href='?page=" + i + "'>" + i + "</a></li>";
                if (i == end)
                {
                    pagenav += "<li><a href='?page=" + (i + 1) + "'>...</a></li>";
                    pagenav += "<li><a href='?page=" + pageCount + "'>→</a></li>";
                }
            }
        }
        pagenav = "<ul class='pagenavigation'>" + pagenav + "</ul>";
        PageList.InnerHtml = pagenav;
        conn.Close();
        
    }
示例#6
0
 private void GetProvince1()
 {
     SqlServerProvider conn = new SqlServerProvider();
     conn.Open();
     DataSet dsss = new DataSet();
     dsss = conn.GetDataSet("select provinceId,provinceName from Y_Province", dsss, "t2");
     DropDownListProvince1.Items.Add(new ListItem("--请选择--", "0"));
     for (int i = 0; i < dsss.Tables["t2"].Rows.Count; i++)
     {
         DropDownListProvince1.Items.Add(new ListItem(dsss.Tables["t2"].Rows[i]["provinceName"].ToString(), dsss.Tables["t2"].Rows[i]["provinceId"].ToString()));
     }
     conn.Close();
 }
示例#7
0
 protected void BtnSerch_Click(object sender, EventArgs e)
 {
     SqlServerProvider conn = new SqlServerProvider();
     conn.Open();
     DropDownListProvince1.Items.Clear();
     DataSet ds = new DataSet();
     ds = conn.GetDataSet("select provinceId,provinceName from Y_Province", ds, "t1");
     DropDownListProvince1.Items.Add(new ListItem("--请选择--", "0"));
     for (int i = 0; i < ds.Tables["t1"].Rows.Count; i++)
     {
         DropDownListProvince1.Items.Add(new ListItem(ds.Tables["t1"].Rows[i]["provinceName"].ToString(), ds.Tables["t1"].Rows[i]["provinceId"].ToString()));
     }
     conn.Close();
 }
示例#8
0
        public static bool BoolenYiban(int order_id)
        {
            SqlServerProvider conn = new SqlServerProvider();
            conn.Open();
            int conditionId = Convert.ToInt32(conn.GetItem("select conditionId from Y_Order where orderId='" + order_id + "'", "0"));
            if ((conditionId != 3 && conditionId != 4 && conditionId != 5) || conditionId == 0)
            {
                conn.Close();
                return false;
            }
            else
            {
                string time = "";
                //待安装
                if (conditionId == 5)
                {
                    time = conn.GetItem("select top 1 subscribeTime from Y_OrderChange where orderId='" + order_id + "' order by changeTime desc", "0001/1/1 0:00:00");
                }
                //待确认需电联
                else
                {
                    time = conn.GetItem("select top 1 changeTime from Y_OrderChange where orderId='" + order_id + "' order by changeTime desc", "0001/1/1 0:00:00");
                }
                if (time != "")
                {
                    DateTime Time = Convert.ToDateTime(time);
                    if (Time.ToString() != "0001/1/1 0:00:00")
                    {
                        DataSet ds = new DataSet();
                        ds =
                            conn.GetDataSet(
                                "select yiban,yanzhong from Y_Chaoshi where conditionId='" + conditionId + "'", ds, "t1");
                        conn.Close();
                        int yibanTime = Convert.ToInt32(ds.Tables["t1"].Rows[0]["yiban"]);
                        int yanzhongTime = Convert.ToInt32(ds.Tables["t1"].Rows[0]["yanzhong"]);
                        TimeSpan ts = DateTime.Now - Time; //获得两个时间差
                        if (ts.TotalHours > yibanTime && ts.TotalHours < yanzhongTime) //ts.TotalHours把时间差转换为小时
                        {
                            return true;
                        }
                        else
                        {
                            return false;
                        }
                    }
                    else
                    {
                        conn.Close();
                        return false;
                    }
                }
                else
                {
                    conn.Close();
                    return false;
                }

            }
        }
示例#9
0
        public static bool BoolenYiban(int order_id)
        {
            SqlServerProvider conn = new SqlServerProvider();
            conn.Open();
            int conditionId = Convert.ToInt32(conn.GetItem("select conditionId from Y_Order where orderId='" + order_id + "'", "0"));
            if ((conditionId != 3 && conditionId != 4 && conditionId != 5) || conditionId == 0)
            {
                return false;
            }
            else
            {
                //查询获得最新的一个更新时间
                DateTime changeTime = Convert.ToDateTime(conn.GetItem("select top 1 changeTime from Y_OrderChange where orderId='" + order_id + "' order by changeTime desc", "0001/1/1 0:00:00"));//这里随便写个查不到的时间,防止查不到的时候出错
                if (changeTime.ToString() != "0001/1/1 0:00:00")
                {
                    DataSet ds = new DataSet();
                    ds = conn.GetDataSet("select yiban,yanzhong from Y_Chaoshi where conditionId='" + conditionId + "'", ds, "t1");
                    int yibanTime = Convert.ToInt32(ds.Tables["t1"].Rows[0]["yiban"]);
                    int yanzhongTime = Convert.ToInt32(ds.Tables["t1"].Rows[0]["yanzhong"]);
                    TimeSpan ts = DateTime.Now - changeTime;//获得两个时间差
                    if (ts.TotalHours > yibanTime && ts.TotalHours < yanzhongTime)//ts.TotalHours把时间差转换为小时
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                }
                else
                {
                    return false;
                }
                

            }
        }
示例#10
0
    private void GetMechantList()
    {
        SqlServerProvider conn = new SqlServerProvider();
        conn.Open();
        string sql = "select o.orderId,o.customerName,o.customerAddress,o.orderTime,o.jiajiGradeId,o.customerMobile,o.isJiesuan,ch.chuliName,o.company,w.name,w.mobile,w.qq,c.conditionType,j.jiajiType from Y_Order o left outer join Y_OrderCondition c on c.conditionId=o.conditionId left outer join Y_Worker w on w.workerId=o.workerId left outer join Y_JiajiType j on j.jiajiTypeId=o.jiajiTypeId left outer join Y_Chuli ch on ch.chuliId=o.chuliId where o.conditionId=1";
        DataSet ds = new DataSet();
        ds = conn.GetDataSet(sql, ds, "tb1");
        string p_list = "";
        if (ds.Tables["tb1"].Rows.Count > 0)
        {
            for (int i = 0; i < ds.Tables["tb1"].Rows.Count; i++)
            {

                p_list += "<div class='infoBox'><p>工单ID:" + ds.Tables["tb1"].Rows[i]["orderId"] + ".下单时间:" + ds.Tables["tb1"].Rows[i]["orderTime"];

                p_list += "</p>";
                p_list += "<ul><li class='liInput'><input name='subBox' id='subBox' type='checkbox' value='" + ds.Tables["tb1"].Rows[i]["orderId"] + "' /></li><li class='listCustomer'><span class='spanName'>客户姓名:" + ds.Tables["tb1"].Rows[i]["customerName"] + "&nbsp;&nbsp;客户手机:" + ds.Tables["tb1"].Rows[i]["customerMobile"] + "</span>";
                p_list += "<span class='spanAddress'>客户地址:" + ds.Tables["tb1"].Rows[i]["customerAddress"] + "</li><li>" + ds.Tables["tb1"].Rows[i]["company"] + "</li><li></li><li>" + ds.Tables["tb1"].Rows[i]["conditionType"] + "</li><li>" + ds.Tables["tb1"].Rows[i]["name"] + ds.Tables["tb1"].Rows[i]["mobile"] + "</li><li class='liEdit'><a href='?act=edit&id=" + ds.Tables["tb1"].Rows[i]["orderId"] + "'>编辑</a><a href='?act=receive&id=" + ds.Tables["tb1"].Rows[i]["orderId"] + "'>确认接单</a></li></ul></div>";
            }

        }
        else
        {
            p_list = "<span>暂无该类型的工单</span>";
        }
        conn.Close();
        InfoList.InnerHtml = p_list;
    }
示例#11
0
    protected void GetAllList(int this_nav,string act)
    {
        SqlServerProvider conn = new SqlServerProvider();
        conn.Open();
        int pagestart = (this_nav - 1) * 10 + 1;
        int pageend = this_nav * 10;
        string sql = "select * from(select o.orderId,o.customerName,o.customerAddress,o.orderTime,o.jiajiGradeId,o.customerMobile,o.isJiesuan,ch.chuliName,s.sendType,o.company,w.name,w.mobile,w.qq,c.conditionType,j.jiajiType,row_number() over (order by o.orderId asc) as num from Y_Order o left outer join Y_OrderCondition c on c.conditionId=o.conditionId left outer join Y_Worker w on w.workerId=o.workerId left outer join Y_OrderSendType s on s.sendTypeId=o.sendTypeId left outer join Y_JiajiType j on j.jiajiTypeId=o.jiajiTypeId left outer join Y_Chuli ch on ch.chuliId=o.chuliId) as s where s.num between '" + pagestart + "' and '" + pageend + "'";
        DataSet ds = new DataSet();
        ds = conn.GetDataSet(sql, ds, "tb1");
        string p_list = "";
        if (ds.Tables["tb1"].Rows.Count > 0)
        {
            
            for (int i = 0; i < ds.Tables["tb1"].Rows.Count; i++)
            {

                p_list += "<div class='infoBox'><p>工单ID:" + ds.Tables["tb1"].Rows[i]["orderId"] + ".下单时间:" + ds.Tables["tb1"].Rows[i]["orderTime"];
                if (Convert.ToInt32(ds.Tables["tb1"].Rows[i]["jiajiGradeId"]) != 1)
                {
                    p_list += "<span>加急处理等级:" + ds.Tables["tb1"].Rows[i]["jiajiGradeId"] + "</span><span>加急处理类型:" + ds.Tables["tb1"].Rows[i]["jiajiType"] + "</span><span>处理进度:" + ds.Tables["tb1"].Rows[i]["chuliName"] + "</span>";
                }
                
                if (CommonFunction.BoolenYanzhong(Convert.ToInt32(ds.Tables["tb1"].Rows[i]["orderId"])))
                {
                    p_list += "<span>严重超时</span>";
                }
                else if (CommonFunction.BoolenYiban(Convert.ToInt32(ds.Tables["tb1"].Rows[i]["orderId"])))
                {
                    p_list += "<span>一般超时</span>";
                }
                
                p_list += "</p>";
                p_list += "<ul><li class='liInput'><input name='subBox' id='subBox' type='checkbox' value='" + ds.Tables["tb1"].Rows[i]["orderId"] + "' /></li><li class='listCustomer'><span class='spanName'>客户姓名:" + ds.Tables["tb1"].Rows[i]["customerName"] + "&nbsp;&nbsp;客户手机:" + ds.Tables["tb1"].Rows[i]["customerMobile"] + "</span>";
                p_list += "<span class='spanAddress'>客户地址:" + ds.Tables["tb1"].Rows[i]["customerAddress"] + "</li><li>" + ds.Tables["tb1"].Rows[i]["company"] + "</li><li>" + ds.Tables["tb1"].Rows[i]["sendType"] + "</li><li>" + ds.Tables["tb1"].Rows[i]["conditionType"] + "</li><li>" + ds.Tables["tb1"].Rows[i]["name"] + ds.Tables["tb1"].Rows[i]["mobile"] + "</li><li class='liEdit'><a href='?act=edit&id=" + ds.Tables["tb1"].Rows[i]["orderId"] + "'>编辑</a><a href='?act=update&id=" + ds.Tables["tb1"].Rows[i]["orderId"] + "'>更新状态</a></li></ul></div>";
            }
            
        }
        else
        {
            p_list = "<span>暂无该类型的工单</span>";
        }
        int countAll = 0;
        countAll = Convert.ToInt32(conn.GetCmd("Select Count(distinct orderId) as Alldata From Y_Order").ExecuteScalar());//获取多少条数据
        int pageCount = (int)Math.Ceiling(countAll / 10.0);
        string pagenav = "";
        int num = 1;
        if (this_nav <= 10)
        {
            num = this_nav;
        }
        else
        {
            string this_num = this_nav.ToString();
            num = Convert.ToInt32(this_num.Substring(this_num.Length - 1, 1));
        }
        int start = this_nav - num + 1;
        int end = this_nav - num + 10;
        for (int i = start; i <= end; i++)
        {
            if (i <= pageCount)
            {
                if (i == start && i > 10)
                {
                    pagenav += "<ul><li><a href='?act=" + act + "&page=1'>←</a></li>";
                    pagenav += "<li><a href='?act=" + act + "&page=" + (i - 10) + "'>...</a></li>";
                }
                pagenav += "<li><a";
                if (this_nav == i)
                {
                    pagenav += " class='current'";
                }
                pagenav += " href='?act=" + act + "&page=" + i + "'>" + i + "</a></li>";
                if (i == end)
                {
                    pagenav += "<li><a href='?act=" + act + "&page=" + (i + 1) + "'>...</a></li>";
                    pagenav += "<li><a href='?act=" + act + "&page=" + pageCount + "'>→</a></li>";
                }
            }
        }
        pagenav = "<ul class='pagenavigation'>" + pagenav + "</ul>";

        PageList.InnerHtml = pagenav;
        conn.Close();
        InfoList.InnerHtml = p_list;
    }
示例#12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //判断通过身份验证的用户是否有权限访问本页面 
        FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity;
        //判断通过身份验证的用户是否是Admin角色 
        if (!id.Ticket.UserData.Contains("admin"))
        {
            //跳转到访问权限不够的错误提示页面 
            Response.Redirect("~/Admin/error.html");
        }

        if (Session["UserIdentity"] != "manager")
        {
            Response.Redirect("error1.html");
        }

        if (!IsPostBack)
        {



            Int32 this_nav = 1;
            if (Request.QueryString["page"] != null && CommonFunction.IsInt(Request.QueryString["page"]))
            {
                this_nav = Convert.ToInt32(Request.QueryString["page"]);
            }
            SqlServerProvider conn = new SqlServerProvider();
            conn.Open();

            string sqlcount = "Select Count(distinct orderId) as Alldata From Y_Order";
            Int32 countAll = Convert.ToInt32(conn.GetCmd(sqlcount).ExecuteScalar());//获取多少条数据


            int pagestart = (this_nav - 1) * 10 + 1;
            int pageend = this_nav * 10;

            string sql = "select * from(select o.orderId,o.sendTime,o.customerName,o.customerAddress,o.customerMobile,o.isYiban,o.isYanzhong,o.isJinji,o.isJiaji,s.sendType,company,w.name,w.mobile,w.qq,c.conditionType,row_number() over (order by o.orderId asc) as num from Y_Order o left outer join Y_OrderCondition c on c.conditionId=o.conditionId left outer join Y_Worker w on w.workerId=o.workerId left outer join Y_OrderSendType s on s.sendTypeId=o.sendTypeId) as s where s.num between '" + pagestart + "' and '" + pageend + "'";
            DataSet ds = new DataSet();
            ds = conn.GetDataSet(sql, ds, "tb1");


            if (ds.Tables["tb1"].Rows.Count > 0)
            {
                string p_list = "";
                for (int i = 0; i < ds.Tables["tb1"].Rows.Count; i++)
                {
                    p_list += "<div class='infoBox'><p>" + (i + 1) + ".派单时间:" + ds.Tables["tb1"].Rows[i]["sendTime"];
                    if ((bool)ds.Tables["tb1"].Rows[i]["isYiban"])
                    {
                        p_list += "<span>一般超时</span>";
                    }
                    if ((bool)ds.Tables["tb1"].Rows[i]["isYanzhong"])
                    {
                        p_list += "<span>严重超时</span>";
                    }
                    if ((bool)ds.Tables["tb1"].Rows[i]["isJinji"])
                    {
                        p_list += "<span>紧急处理</span>";
                    }
                    if ((bool)ds.Tables["tb1"].Rows[i]["isJiaji"])
                    {
                        p_list += "<span>加急处理</span>";
                    }
                    p_list += "</p>";
                    p_list += "<ul><li class='listCustomer'><span class='spanName'>客户姓名:" + ds.Tables["tb1"].Rows[i]["customerName"] + "&nbsp;&nbsp;客户手机:" + ds.Tables["tb1"].Rows[i]["customerMobile"] + "</span>";
                    p_list += "<span class='spanAddress'>客户地址:" + ds.Tables["tb1"].Rows[i]["customerAddress"] + "</li><li>" + ds.Tables["tb1"].Rows[i]["company"] + "</li><li>" + ds.Tables["tb1"].Rows[i]["sendType"] + "</li><li>" + ds.Tables["tb1"].Rows[i]["conditionType"] + "</li><li>" + ds.Tables["tb1"].Rows[i]["name"] + ds.Tables["tb1"].Rows[i]["mobile"] + "</li><li><a href='?act=edit&id=" + ds.Tables["tb1"].Rows[i]["orderId"] + "'>编辑</a><a href='?act=update&id=" + ds.Tables["tb1"].Rows[i]["orderId"] + "'>更新状态</a></li></ul></div>";
                }
                InfoList.InnerHtml = p_list;
            }
            //int pageCount = (int)Math.Ceiling(countAll / 10.0);
            //string pagenav = "";
            //int num = 1;
            //if (this_nav <= 10)
            //{
            //    num = this_nav;
            //}
            //else
            //{
            //    string this_num = this_nav.ToString();
            //    num = Convert.ToInt32(this_num.Substring(this_num.Length - 1, 1));
            //}
            //int start = this_nav - num + 1;
            //int end = this_nav - num + 10;
            //for (int i = start; i <= end; i++)
            //{
            //    if (i <= pageCount)
            //    {
            //        if (i == start && i > 10)
            //        {
            //            pagenav += "<li><a href='?page=1'>←</a></li>";
            //            pagenav += "<li><a href='?page=" + (i - 1) + "'>...</a></li>";
            //        }
            //        pagenav += "<li><a";
            //        if (this_nav == i)
            //        {
            //            pagenav += " class='current'";
            //        }
            //        pagenav += " href='?page=" + i + "'>" + i + "</a></li>";
            //        if (i == end)
            //        {
            //            pagenav += "<li><a href='?page=" + (i + 1) + "'>...</a></li>";
            //            pagenav += "<li><a href='?page=" + pageCount + "'>→</a></li>";
            //        }
            //    }
            //}
            //pagenav = "<ul class='pagenavigation'>" + pagenav + "</ul>";

            //pagenavi.InnerHtml = pagenav;


           // ds.Clear();

            //conn.Close();
        }
    }