示例#1
0
        /// <summary>
        /// 添加通告信息(同时添加附件信息)
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool AddNotices(NoticesModel model)
        {
            int nid = Common.Instance._Notices.AddNoticesReturnID(model);

            //添加附件信息
            if (nid > 0 && model.Attachments != null)
            {
                for (int i = 0; i < model.Attachments.Count; i++)
                {
                    model.Attachments[i].ObjectID = nid.ToString();
                    SysattachmentsBLL.AddSysattachments(model.Attachments[i]);
                }
            }
            return(nid > 0);
        }
示例#2
0
        /// <summary>
        /// 改
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool UpdateNotices(NoticesModel model)
        {
            bool res = Common.Instance._Notices.UpdateNotices(model);

            if (res && model.Attachments != null && model.Attachments.Count > 0)
            {
                //增加新增的附件
                for (int i = 0; i < model.Attachments.Count; i++)
                {
                    if (model.Attachments[i].AID <= 0)
                    {
                        model.Attachments[i].ObjectID = model.NID.ToString();
                        SysattachmentsBLL.AddSysattachments(model.Attachments[i]);
                    }
                }
            }
            return(res);
        }