Пример #1
0
        public ContentResult PubInfo_API()
        {
            string action = GetParam("action");
            int    pubId  = DataConvert.CLng(GetParam("pubid"));
            string ids    = GetParam("ids");

            SafeSC.CheckIDSEx(ids);
            M_Pub pubMod = pubBll.SelReturnModel(pubId);

            if (pubMod == null)
            {
                throw new Exception("未指定互动模型");
            }
            switch (action)
            {
            case "del":
                DBCenter.DelByIDS(pubMod.PubTableName, "ID", ids);
                break;

            case "audit":
                DBCenter.UpdateSQL(pubMod.PubTableName, "PubStart=1", "ID IN (" + ids + ")");
                break;

            case "cancel":
                DBCenter.UpdateSQL(pubMod.PubTableName, "PubStart=0", "ID IN (" + ids + ")");
                break;
            }
            return(Content(Success.ToString()));
        }
Пример #2
0
        public ActionResult ViewSmallPub()
        {
            int         PubID   = DataConverter.CLng(Request["pubid"]);
            int         ID      = DataConverter.CLng(Request["ID"]);
            int         Type    = DataConverter.CLng(Request["type"] ?? "1");
            M_Pub       pubMod  = pubBll.GetSelect(PubID);
            int         ModelID = pubMod == null ? 0 : pubMod.PubModelID;
            M_ModelInfo model   = modBll.GetModelById(ModelID);
            PageSetting setting = new PageSetting();

            switch (Type)
            {
            case 2:
                setting = buser.GetUserModeInfo_Page(CPage, PSize, model.TableName, ID, 19);
                break;

            case 3:
                setting = buser.GetUserModeInfo_Page(CPage, PSize, model.TableName, ID, 20);
                break;

            default:
                setting = buser.GetUserModeInfo_Page(CPage, PSize, model.TableName, ID, 13);
                break;
            }
            ViewBag.PubID     = PubID;
            ViewBag.PubType   = pubMod.PubType;
            ViewBag.ID        = ID;
            ViewBag.TableName = model.TableName;
            if (Request.IsAjaxRequest())
            {
                return(PartialView("ViewSmallPub_List", setting));
            }
            return(View(setting));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            B_Admin badmin = new B_Admin();

            if (!IsPostBack)
            {
                M_Pub pubinfo = pub.GetSelect(PubID);
                //string prowinfo = B_Role.GetPowerInfoByIDs(badmin.GetAdminLogin().RoleList);
                //if (!badmin.GetAdminLogin().RoleList.Contains(",1,") && !prowinfo.Contains("," + pubinfo.PubTableName + ","))
                //{
                //    function.WriteErrMsg("无权限管理该互动信息!!");
                //}
                string type = (Request.QueryString["type"] == null) ? "0" : Request.QueryString["type"].ToString();
                //----------------------
                PubName = pubinfo.PubName;
                string      ModelID = (pubinfo.PubModelID == 0) ? "0" : pubinfo.PubModelID.ToString();
                M_ModelInfo model   = bmodel.GetModelById(DataConverter.CLng(ModelID));
                this.HiddenNode.Value = "";
                if (NodeID > 0)
                {
                    this.HiddenNode.Value = "&nodeid=" + NodeID;
                }
                this.HdnModelID.Value     = ModelID.ToString();
                this.HiddenType.Value     = type;
                this.ViewState["ModelID"] = ModelID.ToString();
                this.ViewState["cType"]   = "1";
                DataBind();
            }
            Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='" + CustomerPageAction.customPath2 + "Content/ContentManage.aspx'>内容管理</a></li><li><a href='" + Request.RawUrl + "'>互动模块管理</a></li><li class='active'>[" + PubName + "]互动信息</li>");
        }
