private string createList(string SRVTypeName, string SRVSPNo)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder("");

            sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort\" id=\"tablelist\">");
            sb.Append("<thead>");
            sb.Append("<tr class=\"text-c\">");
            sb.Append("<th width=\"5%\">序号</th>");
            sb.Append("<th width='15%'>服务类型编号</th>");
            sb.Append("<th width='20%'>服务类型名称</th>");
            sb.Append("<th width='20%'>父项类型</th>");
            //sb.Append("<th width='15%'>服务商</th>");
            sb.Append("<th width='30%'>描述</th>");
            sb.Append("<th width='10%'>状态</th>");
            sb.Append("</tr>");
            sb.Append("</thead>");

            int r = 1;

            sb.Append("<tbody>");
            Business.Base.BusinessServiceType bc = new project.Business.Base.BusinessServiceType();
            foreach (Entity.Base.EntityServiceType it in bc.GetListQuery(string.Empty, SRVTypeName, "null", SRVSPNo, null))
            {
                sb.Append("<tr class=\"text-c\" id=\"" + it.SRVTypeNo + "\">");
                sb.Append("<td style=\"text-align:center;\">" + r.ToString() + "</td>");
                sb.Append("<td style=\"text-align:left;\">" + it.SRVTypeNo + "</td>");
                sb.Append("<td style=\"text-align:left;\">" + it.SRVTypeName + "</td>");
                sb.Append("<td style=\"text-align:left;\">" + it.ParentTypeName + "</td>");
                //sb.Append("<td style=\"text-align:left;\">" + it.SRVSPName + "</td>");
                sb.Append("<td style=\"text-align:left;\">" + it.Remark + "</td>");
                sb.Append("<td class=\"td-status\"><span class=\"label " + (it.SRVStatus ? "label-success" : "") + " radius\">" + (it.SRVStatus ? "有效" : "已失效") + "</span></td>");
                sb.Append("</tr>");
                r++;

                Business.Base.BusinessServiceType bc1 = new project.Business.Base.BusinessServiceType();
                foreach (Entity.Base.EntityServiceType it1 in bc1.GetListQuery(string.Empty, SRVTypeName, it.SRVTypeNo, SRVSPNo, null))
                {
                    sb.Append("<tr class=\"text-c\" id=\"" + it1.SRVTypeNo + "\">");
                    sb.Append("<td style=\"text-align:center;\">" + r.ToString() + "</td>");
                    sb.Append("<td style=\"text-align:left;\">" + it1.SRVTypeNo + "</td>");
                    sb.Append("<td style=\"text-align:left;\">&nbsp;&nbsp;&nbsp;&nbsp;" + it1.SRVTypeName + "</td>");
                    sb.Append("<td style=\"text-align:left;\">" + it1.ParentTypeName + "</td>");
                    //sb.Append("<td style=\"text-align:left;\">" + it1.SRVSPName + "</td>");
                    sb.Append("<td style=\"text-align:left;\">" + it1.Remark + "</td>");
                    sb.Append("<td class=\"td-status\"><span class=\"label " + (it1.SRVStatus ? "label-success" : "") + " radius\">" + (it1.SRVStatus ? "有效" : "已失效") + "</span></td>");
                    sb.Append("</tr>");
                    r++;
                }
            }
            sb.Append("</tbody>");
            sb.Append("</table>");

            return(sb.ToString());
        }
