コード例 #1
0
 /// <summary>
 /// 调用存储过程增加一个
 /// </summary>
 /// <param name="info">实体对象</param>
 /// <returns>正常返回大于 0 的自增id, 0代表重复,否则返回-1</returns>
 public static int Join_EvaluationUserAdd(Entity.Join_EvaluationUser info)
 {
     SqlParameter[] prams =
     {
         SqlDB.MakeInParam("@EvaluationUserName",     SqlDbType.NVarChar, 20, info.EvaluationUserName),
         SqlDB.MakeInParam("@EvaluationUserSex",      SqlDbType.Int,       4, info.EvaluationUserSex),
         SqlDB.MakeInParam("@EvaluationUserBirthday", SqlDbType.NVarChar, 50, info.EvaluationUserBirthday),
         SqlDB.MakeInParam("@EvaluationUserGrade",    SqlDbType.NVarChar, 50, info.EvaluationUserGrade),
         SqlDB.MakeInParam("@EvaluationUserMail",     SqlDbType.NVarChar, 50, info.EvaluationUserMail),
         SqlDB.MakeInParam("@EvaluationUserTel",      SqlDbType.NVarChar, 18, info.EvaluationUserTel),
         SqlDB.MakeInParam("@EvaluationUserPhone",    SqlDbType.NVarChar, 11, info.EvaluationUserPhone),
     };
     return(Basic.Utils.StrToInt(SqlDB.ExecuteScalar(strCon, CommandType.StoredProcedure, "Join_EvaluationUserAdd", prams).ToString(), -1));
 }
コード例 #2
0
        /// <summary>
        /// 获取某一个实体
        /// </summary>
        /// <param name="EvaluationUserId">标识</param>
        /// <returns>返回Entity</returns>
        public static Entity.Join_EvaluationUser Join_EvaluationUserEntityGet(int EvaluationUserId)
        {
            Entity.Join_EvaluationUser info = new Entity.Join_EvaluationUser();
            DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [Join_EvaluationUser] WHERE EvaluationUserId = " + EvaluationUserId + ";").Tables[0];

            if (dt.Rows.Count > 0)
            {
                info.EvaluationUserId       = Basic.Utils.StrToInt(dt.Rows[0]["EvaluationUserId"].ToString(), 0);
                info.EvaluationUserName     = dt.Rows[0]["EvaluationUserName"].ToString();
                info.EvaluationUserSex      = Basic.Utils.StrToInt(dt.Rows[0]["EvaluationUserSex"].ToString(), 0);
                info.EvaluationUserBirthday = dt.Rows[0]["EvaluationUserBirthday"].ToString();
                info.EvaluationUserGrade    = dt.Rows[0]["EvaluationUserGrade"].ToString();
                info.EvaluationUserMail     = dt.Rows[0]["EvaluationUserMail"].ToString();
                info.EvaluationUserTel      = dt.Rows[0]["EvaluationUserTel"].ToString();
                info.EvaluationUserPhone    = dt.Rows[0]["EvaluationUserPhone"].ToString();
            }
            return(info);
        }
コード例 #3
0
        /// <summary>
        /// 调用存储过程修改一个
        /// </summary>
        /// <param name="info">实体对象</param>
        /// <returns>更新成功返回ture,否则返回false</returns>
        public static bool Join_EvaluationUserEdit(Entity.Join_EvaluationUser info)
        {
            SqlParameter[] prams =
            {
                SqlDB.MakeInParam("@EvaluationUserId",       SqlDbType.Int,       4, info.EvaluationUserId),
                SqlDB.MakeInParam("@EvaluationUserName",     SqlDbType.NVarChar, 20, info.EvaluationUserName),
                SqlDB.MakeInParam("@EvaluationUserSex",      SqlDbType.Int,       4, info.EvaluationUserSex),
                SqlDB.MakeInParam("@EvaluationUserBirthday", SqlDbType.NVarChar, 50, info.EvaluationUserBirthday),
                SqlDB.MakeInParam("@EvaluationUserGrade",    SqlDbType.NVarChar, 50, info.EvaluationUserGrade),
                SqlDB.MakeInParam("@EvaluationUserMail",     SqlDbType.NVarChar, 50, info.EvaluationUserMail),
                SqlDB.MakeInParam("@EvaluationUserTel",      SqlDbType.NVarChar, 18, info.EvaluationUserTel),
                SqlDB.MakeInParam("@EvaluationUserPhone",    SqlDbType.NVarChar, 11, info.EvaluationUserPhone),
            };
            int intReturnValue = 0;

            intReturnValue = SqlDB.ExecuteNonQuery(strCon, CommandType.StoredProcedure, "Join_EvaluationUserEdit", prams);
            if (intReturnValue == 1)
            {
                return(true);
            }
            return(false);
        }