Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            VerifyPage("", true);
            if (!IsPostBack)
            {
                var spid = Request.QueryString["spid"];
                if (!string.IsNullOrEmpty(spid))
                {
                    #region 导航

                    var pid = Request.QueryString["pid"];
                    if ("0" != pid && !string.IsNullOrEmpty(pid))
                    {
                        var imodel = _infosDal.GetModel(Convert.ToInt32(pid));
                        if (null != imodel)
                        {
                            litStaName.Text = "<div class=\"backup\"><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&itid=" + Request.QueryString["itid"] +
                                              "\" class=\"back_btn backfirst\">返回首页</a><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid +
                                              "&tiid=" + imodel.TIID + "&itid=" + Request.QueryString["itid"] +
                                              "\" class=\"back_btn\">返回上级</a> </div>";
                        }
                    }
                    else
                    {
                        #region 分站名称

                        var spmodel = _staPackageDal.GetModel(Convert.ToInt32(spid));
                        if (null != spmodel)
                        {
                            var orgmodel = _orgOrganizeDal.GetModel(Convert.ToInt64(spmodel.OrgId));
                            if (null != orgmodel)
                            {
                                litStaName.Text =
                                    "<div class=\"logo\"><img src=\"/images/LOGO-yt.png\" style=\"display: block; width: 50px; height: 50px;\" alt=\"沿途\" /></div><div class=\"title\"><strong>" +
                                    orgmodel.OrgName + "</strong><span>" + orgmodel.EnName + "</span></div>";
                            }
                        }

                        #endregion
                    }

                    #endregion

                    var itid = Request.QueryString["itid"];//分类id
                    if (!string.IsNullOrEmpty(itid))
                    {
                        var model = _infoTypeDal.GetModel(Convert.ToInt32(itid));
                        if (null != model)
                        {
                            litType.Text = Service.GetType(Convert.ToInt32(model.ITID), spid);
                        }
                    }
                    else
                    {
                        litType.Text = Service.GetType(0, spid);
                    }
                }
            }
        }
        /// <summary>
        /// 绑定数据
        /// </summary>
        /// <param name="isFirstPage">搜索和删除用true IsPostBack用false</param>
        private void BindData(bool isFirstPage)
        {
            var orgid = Request.QueryString["orgid"];
            var rpid  = Request.QueryString["rpid"];

            if (!string.IsNullOrEmpty(orgid) && !string.IsNullOrEmpty(rpid))
            {
                var rpkmodel = _rootPackageDal.GetModel(Convert.ToInt32(rpid));
                if (null != rpkmodel)
                {
                    litInfo.Text = rpkmodel.RPName;
                }
                var omodel = _dataDal.GetModel(Convert.ToInt64(orgid));
                if (null != omodel)
                {
                    litInfo.Text += "-" + omodel.OrgName;
                }

                #region 分页

                //当前页码
                int pageNum  = 1;
                int pageSize = 10;
                //分页查询语句
                string sql =
                    "select row_number() over(order by  oo.Addtime desc,oo.OrgId DESC) as rownum,oo.*,opl.SSPID,opl.SPID,opl.Status as sstatus from dbo.OrgOrganize oo join StaPackage spk on spk.OrgId=oo.OrgId join OrgPkgList opl on opl.SPID=spk.SPID where opl.OrgId='" +
                    orgid + "' and opl.RPID='" + rpid + "' ";


                if (!isFirstPage)
                {
                    try
                    {
                        if (!string.IsNullOrEmpty(Request.QueryString["Page"])) //页数判断
                        {
                            pageNum = Convert.ToInt32(Request.QueryString["Page"]);
                        }
                    }
                    catch (Exception ex)
                    {
                        pageNum = 1;
                    }
                }
                //分页方法
                Pager1.GetDataBind("Repeater", "rptListWork", sql, pageNum, pageSize, "", "rownum",
                                   "OrgWorkStation.aspx?orgid=" + Request.QueryString["orgid"] + "&rpid=" + rpid + "&");

                #endregion
            }
            else
            {
                rptListWork.DataSource = null;
                rptListWork.DataBind();
            }
        }
Beispiel #3
0
        public static string Nav(Admin.Model.TempInfo timodel, object spid, object itid)
        {
            #region 导航

            var str = "";
            if (0 != timodel.ParentID)
            {
                var imodel = infosDal.GetModel(Convert.ToInt32(timodel.ParentID));
                if (null != imodel)
                {
                    str = "<div  class=\"backup\"><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&itid=" + itid +
                          "\" class=\"back_btn backfirst\">返回首页</a><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid +
                          "&tiid=" + imodel.TIID + "&itid=" + itid +
                          "\" class=\"back_btn\">返回上级</a> </div>";
                }
            }
            else
            {
                #region 分站名称

                StaPackage  _staPackageDal  = new StaPackage();
                OrgOrganize _orgOrganizeDal = new OrgOrganize();
                var         spmodel         = _staPackageDal.GetModel(Convert.ToInt32(spid));
                if (null != spmodel)
                {
                    var orgmodel = _orgOrganizeDal.GetModel(Convert.ToInt64(spmodel.OrgId));
                    if (null != orgmodel)
                    {
                        str =
                            "<div class=\"logo\"><img src=\"/images/LOGO-yt.png\" style=\"display: block; width: 50px; height: 50px;\" alt=\"沿途\" /></div><div class=\"title\"><strong>" +
                            orgmodel.OrgName + "</strong><span>" + orgmodel.EnName + "</span></div>";
                    }
                }

                #endregion
            }
            return(str);

            #endregion
        }
