示例#1
0
 /// <summary>
 /// 更新一条公告通知信息
 /// </summary>
 /// <param name="model">公告通知model</param>
 /// <returns></returns>
 public bool UpdateGovNotice(Model.GovStructure.MGovNotice model)
 {
     if (model != null && !string.IsNullOrEmpty(model.NoticeId) && !string.IsNullOrEmpty(model.CompanyId) && !string.IsNullOrEmpty(model.Title) && !string.IsNullOrEmpty(model.OperatorId))
     {
         if (model.ComAttachList != null && model.ComAttachList.Count > 0)
         {
             for (int i = 0; i < model.ComAttachList.Count; i++)
             {
                 model.ComAttachList[i].ItemId   = model.NoticeId;
                 model.ComAttachList[i].ItemType = ItemType;
             }
         }
         else
         {
             model.ComAttachList = null;
         }
         if (model.MGovNoticeReceiverList != null && model.MGovNoticeReceiverList.Count > 0)
         {
             for (int i = 0; i < model.MGovNoticeReceiverList.Count; i++)
             {
                 model.MGovNoticeReceiverList[i].NoticeId = model.NoticeId;
             }
         }
         bool result = dal.UpdateGovNotice(model, ItemType);
         if (result)
         {
             SysStructure.BSysLogHandle.Insert("更新一条公告通知信息:编号为:" + model.NoticeId);
         }
         return(result);
     }
     return(false);
 }
示例#2
0
        /// <summary>
        /// 更新一条公告通知信息
        /// </summary>
        /// <param name="model">公告通知model</param>
        /// <param name="ItemType">附件类型</param>
        /// <returns></returns>
        public bool UpdateGovNotice(Model.GovStructure.MGovNotice model, EyouSoft.Model.EnumType.ComStructure.AttachItemType ItemType)
        {
            bool      IsTrue = false;
            DbCommand dc     = this._db.GetStoredProcCommand("proc_GovNotice_Update");

            this._db.AddInParameter(dc, "NoticeId", DbType.AnsiStringFixedLength, model.NoticeId);
            this._db.AddInParameter(dc, "CompanyId", DbType.AnsiStringFixedLength, model.CompanyId);
            this._db.AddInParameter(dc, "Title", DbType.String, model.Title);
            this._db.AddInParameter(dc, "Content", DbType.String, model.Content);
            this._db.AddInParameter(dc, "IsRemind", DbType.AnsiStringFixedLength, model.IsRemind == true ? "1" : "0"); //1:是,0:否
            this._db.AddInParameter(dc, "IsMsg", DbType.AnsiStringFixedLength, model.IsMsg == true ? "1" : "0");       //1:是,0:否
            this._db.AddInParameter(dc, "MsgContent", DbType.AnsiString, model.MsgContent);
            this._db.AddInParameter(dc, "Views", DbType.Int32, model.Views);
            this._db.AddInParameter(dc, "DepartId", DbType.Int32, model.DepartId);
            this._db.AddInParameter(dc, "Operator", DbType.String, model.Operator);
            this._db.AddInParameter(dc, "OperatorId", DbType.AnsiStringFixedLength, model.OperatorId);
            this._db.AddInParameter(dc, "IssueTime", DbType.DateTime, model.IssueTime);
            this._db.AddInParameter(dc, "ItemType", DbType.Byte, (int)ItemType);
            this._db.AddInParameter(dc, "ReceiverListXML", DbType.Xml, CreateReceiverListXML(model.MGovNoticeReceiverList));
            this._db.AddInParameter(dc, "ComAttachXML", DbType.Xml, CreateComNoticeXML(model.ComAttachList));
            this._db.AddOutParameter(dc, "Result", DbType.Int32, 4);
            EyouSoft.Toolkit.DAL.DbHelper.RunProcedure(dc, this._db);
            object Result = this._db.GetParameterValue(dc, "Result");

            if (!Result.Equals(null))
            {
                IsTrue = int.Parse(Result.ToString()) > 0 ? true : false;
            }
            return(IsTrue);
        }