示例#1
0
        /// <summary>
        /// 更新一条数据


        /// </summary>
        public bool Update(SCZM.Model.System.sys_Bulletin model, string fileId, out string message)
        {
            message = "修改成功!";
            int rows = dal.Update(model);

            if (rows == 0)
            {
                message = "对不起,该条数据已被其他人删除!";
                return(false);
            }
            else
            {
                DAL.System.sys_Attachment attachDal = new DAL.System.sys_Attachment();

                attachDal.DelUseList("公告", model.ID);
                if (fileId != "")
                {
                    attachDal.UpdateUseList(fileId, "公告", model.ID);
                }
                if (model.Attachment != "")
                {
                    attachDal.UpdateUseList(fileId, "公告", model.ID);
                }
                return(true);
            }
        }
示例#2
0
        /// <summary>
        /// 更新一条数据


        /// </summary>
        public bool Update(SCZM.Model.System.sys_Mail_Send model, string fileId, out string message)
        {
            message = "保存成功!";
            int rows = dal.Update(model);

            if (rows == 0)
            {
                message = "对不起,该条数据已被其他人删除!";
                return(false);
            }
            else
            {
                DAL.System.sys_Attachment attachDal = new DAL.System.sys_Attachment();

                attachDal.DelUseList("邮件", model.ID);
                if (fileId != "")
                {
                    attachDal.UpdateUseList(fileId, "邮件", model.ID);
                }
                if (model.Attachment != "")
                {
                    attachDal.UpdateUseList(fileId, "邮件", model.ID);
                }
                if (model.BillState == 1)
                {
                    int result = dal.Send(model.ID);
                    if (result > 0)
                    {
                        message = "发送成功!";
                    }
                    else
                    {
                        message = "发送失败!";
                    }
                }
                return(true);
            }
        }