Example #1
0
        /// <summary>
        /// 修改需求
        /// </summary>
        /// <param name="requestform"></param>
        /// <returns></returns>
        public bool UpdateProductDemand(ProductDemandTable productdemand)
        {
            var sql  = @"UPDATE ProductDemandTable SET 
DemandID=@DemandID,
DemandName=@DemandName,
DemandModify=@DemandModify,
DemandPurpose=@DemandPurpose,
Priority=@Priority,
ProductID=@ProductID,
ChangeTime=@ChangeTime,
VersionNumber=@VersionNumber
WHERE ID=@id";
            var par1 = new SqlParameter()
            {
                ParameterName = "@DemandID", SqlDbType = System.Data.SqlDbType.VarChar, Value = productdemand.DemandID
            };
            var par2 = new SqlParameter()
            {
                ParameterName = "@DemandName", SqlDbType = System.Data.SqlDbType.Text, Value = productdemand.DemandName
            };
            var par3 = new SqlParameter()
            {
                ParameterName = "@DemandModify", SqlDbType = System.Data.SqlDbType.VarChar, Value = productdemand.DemandModify
            };
            var par4 = new SqlParameter()
            {
                ParameterName = "@DemandPurpose", SqlDbType = System.Data.SqlDbType.VarChar, Value = productdemand.DemandPurpose
            };
            var par5 = new SqlParameter()
            {
                ParameterName = "@Priority", SqlDbType = System.Data.SqlDbType.VarChar, Value = productdemand.Priority
            };
            var par6 = new SqlParameter()
            {
                ParameterName = "@ProductID", SqlDbType = System.Data.SqlDbType.Text, Value = productdemand.ProductID
            };
            var par7 = new SqlParameter()
            {
                ParameterName = "@ChangeTime", SqlDbType = System.Data.SqlDbType.Int, Value = productdemand.ChangeTime
            };
            var par8 = new SqlParameter()
            {
                ParameterName = "@VersionNumber", SqlDbType = System.Data.SqlDbType.VarChar, Value = productdemand.VersionNumber
            };
            var par = new SqlParameter()
            {
                ParameterName = "@id", SqlDbType = System.Data.SqlDbType.Int, Value = productdemand.ID
            };

            return(_dbHelper.SavaData(sql, par1, par2, par3, par4, par5, par6, par7, par8, par) > 0 ? true : false);
        }
Example #2
0
        /// <summary>
        ///添加产品需求表
        /// </summary>
        /// <param name="productdemand">产品需求添加信息</param>
        /// <returns></returns>
        public bool InsertProductDemand(ProductDemandTable productdemand)
        {
            var sql = "insert into ProductDemandTable (DemandID,DemandName,DemandModify,DemandPurpose,Priority,ProductID,ChangeTime,VersionNumber) values(@DemandID,@DemandName,@DemandModify,@DemandPurpose,@Priority,@ProductID,@ChangeTime,@VersionNumber)";
            var par = new SqlParameter()
            {
                ParameterName = "@DemandID", SqlDbType = System.Data.SqlDbType.Int, Value = productdemand.DemandID
            };
            var par2 = new SqlParameter()
            {
                ParameterName = "@DemandName", SqlDbType = System.Data.SqlDbType.VarChar, Value = productdemand.DemandName
            };
            var par3 = new SqlParameter()
            {
                ParameterName = "@DemandModify", SqlDbType = System.Data.SqlDbType.Text, Value = productdemand.DemandModify
            };
            var par4 = new SqlParameter()
            {
                ParameterName = "@DemandPurpose", SqlDbType = System.Data.SqlDbType.VarChar, Value = productdemand.DemandPurpose
            };
            var par5 = new SqlParameter()
            {
                ParameterName = "@Priority", SqlDbType = System.Data.SqlDbType.VarChar, Value = productdemand.Priority
            };
            var par6 = new SqlParameter()
            {
                ParameterName = "@ProductID", SqlDbType = System.Data.SqlDbType.Int, Value = productdemand.ProductID
            };
            var par7 = new SqlParameter()
            {
                ParameterName = "@ChangeTime", SqlDbType = System.Data.SqlDbType.DateTime, Value = productdemand.ChangeTime
            };
            var par8 = new SqlParameter()
            {
                ParameterName = "@VersionNumber", SqlDbType = System.Data.SqlDbType.VarChar, Value = productdemand.VersionNumber
            };

            return(_dbHelper.SavaData(sql, par, par2, par3, par4, par5, par6, par7, par8) > 0 ? true : false);
        }