Beispiel #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     VerifyPage("", false);
     litRoleTree.Text = GetRoleTree();
     if (CurrentUser != null)
     {
         Admin.Model.OrgEmployees orgEmpl = _orgEmployeesDal.GetModel(int.Parse(CurrentUser.EmplId.ToString()));
         litUserName.Text = orgEmpl.EmplName;
         var title = "";
         if (CurrentUser.Type == 1)
         {
             title = "沿途后台总站管理系统";
         }
         else
         {
             var emp = _orgEmployeesDal.GetModel(Convert.ToInt32(CurrentUser.EmplId));
             var org = _orgOrganizeDal.GetModel(Convert.ToInt64(emp.OrgId));
             title = "沿途后台 " + org.OrgName + "管理系统";
         }
         litTitle.Text = title;
     }
 }
        protected void btnSub_Click(object sender, EventArgs e)
        {
            var name = txtName.Value.Trim();
            //var size = txtSize.Value.Trim();
            //var area = txtArea.Value.Trim();
            var manager      = txtManager.Value.Trim();
            var managerPhone = txtManPhone.Value.Trim();
            var enddate      = txtEndDate.Value.Trim();
            var enName       = txtEnName.Value.Trim();
            var sortNum      = txtSortNum.Value.Trim();

            if (string.IsNullOrEmpty(name))
            {
                //Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('请填写姓名!');window.parent.$modal.destroy();</script>");
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('请填写分站名称!');</script>");
                return;
            }
            if (string.IsNullOrEmpty(enName))
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('请填写英文名称!');</script>");
                return;
            }
            //if (string.IsNullOrEmpty(size))
            //{
            //    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('请填写规模!');</script>");
            //    return;
            //}
            //if (string.IsNullOrEmpty(area))
            //{
            //    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('请填写面积!');</script>");
            //    return;
            //}
            if (string.IsNullOrEmpty(manager))
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('请填写负责人!');</script>");
                return;
            }
            if (string.IsNullOrEmpty(managerPhone))
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('请填写负责人电话!');</script>");
                return;
            }
            if ((!System.Text.RegularExpressions.Regex.IsMatch(managerPhone, @"^[1]+[3,4,5,8]+\d{9}")) && (!System.Text.RegularExpressions.Regex.IsMatch(managerPhone, @"^(\d{3,4}-)?\d{6,8}$")))
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('负责人电话格式错误,请重新输入!');</script>");
                return;
            }
            if (string.IsNullOrEmpty(enddate))
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('请填写合同到期时间!');</script>");
                return;
            }
            //if (string.IsNullOrEmpty(orgId))
            //{
            //    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('请选择分公司!');</script>");
            //    return;
            //}
            if (!string.IsNullOrEmpty(Request.QueryString["OrgId"]))
            {
                try
                {
                    List <SqlParameter> parameters = new List <SqlParameter>();
                    var parameter = new SqlParameter("@OrgId", DbType.AnsiString)
                    {
                        Value = Request.QueryString["OrgId"]
                    };
                    parameters.Add(parameter);
                    var str = " oo.[Status]=1 and oo.[OrgId]=@OrgId ";
                    var dt  = _dataDal.GetModel(Convert.ToInt32(Request.QueryString["OrgId"]));
                    if (null == dt)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('分站不存在!');</script>");
                        return;
                    }
                    dt.OrgName    = txtName.Value;
                    dt.EnName     = enName;
                    dt.OrgAddress = txtManager.Value;
                    dt.OrgPhone   = txtManPhone.Value;
                    dt.EndDate    = Convert.ToDateTime(enddate);
                    dt.SortNum    = Convert.ToInt32(sortNum);
                    if (_dataDal.Exists(Convert.ToInt32(Request.QueryString["OrgId"]), txtName.Value))
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('分站已经存在!');</script>");
                        return;
                    }
                    var res = _dataDal.Update(dt);
                    if (res)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "",
                                                                "<script>window.top.$op.location=window.top.$op.location;window.top.$modal.destroy();</script>");
                    }
                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('更新失败!');window.top.$modal.destroy();</script>");
                    }
                }
                catch (Exception)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('操作失败!');window.top.$modal.destroy();</script>");
                }
            }
            else
            {
                var model = new ECommerce.Admin.Model.OrgOrganize
                {
                    AreaId     = "61000",
                    AddTime    = DateTime.Now,
                    OrgAddress = manager,
                    OrgPhone   = managerPhone,
                    OrgName    = name,
                    Status     = 1,
                    OrgType    = 1,
                    EndDate    = Convert.ToDateTime(enddate),
                    EnName     = enName,
                    SortNum    = Convert.ToInt32(sortNum)
                };
                if (_dataDal.Exists(0, name))
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('分站已经存在!');</script>");
                    return;
                }
                var resAdd = _dataDal.Add(model);
                if (resAdd > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "",
                                                            "<script>window.top.$op.location=window.top.$op.location;window.top.$modal.destroy();</script>");
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('新增失败!');window.top.$modal.destroy();</script>");
                }
            }
        }
