Пример #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">empty model with key value</param>
 /// <returns></returns>
 public static NoticesModel GetNoticesInfo(NoticesModel model)
 {
     model = Common.Instance._Notices.GetNoticesInfo(model);
     if (model != null)
     {
         //附件
         Hashtable where = new Hashtable();
         where.Add(SysattachmentsArgs.ObjectID, model.NID);
         var list = SysattachmentsBLL.GetSysattachmentsList(where);
         if (list != null && list.Count > 0)
         {
             model.Attachments = list;
         }
         //创建人名
         model.NCreaterName = BusinessLogic.Cache.UsersCache.GetName(model.NCreater);
     }
     return(model);
 }
Пример #3
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);
        }