public void InitializeData() { Product_Centre pc = new Product_Centre(); // pc.initStock(); pc.InitializeData(50003); pc.InitializeDataNotfiling(50003); }
public string SetData(Model.Data_Centre.Link_Mid mid, int col, string authKey) { if (islogin(authKey)) { int x = 0; BLL.Data_Centre.Link_Mid bll = new BLL.Data_Centre.Link_Mid(); Product_Centre pc = new Product_Centre(); int spid = new BLL.Data_Centre.Link().GetSpid(mid.id, mid.iden); if (mid.PriceType == mid.StockType && mid.StockType == 1) { //删除库存和价格同时为最小单位的数据 if (bll.Exists(mid.id, mid.iden)) { if (bll.ExecuteNonQuery(string.Format("delete from link_mid where id={0} and iden={1}", mid.id, mid.iden)) > 0) { } } } else { if (bll.Exists(mid.id, mid.iden)) { //修改 if (bll.Update(mid)) { } } else { //新增 if (bll.Add(mid)) { } } } pc.UpdateStock(spid, mid.iden); new BLL.Data_Centre.Price().Updates((string)pc.ExecuteScalar("SELECT t_id FROM dbo.Link WHERE id=" + mid.id)); } return(""); }