public void add(string schoolNo, string schoolName, string message, string messageHead, string messageFoot, string fromMan,
            string fromName, string fromIdentityName, string toUid, string toOpenid, string url, int messageType, bool isSend = true, bool isErr = false, string errMessage = "")
        {
            SqlConnection cn = null;
            try
            {
                cn = DbHelperSQL.getConnection();
                var teachersendmessage = new TeacherSendMessageModel
                {
                    SchoolNo = schoolNo,
                    SchoolName = schoolName,
                    Message = message,
                    MessageHead = messageHead,
                    MessageFoot = messageFoot,
                    FromMan = fromMan,
                    FromName = fromName,
                    FromIdentityName = fromIdentityName,
                    ToUid = toUid,
                    ToOpenid = toOpenid,
                    Url = url,
                    MessageType = messageType,
                    IsSend = isSend,
                    IsErr = isErr,
                    ErrMessage = errMessage
                };

                //执行新增写进数据库
                teachersendmessageDal.add(cn, null, teachersendmessage);
            }
            catch (Exception dalEx)
            {
                throw new MakeException(ExpSort.数据库, dalEx.Message);
            }
            finally
            {
                DbHelperSQL.closeConnection(cn);
            }
        }
        public void add(TeacherSendMessageModel teachersendmessage)
        {
            SqlConnection cn = null;
            SqlTransaction tc = null;
            try
            {
                cn = DbHelperSQL.getConnection();
                tc = DbHelperSQL.startTransaction(cn);

                //执行新增写进数据库
            teachersendmessageDal.add(cn, tc, teachersendmessage);

                DbHelperSQL.commitTransaction(tc);
            }
            catch (Exception dalEx)
            {
                DbHelperSQL.rollBackTransaction(tc);
                throw new MakeException(ExpSort.数据库, dalEx.Message);
            }
            finally
            {
                DbHelperSQL.closeConnection(cn);
            }
        }
 public bool update(SqlConnection cn, SqlTransaction tc, TeacherSendMessageModel model)
 {
     return DbHelperSQL.updateModel<TeacherSendMessageModel>(model, "TeacherSendMessage", "Evenid", model.Evenid.ToString(), "'", cn, tc);
 }
 public bool add(SqlConnection cn, SqlTransaction tc, TeacherSendMessageModel model)
 {
     return DbHelperSQL.insertModel<TeacherSendMessageModel>(model, "TeacherSendMessage", cn, tc);
 }