/// <summary> /// 新增行 /// </summary> /// <param name="model"></param> /// <returns></returns> public int InsertItem(GoodsMovementItem model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into GoodsMovementItem("); strSql.Append("GoodsMovementItemID,GoodsMovementID,MaterialID,TargInpQty,ActInpQty,RecUnitID,TargOutQty,ActOutQty,IssUnitID,InpPlaPrice,InpPlaValue,InpActPrice,InpActValue,OutPlaPrice,OutPlaValue,OutActPrice,OutActValue,ReturnQuantity,Remark)"); strSql.Append(" values ("); strSql.Append("@GoodsMovementItemID,@GoodsMovementID,@MaterialID,@TargInpQty,@ActInpQty,@RecUnitID,@TargOutQty,@ActOutQty,@IssUnitID,@InpPlaPrice,@InpPlaValue,@InpActPrice,@InpActValue,@OutPlaPrice,@OutPlaValue,@OutActPrice,@OutActValue,@ReturnQuantity,@Remark)"); SqlParameter[] parameters = { new SqlParameter("@GoodsMovementItemID", SqlDbType.VarChar, 36), new SqlParameter("@GoodsMovementID", SqlDbType.VarChar, 36), new SqlParameter("@MaterialID", SqlDbType.VarChar, 36), new SqlParameter("@TargInpQty", SqlDbType.Decimal, 13), new SqlParameter("@ActInpQty", SqlDbType.Decimal, 13), new SqlParameter("@RecUnitID", SqlDbType.VarChar, 36), new SqlParameter("@TargOutQty", SqlDbType.Decimal, 13), new SqlParameter("@ActOutQty", SqlDbType.Decimal, 13), new SqlParameter("@IssUnitID", SqlDbType.VarChar, 36), new SqlParameter("@InpPlaPrice", SqlDbType.Decimal, 13), new SqlParameter("@InpPlaValue", SqlDbType.Decimal, 13), new SqlParameter("@InpActPrice", SqlDbType.Decimal, 13), new SqlParameter("@InpActValue", SqlDbType.Decimal, 13), new SqlParameter("@OutPlaPrice", SqlDbType.Decimal, 13), new SqlParameter("@OutPlaValue", SqlDbType.Decimal, 13), new SqlParameter("@OutActPrice", SqlDbType.Decimal, 13), new SqlParameter("@OutActValue", SqlDbType.Decimal, 13), new SqlParameter("@ReturnQuantity", SqlDbType.Decimal, 13), new SqlParameter("@Remark", SqlDbType.VarChar, 1024) }; parameters[0].Value = model.GoodsMovementItemID; parameters[1].Value = model.GoodsMovementID; parameters[2].Value = model.MaterialID; parameters[3].Value = model.TargInpQty; parameters[4].Value = model.ActInpQty; parameters[5].Value = model.RecUnitID; parameters[6].Value = model.TargOutQty; parameters[7].Value = model.ActOutQty; parameters[8].Value = model.IssUnitID; parameters[9].Value = model.InpPlaPrice; parameters[10].Value = model.InpPlaValue; parameters[11].Value = model.InpActPrice; parameters[12].Value = model.InpActValue; parameters[13].Value = model.OutPlaPrice; parameters[14].Value = model.OutPlaValue; parameters[15].Value = model.OutActPrice; parameters[16].Value = model.OutActValue; parameters[17].Value = model.ReturnQuantity; parameters[18].Value = model.Remark; return(DBAccess.ExecuteNonQuery(DB.Type, DB.ConnectionString, CommandType.Text, strSql.ToString(), parameters)); }
/// <summary> /// 新增行 /// </summary> /// <param name="model"></param> /// <returns></returns> public int InsertItem(GoodsMovementItem model) { return(iGoodsMovementItemDAL.InsertItem(model)); }