Пример #4
0
        protected void SaveBtn_Click(object sender, EventArgs e)
        {
            bool isnew = true; int newid = 0;

            if (PubID > 0)
            {
                pubMod = pubBll.SelReturnModel(PubID);
                newid  = pubMod.Pubid;
                isnew  = false;
            }
            pubMod.PubName     = Title_T.Text;
            pubMod.PubTemplate = Intro_T.Text;
            pubMod.Pubinfo     = Json_Hid.Value;
            if (isnew)
            {
                pubMod.PubTableName  = "ZL_Pub_" + PubName_T.Text.Replace(" ", "");
                pubMod.PubType       = 8;
                pubMod.PubCreateTime = DateTime.Now;
                pubMod.PubEndTime    = DateTime.MaxValue;
                if (ZoomLa.SQLDAL.DBHelper.Table_IsExist(pubMod.PubTableName))
                {
                    pubMod.PubTableName += "_" + function.GetRandomString(4);
                    //function.WriteErrMsg(pubMod.PubTableName + "表已存在,请更换表名", "javascript:history.go(-1);");
                }
                pubBll.CreateModelInfo(pubMod);
                newid = pubBll.insert(pubMod);
            }
            else
            {
                pubBll.UpdateByID(pubMod);
            }
            Response.Redirect("/Rss/FormView.aspx?pid=" + newid);
        }
Пример #5
0
        public IActionResult Pubsinfo()
        {
            int   pubId  = DataConvert.CLng(GetParam("PubID"));
            M_Pub pubMod = pubBll.SelReturnModel(pubId);

            if (pubMod == null)
            {
                return(WriteErr("互动模块不存在"));
            }
            if (string.IsNullOrEmpty(pubMod.PubTableName))
            {
                return(WriteErr("互动表为空"));
            }
            ViewBag.pubMod  = pubMod;
            ViewBag.fieldDT = GetFieldDT(pubMod.PubModelID);
            PageSetting setting = B_Pub_Info.SelPage(CPage, PSize, new F_PubInfo()
            {
                tbname     = pubMod.PubTableName,
                pid        = DataConvert.CLng(GetParam("ParentID")),
                status     = DataConvert.CLng(GetParam("status"), -100),
                uname      = GetParam("uname"),
                skey       = GetParam("skey"),
                skey_field = GetParam("skey_dp")
            });

            foreach (DataRow dr in setting.dt.Rows)
            {
                dr["PubIP"] = dr["PubIP"] + "(" + IPScaner.IPLocation(DataConvert.CStr(dr["PubIP"])) + ")";
            }
            if (Request.IsAjaxRequest())
            {
                return(PartialView("Pubsinfo_List", setting));
            }
            return(View(setting));
        }
Пример #6
0
        public ActionResult Reply()
        {
            int    ModelID    = 0;
            int    PubID      = 0;
            string PubTable   = "";
            int    PubCID     = 0;
            string PubInputer = "";
            string title      = "";

            string pid = Request["pubid"] ?? "";
            string id  = Request["id"] ?? "";

            if (!string.IsNullOrEmpty(pid) && !string.IsNullOrEmpty(id))
            {
                M_Pub mp = pubBll.GetSelect(DataConverter.CLng(pid));
                ModelID  = mp.PubModelID;
                PubID    = mp.Pubid;
                PubTable = mp.PubTableName;
                PubCID   = DataConverter.CLng(id);
                DataTable dtpub = pubBll.GetPubModeById(PubCID, PubTable);
                if (dtpub != null && dtpub.Rows.Count > 0)
                {
                    title      = "回复 [" + dtpub.Rows[0]["PubUserName"] + "    " + dtpub.Rows[0]["PubTitle"] + "]";
                    PubInputer = dtpub.Rows[0]["PubInputer"].ToString();
                }
            }
            TempData["ModelID"]    = ModelID;
            TempData["PubID"]      = PubID;
            TempData["PubTable"]   = PubTable;
            TempData["PubCID"]     = PubCID;
            TempData["PubInputer"] = PubInputer;
            ViewBag.title          = title;
            return(View());
        }
Пример #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     B_Admin.CheckIsLogged();
     if (function.isAjax())
     {
         string action = Request.Form["action"];
         string value  = Request.Form["value"];
         switch (action)
         {
         case "PubName":
             break;
         }
         Response.Write(1); Response.Flush(); Response.End();
     }
     if (!IsPostBack)
     {
         if (PubID > 0)
         {
             pubMod = pubBll.SelReturnModel(PubID);
             if (pubMod.PubType != 8)
             {
                 function.WriteErrMsg("该互动模块,并非互动表单!!");
             }
             Json_Hid.Value = pubMod.Pubinfo;
             Title_T.Text   = pubMod.PubName;
             PubName_T.Text = pubMod.PubTableName;
             Intro_T.Text   = pubMod.PubTemplate;
             function.Script(this, "InitForm();");
         }
         else
         {
             function.Script(this, "DisDefault();");
         }
     }
 }
