Ejemplo n.º 1
0
 /// <summary>
 /// 修改CPS信息.
 /// </summary>
 /// <param name="cps">
 /// Cps对象实例.
 /// </param>
 public void Modify(Cps cps)
 {
     this.cpsDA.Update(cps);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 添加CPS信息.
        /// </summary>
        /// <param name="cps">
        /// The cps.
        /// </param>
        /// <returns>
        /// The <see cref="int"/>.
        /// </returns>
        public int Insert(Cps cps)
        {
            if (cps == null)
            {
                throw new ArgumentNullException("cps");
            }

            var parameters = new List<SqlParameter>
                                 {
                                     this.SqlServer.CreateSqlParameter(
                                         "Name",
                                         SqlDbType.NVarChar,
                                         cps.Name,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "UserName",
                                         SqlDbType.NVarChar,
                                         cps.UserName,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "URL",
                                         SqlDbType.NVarChar,
                                         cps.URL,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Linkman",
                                         SqlDbType.NVarChar,
                                         cps.Linkman,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Mobile",
                                         SqlDbType.VarChar,
                                         cps.Mobile,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Tel",
                                         SqlDbType.VarChar,
                                         cps.Tel,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Email",
                                         SqlDbType.VarChar,
                                         cps.Email,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "QQ",
                                         SqlDbType.VarChar,
                                         cps.QQ,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Company",
                                         SqlDbType.NVarChar,
                                         cps.Company,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "CompanyAddress",
                                         SqlDbType.NVarChar,
                                         cps.CompanyAddress,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "ZipCode",
                                         SqlDbType.VarChar,
                                         cps.ZipCode,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "TrackingURL",
                                         SqlDbType.VarChar,
                                         cps.TrackingURL,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "CreateTime",
                                         SqlDbType.DateTime,
                                         cps.CreateTime,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "ReferenceID",
                                         SqlDbType.Int,
                                         null,
                                         ParameterDirection.Output)
                                 };

            this.SqlServer.ExecuteNonQuery(CommandType.StoredProcedure, "sp_Cps_Insert", parameters, null);
            return (int)parameters.Find(parameter => parameter.ParameterName == "ReferenceID").Value;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 添加CPS信息.
 /// </summary>
 /// <param name="cps">
 /// Cps的对象实例.
 /// </param>
 /// <returns>
 /// 编号.
 /// </returns>
 public int AddCps(Cps cps)
 {
     return this.cpsDA.Insert(cps);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 更新Cps信息.
        /// </summary>
        /// <param name="cps">
        /// Cps的对象实例.
        /// </param>
        public void Update(Cps cps)
        {
            if (cps == null)
            {
                throw new ArgumentNullException("cps");
            }

            var parameters = new List<SqlParameter>
                                 {
                                     this.SqlServer.CreateSqlParameter(
                                         "ID",
                                         SqlDbType.NVarChar,
                                         cps.ID,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Name",
                                         SqlDbType.NVarChar,
                                         cps.Name,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "UserName",
                                         SqlDbType.NVarChar,
                                         cps.UserName,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "URL",
                                         SqlDbType.NVarChar,
                                         cps.URL,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Linkman",
                                         SqlDbType.NVarChar,
                                         cps.Linkman,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Mobile",
                                         SqlDbType.VarChar,
                                         cps.Mobile,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Tel",
                                         SqlDbType.VarChar,
                                         cps.Tel,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Email",
                                         SqlDbType.VarChar,
                                         cps.Email,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "QQ",
                                         SqlDbType.VarChar,
                                         cps.QQ,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Company",
                                         SqlDbType.NVarChar,
                                         cps.Company,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "CompanyAddress",
                                         SqlDbType.NVarChar,
                                         cps.CompanyAddress,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "ZipCode",
                                         SqlDbType.VarChar,
                                         cps.ZipCode,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "TrackingURL",
                                         SqlDbType.VarChar,
                                         cps.TrackingURL,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "CreateTime",
                                         SqlDbType.DateTime,
                                         cps.CreateTime,
                                         ParameterDirection.Input),
                                 };

            this.SqlServer.ExecuteNonQuery(CommandType.StoredProcedure, "sp_Cps_Update", parameters, null);
        }