Beispiel #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            VerifyPage("", true);
            if (!IsPostBack)
            {
                var spid = Request.QueryString["spid"];

                if (!string.IsNullOrEmpty(spid))
                {
                    #region 左侧分类

                    var itid = Request.QueryString["itid"]; //分类id
                    if (!string.IsNullOrEmpty(itid))
                    {
                        var model = _infoTypeDal.GetModel(Convert.ToInt32(itid));
                        if (null != model)
                        {
                            litType.Text = Service.GetType(Convert.ToInt32(model.ITID), spid);
                        }
                    }
                    else
                    {
                        litType.Text = Service.GetType(0, spid);
                    }

                    #endregion

                    #region 块内容

                    var tiid = Request.QueryString["tiid"];
                    if (!string.IsNullOrEmpty(tiid))
                    {
                        TempInfo _tempInfoDal = new TempInfo();
                        var      timodel      = _tempInfoDal.GetModel(Convert.ToInt32(tiid));
                        if (null != timodel)
                        {
                            #region 导航

                            var ptiid = Request.QueryString["ptiid"];
                            if (!string.IsNullOrEmpty(ptiid))
                            {
                                litStaName.Text = "<div  class=\"backup\"><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&itid=" + Request.QueryString["itid"] +
                                                  "\" class=\"back_btn backfirst\">返回首页</a><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid +
                                                  "&tiid=" + ptiid + "&itid=" + Request.QueryString["itid"] +
                                                  "\" class=\"back_btn\">返回上级</a> </div>";
                            }
                            else
                            {
                                #region 分站名称

                                StaPackage  _staPackageDal  = new StaPackage();
                                OrgOrganize _orgOrganizeDal = new OrgOrganize();
                                var         spmodel         = _staPackageDal.GetModel(Convert.ToInt32(spid));
                                if (null != spmodel)
                                {
                                    var orgmodel = _orgOrganizeDal.GetModel(Convert.ToInt64(spmodel.OrgId));
                                    if (null != orgmodel)
                                    {
                                        litStaName.Text =
                                            "<div class=\"logo\"><img src=\"/images/LOGO-yt.png\" style=\"display: block; width: 50px; height: 50px;\" alt=\"沿途\" /></div><div class=\"title\"><strong>" +
                                            orgmodel.OrgName + "</strong><span>" + orgmodel.EnName + "</span></div>";
                                    }
                                }

                                #endregion
                            }

                            #endregion

                            #region 分页

                            litPager.Text = "<td><input type=\"button\" class=\"btn btn-sm delpage\" value=\"删除\" style=\"width: 50px;\" /></td>";;

                            #endregion

                            litInfo1.Text = GetBtn(timodel, 1);
                        }
                    }

                    #endregion
                }
            }
        }