Пример #8
0
        public IActionResult Reply()
        {
            int    ModelID    = 0;
            int    PubID      = 0;
            string PubTable   = "";
            int    PubCID     = 0;
            string PubInputer = "";
            string title      = "";

            string pid = RequestEx["pubid"] ?? "";
            string id  = RequestEx["id"] ?? "";

            if (!string.IsNullOrEmpty(pid) && !string.IsNullOrEmpty(id))
            {
                M_Pub mp = pubBll.GetSelect(DataConverter.CLng(pid));
                ModelID  = mp.PubModelID;
                PubID    = mp.Pubid;
                PubTable = mp.PubTableName;
                PubCID   = DataConverter.CLng(id);
            }
            TempData["ModelID"]    = ModelID;
            TempData["PubID"]      = PubID;
            TempData["PubTable"]   = PubTable;
            TempData["PubCID"]     = PubCID;
            TempData["PubInputer"] = PubInputer;
            ViewBag.title          = title;
            return(View());
        }
Пример #9
0
        // 处理AJAX请求
        private void ProcAjax()
        {
            string action = Request.Form["action"];
            string value  = Request.Form["value"];
            int    pubID  = DataConvert.CLng(Request.Form["pubID"]);//PubID
            string result = "";

            switch (action)
            {
            case "GetScore1":    //获取评分1,返回json效果,s:源,v:value
                int       cid      = DataConvert.CLng(Request.Form["cid"]);
                M_Pub     pubinfo  = pubBll.GetSelect(pubID);
                string[]  valArr   = GetTotal(pubinfo.PubTableName, cid);
                DataTable resultDT = new DataTable();
                resultDT.Columns.Add(new DataColumn("s", typeof(string)));
                resultDT.Columns.Add(new DataColumn("v", typeof(string)));
                string[] arr = value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < arr.Length; i++)
                {
                    DataRow dr = resultDT.NewRow();
                    dr["s"] = arr[i];
                    int s = valArr.Count(p => p == arr[i]);;
                    dr["v"] = s;
                    resultDT.Rows.Add(dr);
                }
                result = JsonHelper.JsonSerialDataTable(resultDT);
                break;
            }
            Response.Clear(); Response.Write(result); Response.Flush(); Response.End();
        }
Пример #10
0
 // 更新总参与人数
 private void Upaddnums(M_Pub mpub)
 {
     mpub.PubAddnum = mpub.PubAddnum + 1;
     pubBll.GetUpdate(mpub);
     buser.ChangeVirtualMoney(buser.GetLogin().UserID, new M_UserExpHis()
     {
         score     = SiteConfig.UserConfig.CommentRule,
         detail    = "",
         ScoreType = (int)M_UserExpHis.SType.Point
     });
     if (string.IsNullOrEmpty(mpub.PubGourl))
     {
         if (mpub.PubGourl == "")
         {
             function.Script(this, "ActionSec(1,'" + Server.HtmlEncode(Request.UrlReferrer.ToString()) + "')");
         }
         else
         {
             B_CreateShopHtml bll = new B_CreateShopHtml();
             bll.CreateShopHtml(mpub.PubGourl);
             function.Script(this, "ActionSec(1,'" + bll.CreateShopHtml(mpub.PubGourl) + "')");
         }
     }
     else
     {
         B_CreateShopHtml bll = new B_CreateShopHtml();
         bll.CreateShopHtml(mpub.PubGourl);
         function.Script(this, "ActionSec(1,'" + mpub.PubGourl + "')");
     }
 }
