/// <summary> /// 增加一条数据 /// </summary> public bool Add(ASRSME.Product.OutHouseRecordME model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into OutHouseRecord("); strSql.Append("count,productID,outHouseTime,houseID)"); strSql.Append(" values ("); strSql.Append("@count,@productID,@outHouseTime,@houseID)"); SqlParameter[] parameters = { new SqlParameter("@count", SqlDbType.Int,4), new SqlParameter("@productID", SqlDbType.NVarChar,50), new SqlParameter("@outHouseTime", SqlDbType.Timestamp,8), new SqlParameter("@houseID", SqlDbType.Int,4)}; parameters[0].Value = model.count; parameters[1].Value = model.productID; parameters[2].Value = model.outHouseTime; parameters[3].Value = model.houseID; int rows = DbHelperSQL.ExecuteSql(PubConstant.ConnectionStringProductDB, strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(ASRSME.Product.WarehouseViewME model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into WarehouseView("); strSql.Append("productID,name,Expr1,houseID,useStatus)"); strSql.Append(" values ("); strSql.Append("@productID,@name,@Expr1,@houseID,@useStatus)"); SqlParameter[] parameters = { new SqlParameter("@productID", SqlDbType.NVarChar,50), new SqlParameter("@name", SqlDbType.NVarChar,50), new SqlParameter("@Expr1", SqlDbType.NVarChar,50), new SqlParameter("@houseID", SqlDbType.Int,4), new SqlParameter("@useStatus", SqlDbType.TinyInt,1)}; parameters[0].Value = model.productID; parameters[1].Value = model.name; parameters[2].Value = model.Expr1; parameters[3].Value = model.houseID; parameters[4].Value = model.useStatus; int rows = DbHelperSQL.ExecuteSql(PubConstant.ConnectionStringProductDB, strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(ASRSME.Product.ProductME model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into Product("); strSql.Append("productID,name,process,param1,param2)"); strSql.Append(" values ("); strSql.Append("@productID,@name,@process,@param1,@param2)"); SqlParameter[] parameters = { new SqlParameter("@productID", SqlDbType.NVarChar,50), new SqlParameter("@name", SqlDbType.NVarChar,50), new SqlParameter("@process", SqlDbType.NVarChar,50), new SqlParameter("@param1", SqlDbType.Int,4), new SqlParameter("@param2", SqlDbType.Int,4)}; parameters[0].Value = model.productID; parameters[1].Value = model.name; parameters[2].Value = model.process; parameters[3].Value = model.param1; parameters[4].Value = model.param2; int rows = DbHelperSQL.ExecuteSql(PubConstant.ConnectionStringProductDB, strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(ASRSME.Product.OutHouseRecordME model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update OutHouseRecord set "); strSql.Append("count=@count,"); strSql.Append("productID=@productID,"); strSql.Append("houseID=@houseID"); strSql.Append(" where "); SqlParameter[] parameters = { new SqlParameter("@count", SqlDbType.Int,4), new SqlParameter("@productID", SqlDbType.NVarChar,50), new SqlParameter("@houseID", SqlDbType.Int,4)}; parameters[0].Value = model.count; parameters[1].Value = model.productID; parameters[2].Value = model.houseID; int rows = DbHelperSQL.ExecuteSql(PubConstant.ConnectionStringProductDB, strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(ASRSME.Product.WarehouseViewME model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update WarehouseView set "); strSql.Append("productID=@productID,"); strSql.Append("name=@name,"); strSql.Append("Expr1=@Expr1,"); strSql.Append("houseID=@houseID,"); strSql.Append("useStatus=@useStatus"); strSql.Append(" where "); SqlParameter[] parameters = { new SqlParameter("@productID", SqlDbType.NVarChar,50), new SqlParameter("@name", SqlDbType.NVarChar,50), new SqlParameter("@Expr1", SqlDbType.NVarChar,50), new SqlParameter("@houseID", SqlDbType.Int,4), new SqlParameter("@useStatus", SqlDbType.TinyInt,1)}; parameters[0].Value = model.productID; parameters[1].Value = model.name; parameters[2].Value = model.Expr1; parameters[3].Value = model.houseID; parameters[4].Value = model.useStatus; int rows = DbHelperSQL.ExecuteSql(PubConstant.ConnectionStringProductDB, strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(ASRSME.Product.ProductME model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update Product set "); strSql.Append("name=@name,"); strSql.Append("process=@process,"); strSql.Append("param1=@param1,"); strSql.Append("param2=@param2"); strSql.Append(" where productID=@productID "); SqlParameter[] parameters = { new SqlParameter("@name", SqlDbType.NVarChar,50), new SqlParameter("@process", SqlDbType.NVarChar,50), new SqlParameter("@param1", SqlDbType.Int,4), new SqlParameter("@param2", SqlDbType.Int,4), new SqlParameter("@productID", SqlDbType.NVarChar,50)}; parameters[0].Value = model.name; parameters[1].Value = model.process; parameters[2].Value = model.param1; parameters[3].Value = model.param2; parameters[4].Value = model.productID; int rows = DbHelperSQL.ExecuteSql(PubConstant.ConnectionStringProductDB, strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } }