public List <VAppendStockDetail> getListByAppendID(string AppendID) { string s = ""; SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@AppendID", SqlDbType.NVarChar) }; parameters[0].Value = AppendID; List <VAppendStockDetail> list = new List <VAppendStockDetail>(); SqlDataReader reader = SQLHelper.RunProcedure("p_AppendStockDetail_getListByAppendID", parameters); while (reader.Read()) { VAppendStockDetail item = new VAppendStockDetail(); item.DetailID = reader.GetInt32(reader.GetOrdinal("DetailID")); item.AppendID = reader.GetString(reader.GetOrdinal("AppendID")); item.Description = reader.GetString(reader.GetOrdinal("Description")); s = reader.GetValue(reader.GetOrdinal("Price")).ToString(); item.Price = float.Parse(s); item.ProductsID = reader.GetInt32(reader.GetOrdinal("ProductsID")); item.ProductsName = reader.GetString(reader.GetOrdinal("ProductsName")); item.Quantity = reader.GetInt32(reader.GetOrdinal("Quantity")); item.SupplierID = reader.GetInt32(reader.GetOrdinal("SupplierID")); item.SupplierName = reader.GetString(reader.GetOrdinal("SupplierName")); list.Add(item); } reader.Close(); return(list); }
/// <summary> /// 加载全部 /// </summary> /// <param name="ReceiptOrderID"></param> protected void loadinit(string AppendID) { List <VAppendStockDetail> list = new List <VAppendStockDetail>(); list = Leyp.SQLServerDAL.Stock.Factory.getAppendStockDetailDAL().getListByAppendID(AppendID); StringBuilder sb = new StringBuilder(); sb.Append("<table class=\"flexme2\"><thead><tr><th width=\"70\">操作</th><th width=\"80\">商品编号</th><th width=\"100\">商品名称</th><th width=\"90\">供应商</th><th width=\"80\">数量 </th><th width=\"80\">采购额</th><th width=\"100\">金额 </th></tr>"); sb.Append(" </thead><tbody>"); for (int i = 0; i < list.Count; i++) { VAppendStockDetail v = new VAppendStockDetail(); v = list[i]; sb.Append("<tr><td > <img src=\"../images/tbtn_delete.gif\" onclick=\"javascript:if(!confirm('您确定要删除吗'))return false;deleteDetail(" + v.DetailID + ")\"; /> </td>"); sb.Append(" <td>" + v.ProductsID + "</td>"); sb.Append(" <td>" + v.ProductsName + "</td>"); sb.Append(" <td>" + v.SupplierName + "</td>"); sb.Append(" <td>" + v.Quantity + "</td>"); sb.Append(" <td>" + v.Price.ToString() + "</td>"); sb.Append(" <td>" + v.Quantity * v.Price + "</td>"); sb.Append("</tr>"); } sb.Append("</tbody></table>"); Response.Write(sb.ToString()); Response.End(); }
public VAppendStockDetail getByID(int DetailID) { string s = ""; VAppendStockDetail detail = new VAppendStockDetail(); SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@DetailID", SqlDbType.Int) }; parameters[0].Value = DetailID; SqlDataReader reader = SQLHelper.RunProcedure("p_AppendStockDetail_getByID", parameters); if (reader.Read()) { detail.DetailID = reader.GetInt32(reader.GetOrdinal("DetailID")); detail.AppendID = reader.GetString(reader.GetOrdinal("AppendID")); detail.Description = reader.GetString(reader.GetOrdinal("Description")); s = reader.GetValue(reader.GetOrdinal("Price")).ToString(); detail.Price = float.Parse(s); detail.ProductsID = reader.GetInt32(reader.GetOrdinal("ProductsID")); detail.ProductsName = reader.GetString(reader.GetOrdinal("ProductsName")); detail.Quantity = reader.GetInt32(reader.GetOrdinal("Quantity")); detail.SupplierID = reader.GetInt32(reader.GetOrdinal("SupplierID")); detail.SupplierName = reader.GetString(reader.GetOrdinal("SupplierName")); } return(detail); }