예제 #1
0
파일: BOpinion.cs 프로젝트: windygu/XiaZhou
 /// <summary>
 /// 更新一条意见建议信息
 /// </summary>
 /// <param name="model">意见建议model</param>
 /// <returns></returns>
 public bool UpdateGovOpinion(Model.GovStructure.MGovOpinion model)
 {
     if (model != null && !string.IsNullOrEmpty(model.OpinionId) && !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.OpinionId;
                 model.ComAttachList[i].ItemType = ItemType;
             }
         }
         else
         {
             model.ComAttachList = null;
         }
         if (model.MGovOpinionUserList != null && model.MGovOpinionUserList.Count > 0)
         {
             for (int i = 0; i < model.MGovOpinionUserList.Count; i++)
             {
                 model.MGovOpinionUserList[i].OpinionId = model.OpinionId;
             }
         }
         bool result = dal.UpdateGovOpinion(model, ItemType);
         if (result)
         {
             SysStructure.BSysLogHandle.Insert("更新一条意见建议信息:编号为:" + model.OpinionId);
         }
         return(result);
     }
     return(false);
 }
예제 #2
0
파일: DOpinion.cs 프로젝트: windygu/XiaZhou
        /// <summary>
        /// 更新一条意见建议信息
        /// </summary>
        /// <param name="model">意见建议model</param>
        /// <param name="ItemType">附件类型</param>
        /// <returns></returns>
        public bool UpdateGovOpinion(Model.GovStructure.MGovOpinion model, EyouSoft.Model.EnumType.ComStructure.AttachItemType ItemType)
        {
            bool      IsTrue = false;
            DbCommand dc     = this._db.GetStoredProcCommand("proc_GovOpinion_Update");

            this._db.AddInParameter(dc, "OpinionId", DbType.AnsiStringFixedLength, model.OpinionId);
            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, "ProcessOpinion", DbType.String, model.ProcessOpinion);
            this._db.AddInParameter(dc, "ProcessTime", DbType.DateTime, model.ProcessTime);
            this._db.AddInParameter(dc, "IsOpen", DbType.AnsiStringFixedLength, model.IsOpen == true ? "1" : "0");//1:是,0:否
            this._db.AddInParameter(dc, "Submit", DbType.AnsiStringFixedLength, model.Submit);
            this._db.AddInParameter(dc, "SubmitTime", DbType.DateTime, model.SubmitTime);
            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, "OpinionUserListXML", DbType.Xml, CreateReceiverListXML(model.MGovOpinionUserList));
            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);
        }