Exemple #2
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            try
            {
                HttpCookie hc = getCookie("1");
                if (hc != null)
                {
                    string str = hc.Value.Replace("%3D", "=");
                    userid = Encrypt.DecryptDES(str, "1");
                    user.load(userid);
                    CheckRight(user.Entity, "pm/Base/ServiceProvider.aspx");

                    if (!Page.IsCallback)
                    {
                        if (user.Entity.UserType.ToUpper() != "ADMIN")
                        {
                            string sqlstr = "select a.RightCode from Sys_UserRight a left join sys_menu b on a.MenuId=b.MenuID " +
                                            "where a.UserType='" + user.Entity.UserType + "' and menupath='pm/Base/ServiceProvider.aspx'";
                            DataTable dt = obj.PopulateDataSet(sqlstr).Tables[0];
                            if (dt.Rows.Count > 0)
                            {
                                string rightCode = dt.Rows[0]["RightCode"].ToString();
                                if (rightCode.IndexOf("insert") >= 0)
                                {
                                    Buttons += "<a href=\"javascript:;\" onclick=\"insert()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\">&#xe600;</i> 添加</a>&nbsp;&nbsp;";
                                }
                                if (rightCode.IndexOf("update") >= 0)
                                {
                                    Buttons += "<a href=\"javascript:;\" onclick=\"update()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\">&#xe60c;</i> 修改</a>&nbsp;&nbsp;";
                                }
                                if (rightCode.IndexOf("delete") >= 0)
                                {
                                    Buttons += "<a href=\"javascript:;\" onclick=\"del()\" class=\"btn btn-danger radius\"><i class=\"Hui-iconfont\">&#xe6e2;</i> 删除</a>&nbsp;&nbsp;";
                                }
                                if (rightCode.IndexOf("vilad") >= 0)
                                {
                                    Buttons += "<a href=\"javascript:;\" onclick=\"valid()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\">&#xe615;</i> 启用/停用</a>&nbsp;&nbsp;";
                                }
                            }
                        }
                        else
                        {
                            Buttons += "<a href=\"javascript:;\" onclick=\"insert()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\">&#xe600;</i> 添加</a>&nbsp;&nbsp;";
                            Buttons += "<a href=\"javascript:;\" onclick=\"update()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\">&#xe60c;</i> 修改</a>&nbsp;&nbsp;";
                            Buttons += "<a href=\"javascript:;\" onclick=\"del()\" class=\"btn btn-danger radius\"><i class=\"Hui-iconfont\">&#xe6e2;</i> 删除</a>&nbsp;&nbsp;";
                            Buttons += "<a href=\"javascript:;\" onclick=\"valid()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\">&#xe615;</i> 启用/停用</a>&nbsp;&nbsp;";
                        }

                        list = createList(string.Empty, 1);

                        ServiceTypeStr  = "<select class=\"input-text required\" id=\"MService\" data-valid=\"between:0-30\" data-error=\"\">";
                        ServiceTypeStr += "<option value=\"\" selected>请选择主营业务</option>";

                        Business.Base.BusinessServiceType tp = new project.Business.Base.BusinessServiceType();
                        foreach (Entity.Base.EntityServiceType it in tp.GetListQuery(string.Empty, string.Empty, "null", string.Empty, true))
                        {
                            ServiceTypeStr += "<option value='" + it.SRVTypeNo + "'>" + it.SRVTypeName + "</option>";
                        }
                        ServiceTypeStr += "</select>";
                    }
                }
                else
                {
                    Response.Write(errorpage);
                    return;
                }
            }
            catch
            {
                Response.Write(errorpage);
                return;
            }
        }