Beispiel #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            VerifyPage("", true);
            if (!IsPostBack)
            {
                var spid = Request.QueryString["spid"];

                if (!string.IsNullOrEmpty(spid))
                {
                    #region 左侧分类

                    var itid = Request.QueryString["itid"]; //分类id
                    if (!string.IsNullOrEmpty(itid))
                    {
                        var model = _infoTypeDal.GetModel(Convert.ToInt32(itid));
                        if (null != model)
                        {
                            litType.Text = Service.GetType(Convert.ToInt32(model.ITID), spid);
                        }
                    }
                    else
                    {
                        litType.Text = Service.GetType(0, spid);
                    }

                    #endregion

                    #region 块内容

                    var tiid = Request.QueryString["tiid"];
                    if (!string.IsNullOrEmpty(tiid))
                    {
                        TempInfo _tempInfoDal = new TempInfo();
                        var      timodel      = _tempInfoDal.GetModel(Convert.ToInt32(tiid));
                        if (null != timodel)
                        {
                            #region 导航

                            if (0 != timodel.ParentID)
                            {
                                var imodel = infosDal.GetModel(Convert.ToInt32(timodel.ParentID));
                                if (null != imodel)
                                {
                                    litStaName.Text = "<div  class=\"backup\"><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&itid=" + Request.QueryString["itid"] +
                                                      "\" class=\"back_btn backfirst\">返回首页</a><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid +
                                                      "&tiid=" + imodel.TIID + "&itid=" + Request.QueryString["itid"] +
                                                      "\" class=\"back_btn\">返回上级</a> </div>";
                                }
                            }
                            else
                            {
                                #region 分站名称

                                StaPackage  _staPackageDal  = new StaPackage();
                                OrgOrganize _orgOrganizeDal = new OrgOrganize();
                                var         spmodel         = _staPackageDal.GetModel(Convert.ToInt32(spid));
                                if (null != spmodel)
                                {
                                    var orgmodel = _orgOrganizeDal.GetModel(Convert.ToInt64(spmodel.OrgId));
                                    if (null != orgmodel)
                                    {
                                        litStaName.Text =
                                            "<div class=\"logo\"><img src=\"/images/LOGO-yt.png\" style=\"display: block; width: 50px; height: 50px;\" alt=\"沿途\" /></div><div class=\"title\"><strong>" +
                                            orgmodel.OrgName + "</strong><span>" + orgmodel.EnName + "</span></div>";
                                    }
                                }

                                #endregion
                            }

                            #endregion

                            #region 分页

                            var pager = "";
                            List <SqlParameter> parDef = new List <SqlParameter>();
                            var preitModel             =
                                _tempInfoDal.GetModel(
                                    " ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID + " and TIPage=" +
                                    (timodel.TIPage - 1), parDef);
                            if (null != preitModel)
                            {
                                pager += "<td><a href=\"/Manage/Template/Redircet.aspx?itid=" +
                                         Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] + "&tiid=" +
                                         preitModel.TIID + "\" class=\"btn btnprev\" data-tiid=\"" + preitModel.TIID +
                                         "\">上页 </a></td>";
                            }
                            else
                            {
                                pager += "<td>&nbsp;</td>";
                            }
                            var count =
                                _tempInfoDal.GetList(" TIPage is not null and TIPage!='' and ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID,
                                                     parDef).Tables[0].Rows.Count;
                            if (count > 1)
                            {
                                pager +=
                                    "<td>页码 </td><td><input type=\"text\" class=\"form-control input-sm iptpno\" value=\"" +
                                    timodel.TIPage +
                                    "\" style=\"width: 40px;display:inline;text-align: center;\" /> /" + count + "</td><td><input data-parcount=\"" + timodel.ParentID + "\" data-count=\"" + count + "\" type=\"button\" class=\"btn btn-sm repage\" value=\"跳转\" style=\"width: 70px;\" /></td><td><input type=\"button\" class=\"btn btn-sm editpno\" value=\"修改页码\" style=\"width: 70px;\" /></td><td><input type=\"button\" class=\"btn btn-sm delpage\" value=\"删除当前页\" /></td>";
                            }
                            else if (count == 1)
                            {
                                pager +=
                                    "<td><input type=\"button\" class=\"btn btn-sm delpage\" value=\"删除当前页\" /></td>";
                            }
                            var nexitModel =
                                _tempInfoDal.GetModel(
                                    " ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID + " and TIPage=" +
                                    (timodel.TIPage + 1), parDef);
                            if (null != nexitModel)
                            {
                                pager += "<td><a href=\"/Manage/Template/Redircet.aspx?itid=" +
                                         Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] + "&tiid=" +
                                         nexitModel.TIID + "\" class=\"btn btnnext\" data-tiid=\"" +
                                         nexitModel.TIID + "\">下页 </a></td>";
                            }
                            else
                            {
                                pager          += "<td>&nbsp;</td>";
                                litNewPage.Text = "<a href=\"/Manage/Systems/ChooseNewsTemplate.aspx?page=" +
                                                  (timodel.TIPage + 1) + "&pid=" + timodel.ParentID + "&itid=" +
                                                  Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] +
                                                  "&tiid=" + timodel.TIID + "\" class=\" btn btn-add newpage\">新建内容页</a> <a href=\"/Manage/News/RedircetAD.aspx?itid=" +
                                                  Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] + "&tiid=" +
                                                  timodel.TIID + "\" class=\"btn btn-add newpage\" style=\"top:50%\">添加文末广告</a>";
                            }
                            litPager.Text = pager;

                            #endregion

                            List <SqlParameter> par1 = new List <SqlParameter>();
                            var tmpPar1 = templateParDal.GetModel(" TID=" + timodel.TID + " and SortNum=1 ", par1);

                            var str    = "<div class=\"box col-sm-12 ht2\" style=\"text-align:inherit\">";
                            var dtInfo = infosDal.GetList(" TIID=" + timodel.TIID, par1).Tables[0];
                            if (dtInfo.Rows.Count > 0)
                            {
                                for (int i = 0; i < dtInfo.Rows.Count; i++)
                                {
                                    var point = "/images/hand.png";
                                    if ("" != dtInfo.Rows[i]["ADPic"].ToString())
                                    {
                                        point = "/UploadFiles/" + dtInfo.Rows[i]["ADPic"];
                                    }
                                    str +=
                                        "<div class=\"news-pic\" style=\"top:" + dtInfo.Rows[i]["YPosition"] +
                                        "px;left:" + dtInfo.Rows[i]["XPosition"] +
                                        "px;\"><a href=\"javascript:;\" data-iid=\"" + dtInfo.Rows[i]["IID"] +
                                        "\" class=\"btn edit-pic\">编辑</a> <a href=\"javascript:;\" data-iid=\"" +
                                        dtInfo.Rows[i]["IID"] +
                                        "\" class=\"btn del-pic\">删除</a><img src=\"" + point + "\" style=\"background-color:transparent\"/></div>";
                                }
                                if (dtInfo.Rows.Count < 4)
                                {
                                    str +=
                                        "<div class=\"btnbox\"><a href=\"javascript:;\" class=\"btn new-info\" data-bgw=\"" +
                                        tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                        "\">新增热点</a> <a href=\"javascript:;\" class=\"btn edit-bpic\" data-bgw=\"" +
                                        tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                        "\" data-tiid=\"" +
                                        timodel.TIID + "\">编辑背景</a></div>";
                                }
                                else
                                {
                                    str +=
                                        "<div class=\"btnbox\"><a href=\"javascript:;\" data-bgw=\"" +
                                        tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                        "\" class=\"btn edit-bpic\" data-tiid=\"" +
                                        timodel.TIID + "\">编辑背景</a></div>";
                                }
                            }
                            else
                            {
                                str +=
                                    "<div class=\"btnbox\"><a href=\"javascript:;\" class=\"btn new-info\" data-bgw=\"" +
                                    tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                    "\">新增热点</a> <a href=\"javascript:;\" class=\"btn edit-bpic\" data-bgw=\"" +
                                    tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                    "\" data-tiid=\"" + timodel.TIID + "\">上传背景</a>";
                                //str += " <a href=\"javascript:;\" class=\"btn select-info\" data-sortnum=\"1\">选择</a>";
                                str += "</div>";
                            }
                            if (!string.IsNullOrEmpty(timodel.AttID))
                            {
                                str += "<img src=\"/UploadFiles/" + timodel.AttID + "\">";
                            }
                            else
                            {
                                str += "<img>";
                            }
                            str          += "</div>";
                            litInfo1.Text = str;
                        }
                    }

                    #endregion
                }
            }
        }