Пример #11
0
    protected void Button1_Click1(object sender, EventArgs e)
    {
        double     money = 5;
        M_UserInfo mu    = buser.GetLogin();
        DataTable  pubdt = SqlHelper.ExecuteTable(CommandType.Text, "select * from ZL_Pub_code where PubUserID=" + mu.UserID + " And Pubstart=1 And DATEDIFF(MINUTE,PubAddTime,GETDATE())<=5", null);

        if (pubdt.Rows.Count > 0)
        {
            function.WriteErrMsg("五分钟之内只能购买一次!");
        }
        else
        {
            DataTable bmdt = SqlHelper.ExecuteTable("select * from ZL_CommonModel left join ZL_C_yjbl on ItemID=ID where ModelID=51 And Status=99 And bm=" + bm.Text);
            if (bmdt.Rows.Count > 0)
            {
                DataTable bmudt = SqlHelper.ExecuteTable("select * from ZL_Pub_code where Pubstart=1 And bm=" + bm.Text);
                if (bmudt.Rows.Count > 0)
                {
                    function.WriteErrMsg("该编码已使用,请重新输入!");
                }
                else
                {
                    pubMod = pubBll.SelReturnModel(PubID);
                    string    Mdata = "[{PubContentid:'" + bm.Text + "',PubTitle:'业绩信息',PubContent:'" + PubContent.Text + "',bm:'" + bm.Text + "'}]";
                    DataTable dt    = JsonConvert.DeserializeObject <DataTable>(Mdata);
                    ForDataColumn(pubMod, dt);
                    DataRow dr = dt.Rows[0];
                    if (DBCenter.Insert(pubMod.PubTableName, BLLCommon.GetFields(dr), BLLCommon.GetParas(dr), BLLCommon.GetParameters(dr)) > 0)
                    {
                        M_Uinfo umub = buser.GetUserBaseByuserid(mu.UserID);
                        switch (umub.Province)
                        {
                        case "北京":
                            money = 10;
                            break;

                        default:
                            break;
                        }
                        buser.ChangeVirtualMoney(mu.UserID, new M_UserExpHis()
                        {
                            score     = 10,
                            ScoreType = 1,
                            detail    = "销售产品获得资金:" + money + ",业绩编码:" + bm.Text
                        });
                        function.WriteSuccessMsg("销售成功!", "/User/Info/ConsumeDetail1.aspx?SType=1");
                    }
                }
            }
            else
            {
                function.WriteErrMsg("该编码无效,请重新输入!");
            }
        }
    }
Пример #12
0
        public ActionResult PubInfo()
        {
            M_Pub       pubMod  = pubBll.SelReturnModel(PubID);
            PageSetting setting = pubBll.GetComments_SPage(CPage, PSize, pubMod.PubTableName, mu.UserName);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("PubInfo_List", setting));
            }
            return(View(setting));
        }
 protected void RPT_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     switch (e.CommandName)
     {
     case "del2":
         pubMod = pubBll.SelReturnModel(Mid);
         int id = Convert.ToInt32(e.CommandArgument);
         pubBll.DelComments(pubMod.PubTableName, id);
         break;
     }
     MyBind();
 }
Пример #14
0
 public bool InsertUpdate(M_Pub model)
 {
     if (model.Pubid > 0)
     {
         UpdateByID(model);
     }
     else
     {
         insert(model);
     }
     return(true);
 }
Пример #15
0
        public void PubManageSubmit()
        {
            M_Pub pubMod = pubBll.SelReturnModel(PubID);

            if (pubMod.PubPermissions.IndexOf("Look") == -1)
            {
                function.WriteErrMsg("后台未赋予查看权限");
            }
            else
            {
                Response.Redirect("PubInfo?pid=" + pubMod.Pubid);
            }
        }
Пример #16
0
        public IActionResult PubManageSubmit()
        {
            M_Pub pubMod = pubBll.SelReturnModel(PubID);

            if (pubMod.PubPermissions.IndexOf("Look") == -1)
            {
                return(WriteErr("后台未赋予查看权限"));
            }
            else
            {
                return(RedirectToAction("PubInfo", new { pid = pubMod.Pubid }));
            }
        }