Exemple #3
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            try
            {
                HttpCookie hc = getCookie("1");
                if (hc != null)
                {
                    string str = hc.Value.Replace("%3D", "=");
                    userid = Encrypt.DecryptDES(str, "1");
                    user.load(userid);
                    CheckRight(user.Entity, "pm/Base/Service.aspx");

                    if (!Page.IsCallback)
                    {
                        if (user.Entity.UserType.ToUpper() != "ADMIN")
                        {
                            string sqlstr = "select a.RightCode from Sys_UserRight a left join sys_menu b on a.MenuId=b.MenuID " +
                                            "where a.UserType='" + user.Entity.UserType + "' and menupath='pm/Base/Service.aspx'";
                            DataTable dt = obj.PopulateDataSet(sqlstr).Tables[0];
                            if (dt.Rows.Count > 0)
                            {
                                string rightCode = dt.Rows[0]["RightCode"].ToString();
                                if (rightCode.IndexOf("insert") >= 0)
                                {
                                    Buttons += "<a href=\"javascript:;\" onclick=\"insert()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\">&#xe600;</i> 添加</a>&nbsp;&nbsp;";
                                }
                                if (rightCode.IndexOf("update") >= 0)
                                {
                                    Buttons += "<a href=\"javascript:;\" onclick=\"update()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\">&#xe60c;</i> 修改</a>&nbsp;&nbsp;";
                                }
                                if (rightCode.IndexOf("delete") >= 0)
                                {
                                    Buttons += "<a href=\"javascript:;\" onclick=\"del()\" class=\"btn btn-danger radius\"><i class=\"Hui-iconfont\">&#xe6e2;</i> 删除</a>&nbsp;&nbsp;";
                                }
                                if (rightCode.IndexOf("vilad") >= 0)
                                {
                                    Buttons += "<a href=\"javascript:;\" onclick=\"valid()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\">&#xe615;</i> 启用/停用</a>&nbsp;&nbsp;";
                                }
                            }
                        }
                        else
                        {
                            Buttons += "<a href=\"javascript:;\" onclick=\"insert()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\">&#xe600;</i> 添加</a>&nbsp;&nbsp;";
                            Buttons += "<a href=\"javascript:;\" onclick=\"update()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\">&#xe60c;</i> 修改</a>&nbsp;&nbsp;";
                            Buttons += "<a href=\"javascript:;\" onclick=\"del()\" class=\"btn btn-danger radius\"><i class=\"Hui-iconfont\">&#xe6e2;</i> 删除</a>&nbsp;&nbsp;";
                            Buttons += "<a href=\"javascript:;\" onclick=\"valid()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\">&#xe615;</i> 启用/停用</a>&nbsp;&nbsp;";
                        }

                        list = createList(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, 1);

                        SRVTypeNo1Str  = "<select class=\"input-text required\" id=\"SRVTypeNo1\" style=\"width:240px;\" data-valid=\"isNonEmpty\" data-error=\"请选择所属服务大类\">";
                        SRVTypeNo1Str += "<option value=\"\" selected></option>";

                        SRVTypeNo1StrS  = "<select class=\"input-text size-MINI\" id=\"SRVTypeNo1S\" style=\"width:120px;\" >";
                        SRVTypeNo1StrS += "<option value=\"\" selected>全部</option>";
                        Business.Base.BusinessServiceType bc1 = new project.Business.Base.BusinessServiceType();
                        foreach (Entity.Base.EntityServiceType it in bc1.GetListQuery(string.Empty, string.Empty, "null", string.Empty, true))
                        {
                            SRVTypeNo1Str  += "<option value='" + it.SRVTypeNo + "'>" + it.SRVTypeName + "</option>";
                            SRVTypeNo1StrS += "<option value='" + it.SRVTypeNo + "'>" + it.SRVTypeName + "</option>";
                        }
                        SRVTypeNo1Str  += "</select>";
                        SRVTypeNo1StrS += "</select>";

                        SRVTypeNo2Str  = "<select class=\"input-text required\" id=\"SRVTypeNo2\" style=\"width:240px;\" data-valid=\"isNonEmpty\" data-error=\"请选择所属服务小类\">";
                        SRVTypeNo2Str += "<option value=\"\" selected></option>";

                        SRVTypeNo2StrS  = "<select class=\"input-text size-MINI\" id=\"SRVTypeNo2S\" style=\"width:120px;\">";
                        SRVTypeNo2StrS += "<option value=\"\" selected>全部</option>";
                        //Business.Base.BusinessServiceType bc2 = new project.Business.Base.BusinessServiceType();
                        //foreach (Entity.Base.EntityServiceType it in bc1.GetListQuery(string.Empty, string.Empty,"empty",string.Empty,true))
                        //{
                        //    SRVTypeNo2Str += "<option value='" + it.SRVTypeNo + "'>" + it.SRVTypeName + "</option>";
                        //    SRVTypeNo2StrS += "<option value='" + it.SRVTypeNo + "'>" + it.SRVTypeName + "</option>";
                        //}
                        SRVTypeNo2Str  += "</select>";
                        SRVTypeNo2StrS += "</select>";

                        CANoStr  = "<select class=\"input-text required\" id=\"CANo\" style=\"width:240px;\" data-valid=\"isNonEmpty\" data-error=\"财务收费科目不能为空\">";
                        CANoStr += "<option value=\"\" selected></option>";

                        CANoStrS  = "<select class=\"input-text size-MINI\" id=\"CANoS\" style=\"width:120px;\" >";
                        CANoStrS += "<option value=\"\" selected>全部</option>";
                        Business.Base.BusinessChargeAccount bc2 = new project.Business.Base.BusinessChargeAccount();
                        foreach (Entity.Base.EntityChargeAccount it in bc2.GetListQuery(string.Empty, string.Empty, string.Empty))
                        {
                            //CANoStr += "<option value='" + it.CANo + "'>" + it.CAName + " - " + it.CASPName + "</option>";
                            CANoStrS += "<option value='" + it.CANo + "'>" + it.CAName + " - " + it.CASPName + "</option>";
                        }
                        CANoStr  += "</select>";
                        CANoStrS += "</select>";

                        SRVSPNoStr  = "<select class=\"input-text required\" id=\"SRVSPNo\" style=\"width:240px;\" data-valid=\"isNonEmpty\" data-error=\"请选择服务商\">";
                        SRVSPNoStr += "<option value=\"\"></option>";

                        SRVSPNoStrS  = "<select class=\"input-text size-MINI\" id=\"SRVSPNoS\" style=\"width:120px;\" >";
                        SRVSPNoStrS += "<option value=\"\" selected>全部</option>";
                        Business.Base.BusinessServiceProvider tp = new project.Business.Base.BusinessServiceProvider();
                        foreach (Entity.Base.EntityServiceProvider it in tp.GetListQuery(string.Empty, string.Empty, true))
                        {
                            SRVSPNoStr  += "<option value='" + it.SPNo + "'>" + it.SPName + "</option>";
                            SRVSPNoStrS += "<option value='" + it.SPNo + "'>" + it.SPName + "</option>";
                        }
                        SRVSPNoStr  += "</select>";
                        SRVSPNoStrS += "</select>";
                    }
                }
                else
                {
                    Response.Write(errorpage);
                    return;
                }
            }
            catch
            {
                Response.Write(errorpage);
                return;
            }
        }