Beispiel #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            VerifyPage("", true);
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["spid"]))
                {
                    var sta = _staPackageDal.GetModel(Convert.ToInt32(Request.QueryString["spid"]));
                    if (null != sta)
                    {
                        var orgModel = _orgOrganizeDal.GetModel(Convert.ToInt64(sta.OrgId));
                        if (null != orgModel)
                        {
                            litOrg.Text = orgModel.OrgName;
                        }
                    }
                    #region

                    List <SqlParameter> pars1 = new List <SqlParameter>();
                    var par1 = new SqlParameter("@SPID", DbType.AnsiString)
                    {
                        Value = Request.QueryString["spid"]
                    };
                    pars1.Add(par1);
                    var type1 = _infoTypeDal.GetModel(" SPID=@SPID and Status=1 and SortNum=1 ", pars1);
                    if (null != type1)
                    {
                        litType1.Text = "<li data-typeid=\"" + type1.ITID + "\"><pre><img alt=\"\" src=\"/UploadFiles/" +
                                        type1.AttaID + "\" style=\"width: 26px; height: 32px;\">" + type1.IName +
                                        "</pre></li>";
                    }
                    else
                    {
                        litType1.Text = "<li data-typeid=\"\"><a href=\"javascript:;\" class=\"btn btn-mini\" onclick=\"addtype('1')\">新建分类</a></li>";
                    }

                    #endregion

                    #region

                    List <SqlParameter> pars2 = new List <SqlParameter>();
                    var par2 = new SqlParameter("@SPID", DbType.AnsiString)
                    {
                        Value = Request.QueryString["spid"]
                    };
                    pars2.Add(par2);
                    var type2 = _infoTypeDal.GetModel(" SPID=@SPID and Status=1 and SortNum=1 ", pars2);
                    if (null != type2)
                    {
                        litType2.Text = "<li data-typeid=\"" + type2.ITID + "\"><pre><img alt=\"\" src=\"/UploadFiles/" +
                                        type2.AttaID + "\" style=\"width: 26px; height: 32px;\">" + type2.IName +
                                        "</pre></li>";
                    }
                    else
                    {
                        litType2.Text = "<li data-typeid=\"\"><a href=\"javascript:;\" class=\"btn btn-mini\" onclick=\"addtype('2')\">新建分类</a></li>";
                    }

                    #endregion

                    #region

                    List <SqlParameter> pars3 = new List <SqlParameter>();
                    var par3 = new SqlParameter("@SPID", DbType.AnsiString)
                    {
                        Value = Request.QueryString["spid"]
                    };
                    pars3.Add(par3);
                    var type3 = _infoTypeDal.GetModel(" SPID=@SPID and Status=1 and SortNum=1 ", pars3);
                    if (null != type3)
                    {
                        litType3.Text = "<li data-typeid=\"" + type3.ITID + "\"><pre><img alt=\"\" src=\"/UploadFiles/" +
                                        type3.AttaID + "\" style=\"width: 26px; height: 32px;\">" + type3.IName +
                                        "</pre></li>";
                    }
                    else
                    {
                        litType3.Text = "<li data-typeid=\"\"><a href=\"javascript:;\" class=\"btn btn-mini\" onclick=\"addtype('3')\">新建分类</a></li>";
                    }

                    #endregion

                    #region

                    List <SqlParameter> pars4 = new List <SqlParameter>();
                    var par4 = new SqlParameter("@SPID", DbType.AnsiString)
                    {
                        Value = Request.QueryString["spid"]
                    };
                    pars4.Add(par4);
                    var type4 = _infoTypeDal.GetModel(" SPID=@SPID and Status=1 and SortNum=1 ", pars4);
                    if (null != type4)
                    {
                        litType4.Text = "<li data-typeid=\"" + type4.ITID + "\"><pre><img alt=\"\" src=\"/UploadFiles/" +
                                        type4.AttaID + "\" style=\"width: 26px; height: 32px;\">" + type4.IName +
                                        "</pre></li>";
                    }
                    else
                    {
                        litType4.Text = "<li data-typeid=\"\"><a href=\"javascript:;\" class=\"btn btn-mini\" onclick=\"addtype('4')\">新建分类</a></li>";
                    }

                    #endregion

                    #region

                    List <SqlParameter> pars5 = new List <SqlParameter>();
                    var par5 = new SqlParameter("@SPID", DbType.AnsiString)
                    {
                        Value = Request.QueryString["spid"]
                    };
                    pars5.Add(par5);
                    var type5 = _infoTypeDal.GetModel(" SPID=@SPID and Status=1 and SortNum=1 ", pars5);
                    if (null != type5)
                    {
                        litType5.Text = "<li data-typeid=\"" + type5.ITID + "\"><pre><img alt=\"\" src=\"/UploadFiles/" +
                                        type5.AttaID + "\" style=\"width: 26px; height: 32px;\">" + type5.IName +
                                        "</pre></li>";
                    }
                    else
                    {
                        litType5.Text = "<li data-typeid=\"\"><a href=\"javascript:;\" class=\"btn btn-mini\" onclick=\"addtype('5')\">新建分类</a></li>";
                    }

                    #endregion

                    #region

                    List <SqlParameter> pars6 = new List <SqlParameter>();
                    var par6 = new SqlParameter("@SPID", DbType.AnsiString)
                    {
                        Value = Request.QueryString["spid"]
                    };
                    pars6.Add(par6);
                    var type6 = _infoTypeDal.GetModel(" SPID=@SPID and Status=1 and SortNum=1 ", pars6);
                    if (null != type6)
                    {
                        litType6.Text = "<li data-typeid=\"" + type6.ITID + "\"><pre><img alt=\"\" src=\"/UploadFiles/" +
                                        type6.AttaID + "\" style=\"width: 26px; height: 32px;\">" + type6.IName +
                                        "</pre></li>";
                    }
                    else
                    {
                        litType6.Text = "<li data-typeid=\"\"><a href=\"javascript:;\" class=\"btn btn-mini\" onclick=\"addtype('6')\">新建分类</a></li>";
                    }

                    #endregion

                    #region

                    List <SqlParameter> pars7 = new List <SqlParameter>();
                    var par7 = new SqlParameter("@SPID", DbType.AnsiString)
                    {
                        Value = Request.QueryString["spid"]
                    };
                    pars7.Add(par7);
                    var type7 = _infoTypeDal.GetModel(" SPID=@SPID and Status=1 and SortNum=1 ", pars7);
                    if (null != type7)
                    {
                        litType7.Text = "<li data-typeid=\"" + type7.ITID + "\"><pre><img alt=\"\" src=\"/UploadFiles/" +
                                        type7.AttaID + "\" style=\"width: 26px; height: 32px;\">" + type7.IName +
                                        "</pre></li>";
                    }
                    else
                    {
                        litType7.Text = "<li data-typeid=\"\"><a href=\"javascript:;\" class=\"btn btn-mini\" onclick=\"addtype('7')\">新建分类</a></li>";
                    }

                    #endregion

                    #region

                    List <SqlParameter> pars8 = new List <SqlParameter>();
                    var par8 = new SqlParameter("@SPID", DbType.AnsiString)
                    {
                        Value = Request.QueryString["spid"]
                    };
                    pars8.Add(par8);
                    var type8 = _infoTypeDal.GetModel(" SPID=@SPID and Status=1 and SortNum=1 ", pars8);
                    if (null != type8)
                    {
                        litType8.Text = "<li data-typeid=\"" + type8.ITID + "\"><pre><img alt=\"\" src=\"/UploadFiles/" +
                                        type8.AttaID + "\" style=\"width: 26px; height: 32px;\">" + type8.IName +
                                        "</pre></li>";
                    }
                    else
                    {
                        litType8.Text = "<li data-typeid=\"\"><a href=\"javascript:;\" class=\"btn btn-mini\" onclick=\"addtype('8')\">新建分类</a></li>";
                    }

                    #endregion
                }
            }
        }