Пример #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        function.AccessRulo();
        B_Admin badmin = new B_Admin();

        badmin.CheckIsLogin();
        if (!this.Page.IsPostBack)
        {
            string Pubid = string.IsNullOrEmpty(Request.QueryString["Pubid"].ToString()) ? "0" : Request.QueryString["Pubid"].ToString();
            pubMod = pubBll.SelReturnModel(DataConverter.CLng(Pubid));
            string prowinfo = B_Role.GetPowerInfoByIDs(badmin.GetAdminLogin().RoleList);
            if (!badmin.GetAdminLogin().RoleList.Contains(",1,") && !prowinfo.Contains("," + pubMod.PubTableName + ","))
            {
                function.WriteErrMsg("无权限管理该互动模型!!");
            }
            string ModelID = bpub.GetSelect(DataConverter.CLng(Pubid)).PubModelID.ToString();
            //  int ModelID = string.IsNullOrEmpty(Request.QueryString["ModelID"]) ? 0 : DataConverter.CLng(Request.QueryString["ModelID"]);
            this.HiddenPubid.Value = Pubid;
            if (DataConverter.CLng(ModelID) <= 0)
            {
                function.WriteErrMsg("缺少用户模型ID参数!");
            }
            //jc:查找相应模版实体
            //    M_ModelInfo model = bmodel.GetModelById(ModelID);
            string small = string.IsNullOrEmpty(Request.QueryString["small"]) ? "0" : Request.QueryString["small"].ToString();
            this.HiddenSmall.Value = small;
            this.HdnModelID.Value  = ModelID;
            M_ModelInfo model = bmodel.GetModelById(DataConverter.CLng(ModelID));
            int         ID    = string.IsNullOrEmpty(Request.QueryString["ID"]) ? 0 : DataConverter.CLng(Request.QueryString["ID"]);
            this.HiddenID.Value = ID.ToString();
            ViewState["ID"]     = ID.ToString();
            if (ID < 0)
            {
                function.WriteErrMsg("缺少ID参数!");
            }


            DataTable UserData = new DataTable();
            DataTable aas      = ShowGrid();
            int       zong     = aas.Rows.Count;


            UserData = buser.GetUserModeInfo(model.TableName, ID, 18);

            this.ptit.Text = UserData.Rows[0]["PubTitle"].ToString();

            DetailsView1.DataSource = UserData.DefaultView;
            DetailsView1.DataBind();
            Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='pubmanage.aspx'>互动管理</a></li> <li><a href='Pubsinfo.aspx?Pubid=" + Pubid + "&type=0'>互动信息管理</a></li><li>互动信息</li>");
        }
    }
Пример #18
0
        public IActionResult PubAdd()
        {
            ViewBag.modelDT = modBll.GetListPub();
            M_Pub pubMod = new M_Pub();

            if (Mid > 0)
            {
                pubMod = pubBll.SelReturnModel(Mid);
                pubMod.PubTableName = pubMod.PubTableName;
            }
            else
            {
            }
            return(View(pubMod));
        }
Пример #19
0
        public ActionResult FormView()
        {
            int Mid = DataConverter.CLng(Request["pid"]);

            if (Mid < 1)
            {
                function.WriteErrMsg("未指定模型ID"); return(Content(""));
            }
            M_Pub pubMod = pubBll.SelReturnModel(Mid);

            ViewBag.PubName     = pubMod.PubName;
            ViewBag.PubTemplate = pubMod.PubTemplate;
            ViewBag.PubContent  = pubMod.Pubinfo;
            return(View());
        }
        protected void DownExcel_Btn_Click(object sender, EventArgs e)
        {
            M_Pub_Excel excelMod = new M_Pub_Excel();
            B_Pub_Excel excelBll = new B_Pub_Excel();
            M_Pub       pubinfo  = pub.GetSelect(PubID);

            excelMod = excelBll.SelByTbName(pubinfo.PubTableName);
            if (excelMod == null)
            {
                function.WriteErrMsg("尚未为表:" + pubinfo.PubTableName + "指定导出规则,请先<a href='PubExcel.aspx?mid=" + pubinfo.PubModelID + "'>点此设定导出规则</a>");
            }
            OfficeHelper ofHelper = new OfficeHelper();

            SafeC.DownStr(ofHelper.GetExcelByDT(GetDT(), excelMod.Fields, excelMod.CNames), DateTime.Now.ToString("yyyyMMdd") + "互动信息.xls", Encoding.Default);
        }
