Exemple #1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public MobileSoft.Model.HSPR.Tb_HSPR_ElegantDemeanor GetModel(long IID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@IID", SqlDbType.BigInt)
            };
            parameters[0].Value = IID;

            MobileSoft.Model.HSPR.Tb_HSPR_ElegantDemeanor model = new MobileSoft.Model.HSPR.Tb_HSPR_ElegantDemeanor();
            DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_HSPR_ElegantDemeanor_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["IID"].ToString() != "")
                {
                    model.IID = long.Parse(ds.Tables[0].Rows[0]["IID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CommID"].ToString() != "")
                {
                    model.CommID = int.Parse(ds.Tables[0].Rows[0]["CommID"].ToString());
                }
                model.ImageName = ds.Tables[0].Rows[0]["ImageName"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public void Update(MobileSoft.Model.HSPR.Tb_HSPR_ElegantDemeanor model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@IID",       SqlDbType.BigInt,   8),
                new SqlParameter("@CommID",    SqlDbType.Int,      4),
                new SqlParameter("@ImageName", SqlDbType.NVarChar, 50)
            };
            parameters[0].Value = model.IID;
            parameters[1].Value = model.CommID;
            parameters[2].Value = model.ImageName;

            DbHelperSQL.RunProcedure("Proc_Tb_HSPR_ElegantDemeanor_Update", parameters, out rowsAffected);
        }
Exemple #3
0
        /// <summary>
        ///  增加一条数据
        /// </summary>
        public long Add(MobileSoft.Model.HSPR.Tb_HSPR_ElegantDemeanor model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@IID",       SqlDbType.BigInt,   8),
                new SqlParameter("@CommID",    SqlDbType.Int,      4),
                new SqlParameter("@ImageName", SqlDbType.NVarChar, 50)
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = model.CommID;
            parameters[2].Value     = model.ImageName;

            DbHelperSQL.RunProcedure("Proc_Tb_HSPR_ElegantDemeanor_ADD", parameters, out rowsAffected);
            return((long)parameters[0].Value);
        }