Ejemplo n.º 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(IPSP.Model.TR_RemindMode model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TR_RemindMode set ");
            strSql.Append("g_RemindID=@g_RemindID,");
            strSql.Append("s_RemindMode=@s_RemindMode,");
            strSql.Append("s_RemindObjectType=@s_RemindObjectType,");
            strSql.Append("s_RemindObjectID=@s_RemindObjectID,");
            strSql.Append("g_RemindTemplateID=@g_RemindTemplateID,");
            strSql.Append("s_Title=@s_Title,");
            strSql.Append("s_Content=@s_Content");
            strSql.Append(" where g_ID=@g_ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_RemindID",         SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@s_RemindMode",       SqlDbType.NVarChar,           1),
                new SqlParameter("@s_RemindObjectType", SqlDbType.NVarChar,           1),
                new SqlParameter("@s_RemindObjectID",   SqlDbType.NVarChar,          50),
                new SqlParameter("@g_RemindTemplateID", SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@s_Title",            SqlDbType.NVarChar,         100),
                new SqlParameter("@s_Content",          SqlDbType.NVarChar,          -1),
                new SqlParameter("@g_ID",               SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = model.g_RemindID;
            parameters[1].Value = model.s_RemindMode;
            parameters[2].Value = model.s_RemindObjectType;
            parameters[3].Value = model.s_RemindObjectID;
            parameters[4].Value = model.g_RemindTemplateID;
            parameters[5].Value = model.s_Title;
            parameters[6].Value = model.s_Content;
            parameters[7].Value = model.g_ID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public IPSP.Model.TR_RemindMode DataRowToModel(DataRow row)
 {
     IPSP.Model.TR_RemindMode model = new IPSP.Model.TR_RemindMode();
     if (row != null)
     {
         if (row["g_ID"] != null && row["g_ID"].ToString() != "")
         {
             model.g_ID = new Guid(row["g_ID"].ToString());
         }
         if (row["g_RemindID"] != null && row["g_RemindID"].ToString() != "")
         {
             model.g_RemindID = new Guid(row["g_RemindID"].ToString());
         }
         if (row["s_RemindMode"] != null)
         {
             model.s_RemindMode = row["s_RemindMode"].ToString();
         }
         if (row["s_RemindObjectType"] != null)
         {
             model.s_RemindObjectType = row["s_RemindObjectType"].ToString();
         }
         if (row["s_RemindObjectID"] != null)
         {
             model.s_RemindObjectID = row["s_RemindObjectID"].ToString();
         }
         if (row["g_RemindTemplateID"] != null && row["g_RemindTemplateID"].ToString() != "")
         {
             model.g_RemindTemplateID = new Guid(row["g_RemindTemplateID"].ToString());
         }
         if (row["s_Title"] != null)
         {
             model.s_Title = row["s_Title"].ToString();
         }
         if (row["s_Content"] != null)
         {
             model.s_Content = row["s_Content"].ToString();
         }
     }
     return(model);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(IPSP.Model.TR_RemindMode model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TR_RemindMode(");
            strSql.Append("g_ID,g_RemindID,s_RemindMode,s_RemindObjectType,s_RemindObjectID,g_RemindTemplateID,s_Title,s_Content)");
            strSql.Append(" values (");
            strSql.Append("@g_ID,@g_RemindID,@s_RemindMode,@s_RemindObjectType,@s_RemindObjectID,@g_RemindTemplateID,@s_Title,@s_Content)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_ID",               SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@g_RemindID",         SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@s_RemindMode",       SqlDbType.NVarChar,           1),
                new SqlParameter("@s_RemindObjectType", SqlDbType.NVarChar,           1),
                new SqlParameter("@s_RemindObjectID",   SqlDbType.NVarChar,          50),
                new SqlParameter("@g_RemindTemplateID", SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@s_Title",            SqlDbType.NVarChar,         100),
                new SqlParameter("@s_Content",          SqlDbType.NVarChar, -1)
            };
            parameters[0].Value = Guid.NewGuid();
            parameters[1].Value = Guid.NewGuid();
            parameters[2].Value = model.s_RemindMode;
            parameters[3].Value = model.s_RemindObjectType;
            parameters[4].Value = model.s_RemindObjectID;
            parameters[5].Value = Guid.NewGuid();
            parameters[6].Value = model.s_Title;
            parameters[7].Value = model.s_Content;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public IPSP.Model.TR_RemindMode GetModel(Guid g_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 g_ID,g_RemindID,s_RemindMode,s_RemindObjectType,s_RemindObjectID,g_RemindTemplateID,s_Title,s_Content from TR_RemindMode ");
            strSql.Append(" where g_ID=@g_ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_ID", SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = g_ID;

            IPSP.Model.TR_RemindMode model = new IPSP.Model.TR_RemindMode();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(IPSP.Model.TR_RemindMode model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(IPSP.Model.TR_RemindMode model)
 {
     return(dal.Add(model));
 }