Пример #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ZoomLa.Common.function.AccessRulo();
            B_Admin badmin = new B_Admin();

            if (!this.Page.IsPostBack)
            {
                string Pubid = string.IsNullOrEmpty(Request.QueryString["Pubid"]) ? "0" : Request.QueryString["Pubid"].ToString();
                pubMod = bpub.SelReturnModel(DataConverter.CLng(Pubid));
                string prowinfo = B_Role.GetPowerInfoByIDs(badmin.GetAdminLogin().RoleList);
                if (!badmin.GetAdminLogin().RoleList.Contains(",1,") && !prowinfo.Contains("," + pubMod.PubTableName + ","))
                {
                    function.WriteErrMsg("无权限管理该互动信息!!");
                }
                string Parentid = string.IsNullOrEmpty(Request.QueryString["Parentid"]) ? "0" : Request.QueryString["Parentid"].ToString();
                int    ModelID  = DataConverter.CLng(bpub.GetSelect(DataConverter.CLng(Pubid)).PubModelID.ToString());
                this.HdnType.Value = string.IsNullOrEmpty(Request.QueryString["small"]) ? null : Request.QueryString["small"].ToString();
                if (DataConverter.CLng(Pubid) <= 0 || DataConverter.CLng(Parentid) <= 0)
                {
                    function.WriteErrMsg("缺少用户参数!");
                }
                //jc:查找相应模版实体
                M_ModelInfo model = bmodel.GetModelById(ModelID);
                this.HdnPubid.Value       = Pubid;
                this.HiddenParentid.Value = Parentid;
                this.HdnModel.Value       = ModelID.ToString();
                int ID = string.IsNullOrEmpty(Request.QueryString["ID"]) ? 0 : DataConverter.CLng(Request.QueryString["ID"]);
                this.HdnID.Value       = ID.ToString();
                this.LblModelName.Text = "回复" + model.ItemName;
                string Html = bfield.InputallHtml(ModelID, 0, new ModelConfig());
                //GetPubModelHtmlall
                ModelHtml.Text = Html;



                ///////////
                DataTable UserData = new DataTable();
                DataTable aas      = ShowGrid();

                int zong = aas == null ? 0 : aas.Rows.Count;
                int sID  = string.IsNullOrEmpty(Request.QueryString["Parentid"]) ? 0 : DataConverter.CLng(Request.QueryString["Parentid"]);
                UserData = buser.GetUserModeInfo(model.TableName, sID, 18);
                DetailsView1.DataSource = UserData.DefaultView;
                DetailsView1.DataBind();
                //////////////
                Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='pubmanage.aspx'>互动管理</a></li><li>添加信息</li>");
            }
        }
        public string GetCount(string id)
        {
            M_Pub       pubinfo  = pub.GetSelect(PubID);
            string      ModelID  = (pubinfo.PubModelID == 0) ? "0" : pubinfo.PubModelID.ToString();
            M_ModelInfo model    = bmodel.GetModelById(DataConverter.CLng(ModelID));
            DataTable   UserData = buser.GetUserModeInfo(model.TableName, DataConverter.CLng(id), 13);

            if (UserData != null)
            {
                return(UserData.Rows.Count.ToString() + "条");
            }
            else
            {
                return("0条");
            }
        }