Beispiel #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            VerifyPage("", true);
            if (!IsPostBack)
            {
                var spid = Request.QueryString["spid"];

                if (!string.IsNullOrEmpty(spid))
                {
                    #region 左侧分类

                    var itid = Request.QueryString["itid"]; //分类id
                    if (!string.IsNullOrEmpty(itid))
                    {
                        var model = _infoTypeDal.GetModel(Convert.ToInt32(itid));
                        if (null != model)
                        {
                            litType.Text = Service.GetType(Convert.ToInt32(model.ITID), spid);
                        }
                    }
                    else
                    {
                        litType.Text = Service.GetType(0, spid);
                    }

                    #endregion

                    #region 块内容

                    var tiid = Request.QueryString["tiid"];
                    if (!string.IsNullOrEmpty(tiid))
                    {
                        TempInfo _tempInfoDal = new TempInfo();
                        var      timodel      = _tempInfoDal.GetModel(Convert.ToInt32(tiid));
                        if (null != timodel)
                        {
                            #region 导航

                            var ptiid = Request.QueryString["ptiid"];
                            if (!string.IsNullOrEmpty(ptiid))
                            {
                                litStaName.Text = "<div class=\"backup\"><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&itid=" + Request.QueryString["itid"] +
                                                  "\" class=\"back_btn backfirst\">返回首页</a><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid +
                                                  "&tiid=" + ptiid + "&itid=" + Request.QueryString["itid"] +
                                                  "\" class=\"back_btn\">返回上级</a> </div>";
                            }
                            else
                            {
                                #region 分站名称

                                StaPackage  _staPackageDal  = new StaPackage();
                                OrgOrganize _orgOrganizeDal = new OrgOrganize();
                                var         spmodel         = _staPackageDal.GetModel(Convert.ToInt32(spid));
                                if (null != spmodel)
                                {
                                    var orgmodel = _orgOrganizeDal.GetModel(Convert.ToInt64(spmodel.OrgId));
                                    if (null != orgmodel)
                                    {
                                        litStaName.Text =
                                            "<div class=\"logo\"><img src=\"/images/LOGO-yt.png\" style=\"display: block; width: 50px; height: 50px;\" alt=\"沿途\" /></div><div class=\"title\"><strong>" +
                                            orgmodel.OrgName + "</strong><span>" + orgmodel.EnName + "</span></div>";
                                    }
                                }

                                #endregion
                            }

                            #endregion

                            #region 分页

                            litPager.Text = "<td><input type=\"button\" class=\"btn btn-sm delpage\" value=\"删除\" style=\"width: 50px;\" /></td>";;

                            #endregion

                            #region

                            var sortNum = 1;
                            List <SqlParameter> par1 = new List <SqlParameter>();
                            var tmpPar1 =
                                _templateParDal.GetModel(" TID=" + timodel.TID + " and SortNum=" + sortNum + " ", par1);

                            var info1 = _infosDal.GetModel(" TIID=" + timodel.TIID + " and SortNum=" + sortNum + " ",
                                                           par1);
                            if (null != info1)
                            {
                                var user = (OrgUsers)HttpContext.Current.Session["CurrentUser"];
                                #region 纯图广告反显

                                if (info1.IType == 7)
                                {
                                    #region 右侧推荐

                                    litInfo1.Text += "<div class=\"txtbox tmenu\"><ul>";
                                    List <SqlParameter> par = new List <SqlParameter>();
                                    par.Add(new SqlParameter("@IID", DbType.AnsiString)
                                    {
                                        Value = info1.IID
                                    });
                                    var dt = _adInfosDal.GetListAI(" AdInfos.IID=@IID ", par).Tables[0];
                                    if (dt.Rows.Count > 0)
                                    {
                                        if (dt.Rows.Count < 6)
                                        {
                                            litInfo1.Text +=
                                                "<li class=\"tit\"><span class=\"btn btnadd add-rec\" data-iid=\"" +
                                                info1.IID +
                                                "\">添加推荐</span> </li>";
                                        }
                                        else
                                        {
                                            litInfo1.Text += "<li class=\"tit\"></li>";
                                        }
                                        for (int i = 0; i < dt.Rows.Count; i++)
                                        {
                                            litInfo1.Text +=
                                                "<li title=\"" +
                                                dt.Rows[i]["IName"] + "\"><span class=\"del del-rec\"  data-aiid=\"" +
                                                dt.Rows[i]["AIID"] +
                                                "\">删除</span><a href=\"/Manage/Template/Redircet.aspx?spid=" +
                                                Request.QueryString["spid"] + "&pid=" + dt.Rows[i]["Inf_IID"] +
                                                "&itid=" +
                                                Request.QueryString["itid"] + "\"><span class=\"hot\"></span>" +
                                                (dt.Rows[i]["IName"].ToString().Length > 12
                                                    ? dt.Rows[i]["IName"].ToString().Substring(0, 12) + "..."
                                                    : dt.Rows[i]["IName"].ToString()) + "</a></li>";
                                        }
                                    }
                                    else
                                    {
                                        litInfo1.Text +=
                                            "<li class=\"tit\"><span class=\"btn btnadd add-rec\" data-iid=\"" +
                                            info1.IID +
                                            "\">添加推荐</span> </li>";
                                    }
                                    litInfo1.Text += " </ul></div>";
                                    #endregion


                                    litInfo1.Text +=
                                        "<div class=\"btnbox\" style=\"top:54%;right:10%;display:none\"><a href=\"javascript:;\" class=\"btn edit-info\" data-iid=\"" +
                                        info1.IID + "\" data-sortnum=\"" + sortNum +
                                        "\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                        "\">编辑</a> <a href=\"javascript:;\" class=\"btn del-info\" data-iid=\"" +
                                        info1.IID +
                                        "\" data-sortnum=\"" + sortNum +
                                        "\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                        "\">删除</a>";
                                    if (1 == user.Type)
                                    {
                                        if (1 == info1.Status)
                                        {
                                            litInfo1.Text += " <a href=\"javascript:;\" class=\"btn sin-info btn-warning\" data-iid=\"" +
                                                             info1.IID +
                                                             "\">标记</a>";
                                        }
                                        else
                                        {
                                            litInfo1.Text += " <a href=\"javascript:;\" class=\"btn sin-info btn-warning\" data-iid=\"" +
                                                             info1.IID +
                                                             "\">取消标记</a>";
                                        }
                                    }
                                    else
                                    {
                                        if (0 == info1.Status)
                                        {
                                            litInfo1.Text += " <span class=\"btn btn-editing\">待修改</span>";
                                        }
                                    }
                                    litInfo1.Text += "</div><img style=\"height: 606px; display: block; width: 756px;\" src=\"/UploadFiles/" + info1.PicAttID + "\">";
                                }

                                #endregion
                            }
                            else
                            {
                                litInfo1.Text =
                                    "<div class=\"btnbox\"><a href=\"javascript:;\" class=\"btn new-info\" data-sortnum=\"" +
                                    sortNum +
                                    "\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight +
                                    "\">新增</a>";
                                //litInfo1.Text += " <a href=\"javascript:;\" class=\"btn select-info\" data-sortnum=\"" +
                                //    sortNum +
                                //    "\">选择</a>";
                                litInfo1.Text += "</div><img>";
                            }

                            #endregion
                        }
                    }

                    #endregion
                }
            }
        }