Exemple #4
0
        private string createList(string Name, int page)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder("");
            try
            {
                if (Request.QueryString["type"] == "user")
                {
                    sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort\" id=\"tablelist\">");
                    sb.Append("<thead>");
                    sb.Append("<tr class=\"text-c\">");
                    sb.Append("<th width='35%'>用户编号</th>");
                    sb.Append("<th width='65%'>用户名称</th>");
                    sb.Append("</tr>");
                    sb.Append("</thead>");

                    sb.Append("<tbody>");
                    Business.Sys.BusinessUserInfo pt = new project.Business.Sys.BusinessUserInfo();
                    foreach (Entity.Sys.EntityUserInfo it in pt.GetUserInfoListQuery(string.Empty, Name, page, 15))
                    {
                        sb.Append("<tr class=\"text-c\" id='" + it.UserNo + "' onclick='submit(\"" + it.UserNo + "\")'>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.UserNo + "<input type='hidden' id='it" + it.UserNo + "' value='" + it.UserName + "' /></td>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.UserName + "</td>");
                        sb.Append("</tr>");
                    }
                    sb.Append("</tbody>");
                    sb.Append("</table>");
                    sb.Append(Paginat(pt.GetUserInfoListCount(string.Empty, Name), 15, page, 5));
                }
                else if (Request.QueryString["type"] == "SRVType")
                {
                    sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort\" id=\"tablelist\">");
                    sb.Append("<thead>");
                    sb.Append("<tr class=\"text-c\">");
                    sb.Append("<th width='35%'>服务类型编号</th>");
                    sb.Append("<th width='65%'>服务类型名称</th>");
                    sb.Append("</tr>");
                    sb.Append("</thead>");

                    sb.Append("<tbody>");
                    Business.Base.BusinessServiceType pt = new project.Business.Base.BusinessServiceType();
                    foreach (Entity.Base.EntityServiceType it in pt.GetListQuery(string.Empty, Name, "null", string.Empty, true, page, 15))
                    {
                        sb.Append("<tr class=\"text-c\" id='" + it.SRVTypeNo + "' onclick='submit(\"" + it.SRVTypeNo + "\")'>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.SRVTypeNo + "<input type='hidden' id='it" + it.SRVTypeNo + "' value='" + it.SRVTypeName + "' /></td>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.SRVTypeName + "</td>");
                        sb.Append("</tr>");
                    }
                    sb.Append("</tbody>");
                    sb.Append("</table>");
                    sb.Append(Paginat(pt.GetListCount(string.Empty, Name, "null", string.Empty, true), 15, page, 5));
                }
                else if (Request.QueryString["type"] == "LOC")
                {
                    sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort\" id=\"tablelist\">");
                    sb.Append("<thead>");
                    sb.Append("<tr class=\"text-c\">");
                    sb.Append("<th width='35%'>编号</th>");
                    sb.Append("<th width='65%'>名称</th>");
                    sb.Append("</tr>");
                    sb.Append("</thead>");

                    sb.Append("<tbody>");
                    Business.Base.BusinessLocation pt = new project.Business.Base.BusinessLocation();
                    foreach (Entity.Base.EntityLocation it in pt.GetListQuery(string.Empty, Name, string.Empty, page, 15))
                    {
                        string spacestr = "";
                        int    row      = 1;
                        while (row <= it.LOCLevel)
                        {
                            spacestr += "&nbsp;&nbsp;&nbsp;&nbsp;";
                            row++;
                        }

                        sb.Append("<tr class=\"text-c\" id='" + it.LOCNo + "' onclick='submit(\"" + it.LOCNo + "\")'>");
                        sb.Append("<td style=\"white-space: nowrap;text-align:left;\">" + it.LOCNo + "<input type='hidden' id='it" + it.LOCNo + "' value='" + it.LOCName + "' /></td>");
                        sb.Append("<td style=\"white-space: nowrap;text-align:left;\">" + spacestr + it.LOCName + "</td>");
                        sb.Append("</tr>");
                    }
                    sb.Append("</tbody>");
                    sb.Append("</table>");
                    sb.Append(Paginat(pt.GetListCount(string.Empty, Name, string.Empty), 15, page, 5));
                }
                else if (Request.QueryString["type"] == "Cust")
                {
                    sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort\" id=\"tablelist\">");
                    sb.Append("<thead>");
                    sb.Append("<tr class=\"text-c\">");
                    sb.Append("<th width='35%'>客户编号</th>");
                    sb.Append("<th width='65%'>客户名称</th>");
                    sb.Append("</tr>");
                    sb.Append("</thead>");

                    sb.Append("<tbody>");
                    Business.Base.BusinessCustomer pt = new project.Business.Base.BusinessCustomer();
                    foreach (Entity.Base.EntityCustomer it in pt.GetListQuery(string.Empty, Name, string.Empty, string.Empty, page, 15))
                    {
                        sb.Append("<tr class=\"text-c\" id='" + it.CustNo + "' onclick='submit(\"" + it.CustNo + "\")'>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.CustNo + "<input type='hidden' id='it" + it.CustNo + "' value='" + it.CustName + "' /></td>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.CustName + "</td>");
                        sb.Append("</tr>");
                    }
                    sb.Append("</tbody>");
                    sb.Append("</table>");
                    sb.Append(Paginat(pt.GetListCount(string.Empty, Name, string.Empty, string.Empty), 15, page, 5));
                }
                else if (Request.QueryString["type"] == "Billboard")
                {
                    sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort\" id=\"tablelist\">");
                    sb.Append("<thead>");
                    sb.Append("<tr class=\"text-c\">");
                    sb.Append("<th width='20%'>广告位编号</th>");
                    sb.Append("<th width='25%'>广告位名称</th>");
                    sb.Append("<th width='40%'>位置</th>");
                    sb.Append("<th width='15%'>广告位类型</th>");
                    sb.Append("</tr>");
                    sb.Append("</thead>");

                    sb.Append("<tbody>");
                    Business.Base.BusinessBillboard pt = new project.Business.Base.BusinessBillboard();
                    foreach (Entity.Base.EntityBillboard it in pt.GetListQuery(string.Empty, Name, string.Empty, string.Empty, string.Empty, string.Empty, page, 15))
                    {
                        sb.Append("<tr class=\"text-c\" id='" + it.BBNo + "' onclick='submit(\"" + it.BBNo + "\")'>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.BBNo + "<input type='hidden' id='it" + it.BBNo + "' value='" + it.BBName + "' /></td>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.BBName + "</td>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.BBAddr + "</td>");
                        sb.Append("<td style='white-space: nowrap;'>" + it.BBTypeName + "</td>");
                        sb.Append("</tr>");
                    }
                    sb.Append("</tbody>");
                    sb.Append("</table>");
                    sb.Append(Paginat(pt.GetListCount(string.Empty, Name, string.Empty, string.Empty, string.Empty, string.Empty), 15, page, 5));
                }
            }
            catch { }
            return(sb.ToString());
        }