public static void insert(PriceEntity price) { DbHelper.ExecuteNonQuery("p_Price_insert", price.CompanyId, price.AdminId, price.ProductId, price.Price, price.SellerPrice, price.Unit ); }
public static PriceEntity getByProduct(int productId, string businessnature) { DataRow dr = DbHelper.ExecuteDataRow("[p_Price_getByProductIdBusinessNature]", productId, businessnature); PriceEntity price = new PriceEntity(); if (dr != null) { price.PriceId = Convert.ToInt32(dr["priceId"]); price.CompanyId = Convert.ToInt32(dr["companyId"]); price.AdminId = Convert.ToInt32(dr["adminId"]); price.ProductId = productId; price.Price = Convert.ToDecimal(dr["price"]); price.SellerPrice = Convert.ToDecimal(dr["sellerPrice"]); price.Unit = dr["unit"].ToString(); price.InputDt = Convert.ToDateTime(dr["inputDt"]); } return price; }
public static void updateByProduct(PriceEntity pr) { Price.updateByProduct(pr); }
public static void updateByAdmin(PriceEntity pr) { Price.updateByAdmin(pr); }
public static void insert(PriceEntity pr) { Price.insert(pr); }
public static void updateByAdmin(PriceEntity price) { DbHelper.ExecuteNonQuery("p_Price_updateByAdmin", price.ProductId, price.Price, price.BusinessNature, price.AdminId ); }
public static void updateByProduct(PriceEntity price) { DbHelper.ExecuteNonQuery("p_Price_updateByProduct", price.CompanyId, price.ProductId, price.Price, price.SellerPrice, price.Unit ); }
//非自动加价商品,管理员修改价格 void updatePrice(int productId, string nature) { decimal price=0; foreach(RepeaterItem row in rpt_list.Items) { if (row.ItemType == ListItemType.AlternatingItem || row.ItemType == ListItemType.Item) { HiddenField hd = row.FindControl("hd_ItemProductId") as HiddenField; HiddenField hdNature = row.FindControl("hd_busNature") as HiddenField; if (hd.Value == productId.ToString() && hdNature.Value == nature) { TextBox txt_price = row.FindControl("txt_Price") as TextBox; price = Convert.ToDecimal(txt_price.Text); break; } } } PriceEntity pr = new PriceEntity(); pr.Price = price; pr.ProductId = productId; pr.BusinessNature = nature; pr.AdminId = logic.sysAdmin.AdminID; logic.price.updateByAdmin(pr); logic.buyerPriceHistory.insertByUpdateProduct(productId); //增加采购商历史价格 rptBind(); }