Пример #1
0
    public void AddContentToNode(M_OA_Document oaDoc, int NodeID, int ModelID)
    {
        DataTable table = new DataTable();

        table.Columns.Add(new DataColumn("FieldName", typeof(string)));
        table.Columns.Add(new DataColumn("FieldType", typeof(string)));
        table.Columns.Add(new DataColumn("FieldValue", typeof(string)));

        //手动完成赋值
        string[] fieldArr = { "Secret", "Urgency", "Importance", "Attach", "UserGroupT", "content" };
        for (int i = 0; i < fieldArr.Length; i++)
        {
            DataRow dr = table.NewRow();
            dr["FieldName"] = fieldArr[i];
            dr["FieldType"] = "TextType";
            table.Rows.Add(dr);
        }
        table.Rows[0]["FieldValue"] = OAConfig.StrToDic(OAConfig.Secret)[oaDoc.Secret.ToString()];
        table.Rows[1]["FieldValue"] = OAConfig.StrToDic(OAConfig.Urgency)[oaDoc.Urgency.ToString()];
        table.Rows[2]["FieldValue"] = OAConfig.StrToDic(OAConfig.Importance)[oaDoc.Importance.ToString()];
        table.Rows[3]["FieldValue"] = oaDoc.PublicAttach;
        table.Rows[4]["FieldValue"] = groupBll.GetByID(buser.GetLogin().GroupID).GroupName;
        table.Rows[5]["FieldType"]  = "MultipleHtmlType";
        table.Rows[5]["FieldValue"] = oaDoc.Content;

        //将无法获取的值,手动写入table中

        M_CommonData CData = new M_CommonData();

        CData.NodeID    = NodeID;
        CData.ModelID   = ModelID;
        CData.TableName = bmode.GetModelById(ModelID).TableName;
        CData.Title     = oaDoc.Title;
        //判断是否使用文件流程
        if (SiteConfig.SiteOption.ContentConfig == 1)
        {
            CData.Status = 0;
        }
        else
        {
            CData.Status = 99;
        }
        CData.Inputer    = buser.GetLogin().UserName;
        CData.EliteLevel = 0;
        CData.InfoID     = "";
        CData.SpecialID  = "";
        CData.Hits       = 0;
        CData.UpDateType = 2;
        CData.UpDateTime = DateTime.Now;
        //string Keyword = this.TxtTagKey.Text.Trim().Replace(" ", "|");
        CData.TagKey       = oaDoc.Keywords;
        CData.Status       = 99;//状态,如果需要审核后才能看到,这里做下逻辑
        CData.Titlecolor   = "";
        CData.Template     = "";
        CData.CreateTime   = DateTime.Now;
        CData.ProWeek      = 0;
        CData.Pronum       = 0;
        CData.BidType      = 0;
        CData.IsBid        = (CData.BidType > 0) ? 1 : 0;
        CData.BidMoney     = DataConverter.CDouble(0);
        CData.DefaultSkins = 0;
        CData.FirstNodeID  = 0;                            //GetNo(NodeID)
        CData.TitleStyle   = "";
        CData.ParentTree   = conBll.GetParentTree(NodeID); //父级别树
        CData.TopImg       = "";                           //首页图片
        CData.PdfLink      = "";
        CData.Subtitle     = "";
        CData.PYtitle      = "";
        int newID = conBll.AddContent(table, CData);
    }