Esempio n. 1
0
        public DataTable GetDTFromPlat()
        {
            B_Blog_Msg msgBll = new B_Blog_Msg();
            M_Blog_Msg msgMod = msgBll.SelReturnModel(Sid);
            DataTable  dt     = DTFormat();
            int        index  = 0;

            foreach (string file in msgMod.Attach.Split('|'))
            {
                if (SafeSC.IsImage(file))
                {
                    DataRow dr = dt.NewRow();
                    dr["Index"] = index; index++;
                    dr["Src"]   = file;
                    dt.Rows.Add(dr);
                }
            }
            return(dt);
        }
        //protected void Type_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    int modelID = DataConvert.CLng(Type.SelectedValue.ToString());
        //    if (modelID > 0)
        //    {
        //        mmis = bmis.SelReturnModel(modelID);
        //        Content.Text = mmis.ModelContent;
        //    }
        //    else
        //    {
        //        Content.Text = "";
        //    }
        //}
        //protected void proDP_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    if (proDP.SelectedIndex == 0) return;
        //    int proID = DataConvert.CLng(proDP.SelectedValue);
        //    proMod = proBll.SelReturnModel(proID);
        //    if (proMod.AllowAttach == 1)
        //    {
        //        upFileTR.Visible = true;
        //    }
        //}
        //保存
        #endregion
        protected void saveBtn_Click(object sender, EventArgs e)
        {
            int proID = DataConverter.CLng(proDP.SelectedValue);

            if (Request.QueryString["Edit"] == "1" && Request.QueryString["appID"] != "")
            {
                moa = boa.SelReturnModel(DataConvert.CLng(Request.QueryString["appID"]));
                FillMod(0, moa);
                boa.UpdateByID(moa);
            }
            else
            {
                moa    = FillMod(0);
                moa.ID = boa.insert(moa);
            }
            M_MisProcedure proceMod = proBll.SelReturnModel(moa.ProID);

            oaCom.CreateStep(moa, proceMod, new OAStepParam()
            {
                IsFirst   = true,
                ReferUser = RUserID_Hid.Value,
                StepNum   = 1
            });
            {
                //同步入能力中心
                M_User_Plat upMod = B_User_Plat.GetLogin();
                if (upMod != null)
                {
                    B_Blog_Msg msgBll = new B_Blog_Msg();
                    M_Blog_Msg msgMod = new M_Blog_Msg();
                    msgMod.CompID     = upMod.CompID;
                    msgMod.CUser      = upMod.UserID;
                    msgMod.CUName     = upMod.TrueName;
                    msgMod.MsgContent = "[" + upMod.TrueName + "]发布了一条公文,标题:<a href=\"/Office/Office/ReadOffice.aspx?AppID=" + moa.ID + "\" target=\"_blank\">" + moa.Title + "</a>";
                    msgMod.GroupIDS   = "";
                    msgBll.Insert(msgMod);
                }
            }
            Response.Redirect("ViewDrafting.aspx?ID=" + moa.ID);
        }