Пример #23
0
        public int Pub_Del(string ids)
        {
            //if (conBll.DelByIDS(ids)) { return 1; } else { return 0; }
            int   mid    = Convert.ToInt32(ids.Split(':')[0]);
            int   pid    = Convert.ToInt32(ids.Split(':')[1]);
            M_Pub pinfos = pubBll.GetSelect(pid);

            if (pubBll.DeleteModel(pinfos.PubTableName, "ID='" + mid + "'"))
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
Пример #24
0
        //Excel下载
        protected void DownExcel_Btn_Click(object sender, EventArgs e)
        {
            M_Pub_Excel excelMod = new M_Pub_Excel();
            B_Pub_Excel excelBll = new B_Pub_Excel();
            int         pubid    = Convert.ToInt32(Request.QueryString["PubID"]);
            M_Pub       pubinfo  = pub.GetSelect(pubid);

            excelMod = excelBll.SelByTbName(pubinfo.PubTableName);
            if (excelMod == null)
            {
                function.WriteErrMsg("尚未为表:" + pubinfo.PubTableName + "指定导出规则,请先<a href='PubExcel.aspx'>点此设定导出规则</a>");
            }
            OfficeHelper ofHelper = new OfficeHelper();

            SafeSC.DownStr(ofHelper.GetExcelByDT(GetDT(), excelMod.Fields, excelMod.CNames), "互动回复.xls");
        }
Пример #25
0
        public ActionResult PubView()
        {
            int    TopID = DataConverter.CLng(Request["menu"]);
            int    PubID = DataConverter.CLng(Request["pubid"]);
            string Small = Request["small"] ?? "";
            int    ID    = DataConverter.CLng(Request["ID"]);

            if (ID <= 0)
            {
                function.WriteErrMsg("缺少ID参数"); return(Content(""));
            }
            M_Pub pubMod  = pubBll.GetSelect(PubID);
            int   ModelID = pubMod == null ? 0 : pubMod.PubModelID;

            if (ModelID <= 0)
            {
                function.WriteErrMsg("缺少用户模型ID参数!"); return(Content(""));
            }
            M_ModelInfo model  = modBll.GetModelById(DataConverter.CLng(ModelID));
            DataTable   DataDt = buser.GetUserModeInfo(model.TableName, ID, 18);
            DataTable   newDt  = new DataTable();

            if (DataDt.Rows.Count > 0)
            {
                DataRow   DataDr  = DataDt.Rows[0];
                DataTable FieldDt = fieldBll.GetModelFieldList(ModelID);
                newDt.Columns.Add("Title");
                newDt.Columns.Add("Content");
                DataRow dr1 = newDt.NewRow(); dr1["Title"] = "ID"; dr1["Content"] = DataDr["ID"]; newDt.Rows.Add(dr1);
                DataRow dr2 = newDt.NewRow(); dr2["Title"] = "用户名"; dr2["Content"] = DataDr["PubUserName"]; newDt.Rows.Add(dr2);
                DataRow dr3 = newDt.NewRow(); dr3["Title"] = "标题"; dr3["Content"] = DataDr["PubTitle"]; newDt.Rows.Add(dr3);
                DataRow dr4 = newDt.NewRow(); dr4["Title"] = "内容"; dr4["Content"] = DataDr["PubContent"]; newDt.Rows.Add(dr4);
                DataRow dr5 = newDt.NewRow(); dr5["Title"] = "IP地址"; dr5["Content"] = DataDr["PubIP"]; newDt.Rows.Add(dr5);
                DataRow dr6 = newDt.NewRow(); dr6["Title"] = "添加时间"; dr6["Content"] = DataDr["PubAddTime"]; newDt.Rows.Add(dr6);
                foreach (DataRow dr in FieldDt.Rows)
                {
                    DataRow row = newDt.NewRow();
                    row["Title"]   = dr["FieldAlias"];
                    row["Content"] = DataDr[dr["FieldName"].ToString()];
                    newDt.Rows.Add(row);
                }
            }
            ViewBag.Details   = newDt;
            ViewBag.ReturnUrl = Small.ToLower().Equals("small") ? "ViewSmallPub?pubid=" + PubID + "&ID=" + TopID : "ViewPub?pubid=" + PubID;
            ViewBag.AddUrl    = "AddPub?Pubid=" + PubID + "&Parentid=" + ID;
            return(View());
        }
Пример #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            function.AccessRulo();
            B_Admin badmin = new B_Admin();

            if (!this.IsPostBack)
            {
                int pubid = DataConverter.CLng(Request.QueryString["Pubid"]);
                ViewState["pubid"] = pubid.ToString();
                M_Pub  pubinfo  = pub.GetSelect(pubid);
                string prowinfo = B_Role.GetPowerInfoByIDs(badmin.GetAdminLogin().RoleList);
                if (!badmin.GetAdminLogin().RoleList.Contains(",1,") && !prowinfo.Contains("," + pubinfo.PubTableName + ","))
                {
                    function.WriteErrMsg("无权限管理该互动模型!!");
                }
                string ModelID = (pubinfo.PubModelID == 0) ? "0" : pubinfo.PubModelID.ToString();
                if (DataConverter.CLng(ModelID) <= 0)
                {
                    function.WriteErrMsg("无模块信息");
                }
                int ID = string.IsNullOrEmpty(Request.QueryString["ID"]) ? 0 : DataConverter.CLng(Request.QueryString["ID"]);
                this.HdnID.Value = ID.ToString();
                string      type  = (Request.QueryString["type"] == null) ? "0" : Request.QueryString["type"].ToString();
                M_ModelInfo model = bmodel.GetModelById(DataConverter.CLng(ModelID));
                this.HdnModelID.Value     = ModelID.ToString();
                this.HiddenType.Value     = type;
                this.HiddenPubid.Value    = pubid.ToString();
                this.ViewState["ModelID"] = ModelID.ToString();
                this.ViewState["cType"]   = "1";
                RepNodeBind();
                int nodeid = (Request.QueryString["nodeid"] == null) ? 0 : DataConverter.CLng(Request.QueryString["nodeid"]);
                this.HiddenNode.Value = "";
                if (nodeid == 0)
                {
                    Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='pubmanage.aspx'>互动管理</a></li><li><a href='AddPub.aspx?Parentid=" + this.HdnID.Value + "&Pubid=" + this.HiddenPubid.Value + "' style='color:red;'>[添加回复]</a></li>");
                }
                else
                {
                    B_Node bbn = new B_Node();
                    M_Node nn  = bbn.GetNodeXML(nodeid);
                    Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='pubmanage.aspx'>互动管理</a></li><li><a href='Pubsinfo.aspx?nodeid=" + nodeid + "&Pubid=" + this.HiddenPubid.Value + "' style='color:red;'>" + nn.NodeName + "</a></li>");
                    this.HiddenNode.Value = "&nodeid=" + nodeid;
                }
                //this.Label1.Text = "<a href='AddPub.aspx?Parentid=" + this.HdnID.Value + "&Pubid=" + this.HiddenPubid.Value + "'>[&nbsp;&nbsp;&nbsp;添加回复&nbsp;&nbsp;]</a>";
            }
        }