Beispiel #10
0
        private void BindOrgName()
        {
            var timodel = _tempInfoDal.GetModel(Convert.ToInt32(Request.QueryString["tiid"]));

            if (null != timodel)
            {
                //var sql = "select Infos.* from Infos where TIID in (select TIID from TempInfo where (ITID in(select ITID from InfoType where SPID in(select SPID from StaPackage join OrgOrganize on OrgOrganize.OrgId=StaPackage.OrgId where (OrgName='全国热点' or OrgOrganize.OrgId=(select OrgId from StaPackage join InfoType on InfoType.SPID=StaPackage.SPID where InfoType.ITID=@ITID)) ))) and TIID!=@TIID and TID=@TID) and Infos.SortNum=@SortNum ";
                //var sql = "select Infos.* from Infos where TIID in (select TIID from TempInfo where (ITID in(select ITID from InfoType where SPID in(select SPID from StaPackage join OrgOrganize on OrgOrganize.OrgId=StaPackage.OrgId where (OrgOrganize.OrgId=(select OrgId from StaPackage join InfoType on InfoType.SPID=StaPackage.SPID where InfoType.ITID=@ITID)) ))) and TIID!=@TIID and TID=@TID) and Infos.SortNum=@SortNum ";

                var sql = @"select Infos.IID,RootPackage.RPName+'-'+
(case StaPackage.PkgType when 0 then '默认资源包' else 
(select OrgOrganize.OrgName from OrgPkgList join OrgOrganize on OrgOrganize.OrgId=OrgPkgList.OrgId 
and OrgPkgList.SPID=StaPackage.SPID) end)+'-'+Infos.IName  AS IName
 from Infos join TempInfo on TempInfo.TIID=Infos.TIID join InfoType on InfoType.ITID=TempInfo.ITID
join StaPackage on StaPackage.SPID=InfoType.SPID join RootPackage
 on RootPackage.RPID=StaPackage.RPID join OrgOrganize on
 OrgOrganize.OrgId=StaPackage.OrgId where  StaPackage.OrgId=(select OrgId from StaPackage join InfoType on InfoType.SPID=StaPackage.SPID where InfoType.ITID=@ITID)
and TempInfo.TIID!=@TIID and TempInfo.TID=@TID and Infos.SortNum=@SortNum and (StaPackage.SPID in (select SPID from OrgPkgList) or StaPackage.SPID=@SPID) ";

                var itmodel = _infoTypeDal.GetModel(Convert.ToInt32(timodel.ITID));
                if (null != itmodel)
                {
                    var smodel = _staPackageDal.GetModel(Convert.ToInt32(itmodel.SPID));
                    if (null != smodel)
                    {
                        var org = _orgOrganizeDal.GetModel(Convert.ToInt64(smodel.OrgId));
                        if ("全国热点" == org.OrgName)
                        {
                            //sql = "select Infos.IID,(Infos.IName +'-'+ OrgOrganize.OrgName) as IName from Infos join TempInfo on TempInfo.TIID=Infos.TIID join InfoType on InfoType.ITID=TempInfo.ITID join StaPackage on StaPackage.SPID=InfoType.SPID join OrgOrganize on OrgOrganize.OrgId=StaPackage.OrgId where OrgOrganize.OrgId in (select OrgId from OrgOrganize where OrgType=1 and OrgId!='" + smodel.OrgId + "') and TempInfo.TIID!=@TIID and TID=@TID and Infos.SortNum=@SortNum";
                            sql  = @"select Infos.IID,RootPackage.RPName+'-'+
(case StaPackage.PkgType when 0 then '默认资源包' else 
(select OrgOrganize.OrgName from OrgPkgList join OrgOrganize on OrgOrganize.OrgId=OrgPkgList.OrgId 
and OrgPkgList.SPID=StaPackage.SPID) end)+'-'+Infos.IName  AS IName
 from Infos join TempInfo on TempInfo.TIID=Infos.TIID join InfoType on InfoType.ITID=TempInfo.ITID
join StaPackage on StaPackage.SPID=InfoType.SPID join RootPackage
 on RootPackage.RPID=StaPackage.RPID join OrgOrganize on
 OrgOrganize.OrgId=StaPackage.OrgId where  StaPackage.OrgId in (select OrgId from OrgOrganize where OrgType=1 and ";
                            sql += "OrgId!='" + smodel.OrgId + "') and TempInfo.TIID!=@TIID and TempInfo.TID=@TID and Infos.SortNum=@SortNum and (StaPackage.SPID in (select SPID from OrgPkgList) or StaPackage.SPID=@SPID or StaPackage.SPID in (select StaPackage.SPID from StaPackage join RootPackage on RootPackage.RPID=StaPackage.RPID where StaPackage.PkgType=0 and RootPackage.RPID=(select RootPackage.RPID from RootPackage join StaPackage on RootPackage.RPID=StaPackage.RPID join InfoType on InfoType.SPID=StaPackage.SPID join TempInfo on InfoType.ITID=TempInfo.ITID where TempInfo.TIID=@TIID) )) ";
                        }
                    }
                }
                sql += " order by Infos.IID desc ";
                Database  db        = DatabaseFactory.CreateDatabase();
                DbCommand dbCommand = db.GetSqlStringCommand(sql);
                dbCommand.Parameters.Add(new SqlParameter("@TID", DbType.Int32)
                {
                    Value = timodel.TID
                });
                dbCommand.Parameters.Add(new SqlParameter("@SortNum", DbType.Int32)
                {
                    Value = Request.QueryString["sortnum"]
                });
                dbCommand.Parameters.Add(new SqlParameter("@TIID", DbType.Int32)
                {
                    Value = timodel.TIID
                });
                dbCommand.Parameters.Add(new SqlParameter("@ITID", DbType.Int32)
                {
                    Value = timodel.ITID
                });
                if (null != itmodel)
                {
                    dbCommand.Parameters.Add(new SqlParameter("@SPID", DbType.Int32)
                    {
                        Value = itmodel.SPID
                    });
                }
                else
                {
                    dbCommand.Parameters.Add(new SqlParameter("@SPID", DbType.Int32)
                    {
                        Value = ""
                    });
                }
                var dt = db.ExecuteDataSet(dbCommand).Tables[0];
                ddlOrgName.DataSource     = dt;
                ddlOrgName.DataTextField  = "IName";
                ddlOrgName.DataValueField = "IID";
                ddlOrgName.DataBind();

                ddlOrgName.Items.Insert(0, new ListItem("请选择", "-1"));
                ddlOrgName.SelectedIndex = 0;
            }
        }