Esempio n. 3
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)//添加文章
        {
            M_UserInfo     mu         = buser.GetLogin();
            M_Node         nodeMod    = nodeBll.SelReturnModel(NodeID);
            IList <string> content    = new List <string>();
            M_CommonData   CData      = new M_CommonData();
            DataTable      dt         = mfieldBll.SelByModelID(ModelID, false);
            Call           commonCall = new Call();
            DataTable      table      = commonCall.GetDTFromPage(dt, Page, ViewState, content);

            if (GeneralID > 0)
            {
                CData = contentBll.GetCommonData(GeneralID);
            }
            else
            {
                CData.NodeID    = NodeID;
                CData.ModelID   = ModelID;
                CData.TableName = modelBll.GetModelById(CData.ModelID).TableName;
            }
            CData.Title        = txtTitle.Text.Trim();
            CData.EliteLevel   = 0;
            CData.InfoID       = "";
            CData.UpDateType   = 2;
            CData.TagKey       = Request.Form["tabinput"];
            CData.Status       = nodeMod.SiteContentAudit;
            CData.DefaultSkins = 0;
            string parentTree = "";

            CData.FirstNodeID = nodeBll.SelFirstNodeID(NodeID, ref parentTree);
            CData.ParentTree  = parentTree;
            CData.TitleStyle  = ThreadStyle.Value;
            //CData.TopImg = Request.Form["selectpic"];//首页图片
            CData.Subtitle   = Subtitle.Text;
            CData.PYtitle    = PYtitle.Text;
            CData.RelatedIDS = RelatedIDS_Hid.Value;
            CData.IsComm     = 1;
            if (GeneralID > 0)//修改内容
            {
                contentBll.UpdateContent(table, CData);
            }
            else
            {
                CData.Inputer   = mu.UserName;
                CData.GeneralID = contentBll.AddContent(table, CData); //插入信息给两个表,主表和从表:CData-主表的模型,table-从表
            }
            if (GeneralID <= 0)                                        //添加时增加积分
            {
                //积分
                if (SiteConfig.UserConfig.InfoRule > 0)
                {
                    buser.ChangeVirtualMoney(mu.UserID, new M_UserExpHis()
                    {
                        UserID    = mu.UserID,
                        detail    = "添加内容:" + txtTitle.Text + "增加积分",
                        score     = SiteConfig.UserConfig.InfoRule,
                        ScoreType = (int)M_UserExpHis.SType.Point
                    });
                }
            }
            if (true)//nodeMod.CUName.Equals("能力中心")
            {
                M_Blog_Msg  msgMod = new M_Blog_Msg();
                M_User_Plat upMod  = B_User_Plat.GetLogin();
                //M_Common_Notify comMod = new M_Common_Notify();
                B_Blog_Msg msgBll = new B_Blog_Msg();
                //B_Common_Notify comBll = new B_Common_Notify();
                RegexHelper regHelper = new RegexHelper();
                string      msg       = "#" + nodeMod.NodeName + "#[" + upMod.TrueName + "]发布了[<a href='/Item/" + CData.GeneralID + ".aspx' title='点击访问'>" + CData.Title + "</a>]";
                string      deftopic  = "#插入话题#";
                if (msg.Contains("#"))
                {
                    msg = msg.Replace(deftopic, "");
                    string tlp = "<a href='/Plat/Blog?Skey={0}' title='话题浏览'>{1}</a>";
                    Dictionary <string, string> itemDic = new Dictionary <string, string>();
                    for (int i = 0; !string.IsNullOrEmpty(regHelper.GetValueBySE(msg, "#", "#", false)) && i < 5; i++)//最多不能超过5个话题
                    {
                        string topic = "#" + regHelper.GetValueBySE(msg, "#", "#", false) + "#";
                        msg   = msg.Replace(topic, "{" + i + "}");
                        topic = topic.Replace(" ", "").Replace(",", "");
                        itemDic.Add("{" + i + "}", string.Format(tlp, Server.UrlEncode(topic), topic));
                        msgMod.Topic += topic + ",";
                    }
                    foreach (var item in itemDic)
                    {
                        msg = msg.Replace(item.Key, item.Value);
                    }
                }
                msgMod.MsgType    = 1;
                msgMod.Status     = 1;
                msgMod.CUser      = upMod.UserID;
                msgMod.CUName     = upMod.TrueName;
                msgMod.CompID     = upMod.CompID;
                msgMod.ProID      = 0;
                msgMod.pid        = 0;
                msgMod.ReplyID    = 0;
                msgMod.GroupIDS   = "";
                msgMod.ColledIDS  = "";
                msgMod.MsgContent = msg;
                msgMod.Title      = CData.Title;
                msgMod.ID         = msgBll.Insert(msgMod);
            }
            function.WriteSuccessMsg("操作成功!", "MyContent.aspx?NodeID=" + NodeID);
        }