Пример #27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     RPT.SPage = MyBind;
     pubMod    = pubBll.SelReturnModel(PubID);
     if (!IsPostBack)
     {
         M_ModelInfo modMod = modBll.SelReturnModel(pubMod.PubModelID);
         //--------------------------
         FieldDT            = GetFieldDT(modMod.ModelID);
         skey_dp.DataSource = FieldDT;
         skey_dp.DataBind();
         Field_RPT.DataSource = FieldDT;
         Field_RPT.DataBind();
         ModelName_L.Text = "[" + modMod.ModelName + "]";
         RPT.DataBind();
     }
 }
Пример #28
0
        public ContentResult Pub_API()
        {
            string action = RequestEx["action"];
            string ids    = RequestEx["ids"];

            switch (action)
            {
            case "del":
            {
                pubBll.DelByIDS(ids);
            }
            break;

            case "copy":
            {
                int id = DataConvert.CLng(ids);
                if (id < 1)
                {
                    return(Content(Failed.ToString()));
                }
                M_Pub pubMod = pubBll.SelReturnModel(id);
                pubMod.Pubid         = 0;
                pubMod.PubCreateTime = DateTime.Now;
                pubMod.PubName       = pubMod.PubName + "_copy";
                pubBll.insert(pubMod);
            }
            break;

            case "modelname":    //模型名ajax检测
            {
                string name   = DataConverter.CStr(Request.Form["value"]);
                string result = DBHelper.Table_IsExist(B_Pub.PREFIX + name).ToString().ToLower();
                return(Content(result));
                //return "<font color=blue>数据表已存在! 可重复使用!</font>";
                //return "<font color=green>数据表不存在,系统将自动创建!</font>";
            }

            case "recover":
            {
                pubBll.RecyleByIDS(ids, 1);
            }
            break;
            }
            return(Content(Success.ToString()));
        }
Пример #29
0
        public ActionResult ViewPub()
        {
            int         PubID   = DataConverter.CLng(Request["pubid"]);
            M_Pub       pubMod  = pubBll.GetSelect(PubID);
            int         ModelID = pubMod == null ? 0 : pubMod.PubModelID;
            M_ModelInfo model   = modBll.GetModelById(ModelID);
            PageSetting setting = new PageSetting();

            setting           = buser.GetUserModeInfo_Page(CPage, PSize, model.TableName, mu.UserID, 16);
            ViewBag.PubID     = PubID;
            ViewBag.PubType   = pubMod.PubType;
            ViewBag.TableName = model.TableName;
            if (Request.IsAjaxRequest())
            {
                return(PartialView("ViewPub_List", setting));
            }
            return(View(setting));
        }
Пример #30
0
        //未处理
        public ActionResult ManagePub()
        {
            DataTable nodeDT = pubBll.Sel();

            if (nodeDT.Rows.Count < 1)
            {
                function.WriteErrMsg("互动无节点信息"); return(Content(""));
            }
            if (PubID < 1)
            {
                return(RedirectToAction("ManagePub", new { pid = nodeDT.Rows[0]["PubID"] }));
            }
            M_Pub       pubMod  = pubBll.SelReturnModel(PubID);
            PageSetting setting = pubBll.SelInfoPage(CPage, PSize, pubMod.PubTableName, -100, mu.UserID);

            ViewBag.nodeDT = nodeDT;
            return(View(setting));
        }