Ejemplo n.º 1
0
        /// <summary>
        ///  增加一条数据
        /// </summary>
        public int Add(ZhongLi.Model.ServerUser_Evaluate model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@ID",             SqlDbType.Int,         4),
                new SqlParameter("@SerUserID",      SqlDbType.Int,         4),
                new SqlParameter("@RealName",       SqlDbType.NVarChar,   50),
                new SqlParameter("@EvaluateCon",    SqlDbType.NVarChar,  500),
                new SqlParameter("@EvaluateTime",   SqlDbType.DateTime),
                new SqlParameter("@EvaluateUserID", SqlDbType.Int,         4),
                new SqlParameter("@EvaluateName",   SqlDbType.NVarChar,   50),
                new SqlParameter("@EvaLevel",       SqlDbType.Int,         4),
                new SqlParameter("@OrderID",        SqlDbType.Int,         4),
                new SqlParameter("@EvaluateType",   SqlDbType.Int, 4)
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = model.SerUserID;
            parameters[2].Value     = model.RealName;
            parameters[3].Value     = model.EvaluateCon;
            parameters[4].Value     = model.EvaluateTime;
            parameters[5].Value     = model.EvaluateUserID;
            parameters[6].Value     = model.EvaluateName;
            parameters[7].Value     = model.EvaLevel;
            parameters[8].Value     = model.OrderID;
            parameters[9].Value     = model.EvaluateType;

            DbHelperSQL.RunProcedure("ServerUser_Evaluate_ADD", parameters, out rowsAffected);
            return((int)parameters[0].Value);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public ZhongLi.Model.ServerUser_Evaluate DataRowToModel(DataRow row)
 {
     ZhongLi.Model.ServerUser_Evaluate model = new ZhongLi.Model.ServerUser_Evaluate();
     if (row != null)
     {
         if (row["ID"] != null && row["ID"].ToString() != "")
         {
             model.ID = int.Parse(row["ID"].ToString());
         }
         if (row["SerUserID"] != null && row["SerUserID"].ToString() != "")
         {
             model.SerUserID = int.Parse(row["SerUserID"].ToString());
         }
         if (row["RealName"] != null)
         {
             model.RealName = row["RealName"].ToString();
         }
         if (row["EvaluateCon"] != null)
         {
             model.EvaluateCon = row["EvaluateCon"].ToString();
         }
         if (row["EvaluateTime"] != null && row["EvaluateTime"].ToString() != "")
         {
             model.EvaluateTime = DateTime.Parse(row["EvaluateTime"].ToString());
         }
         if (row["EvaluateUserID"] != null && row["EvaluateUserID"].ToString() != "")
         {
             model.EvaluateUserID = int.Parse(row["EvaluateUserID"].ToString());
         }
         if (row["EvaluateName"] != null)
         {
             model.EvaluateName = row["EvaluateName"].ToString();
         }
         if (row["EvaLevel"] != null && row["EvaLevel"].ToString() != "")
         {
             model.EvaLevel = int.Parse(row["EvaLevel"].ToString());
         }
         if (row["OrderID"] != null && row["OrderID"].ToString() != "")
         {
             model.OrderID = int.Parse(row["OrderID"].ToString());
         }
         if (row["EvaluateType"] != null && row["EvaluateType"].ToString() != "")
         {
             model.EvaluateType = int.Parse(row["EvaluateType"].ToString());
         }
     }
     return(model);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ZhongLi.Model.ServerUser_Evaluate GetModel(int ID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID", SqlDbType.Int, 4)
            };
            parameters[0].Value = ID;

            ZhongLi.Model.ServerUser_Evaluate model = new ZhongLi.Model.ServerUser_Evaluate();
            DataSet ds = DbHelperSQL.RunProcedure("ServerUser_Evaluate_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public bool Update(ZhongLi.Model.ServerUser_Evaluate model)
        {
            int rowsAffected = 0;

            SqlParameter[] parameters =
            {
                new SqlParameter("@ID",             SqlDbType.Int,         4),
                new SqlParameter("@SerUserID",      SqlDbType.Int,         4),
                new SqlParameter("@RealName",       SqlDbType.NVarChar,   50),
                new SqlParameter("@EvaluateCon",    SqlDbType.NVarChar,  500),
                new SqlParameter("@EvaluateTime",   SqlDbType.DateTime),
                new SqlParameter("@EvaluateUserID", SqlDbType.Int,         4),
                new SqlParameter("@EvaluateName",   SqlDbType.NVarChar,   50),
                new SqlParameter("@EvaLevel",       SqlDbType.Int,         4),
                new SqlParameter("@OrderID",        SqlDbType.Int,         4),
                new SqlParameter("@EvaluateType",   SqlDbType.Int, 4)
            };
            parameters[0].Value = model.ID;
            parameters[1].Value = model.SerUserID;
            parameters[2].Value = model.RealName;
            parameters[3].Value = model.EvaluateCon;
            parameters[4].Value = model.EvaluateTime;
            parameters[5].Value = model.EvaluateUserID;
            parameters[6].Value = model.EvaluateName;
            parameters[7].Value = model.EvaLevel;
            parameters[8].Value = model.OrderID;
            parameters[9].Value = model.EvaluateType;

            DbHelperSQL.RunProcedure("ServerUser_Evaluate_Update", parameters, out rowsAffected);
            if (rowsAffected > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }