public static string CancelInstore(int purchaseDetailId, int productId, int?cancelQuantity) { if (cancelQuantity == null) { cancelQuantity = 0; } InstoreBll bll = new InstoreBll(); //判断此商品的库存量是否大于取消入库的数量,如果库存量大于取消入库的数量,则此商品未出库,可以取消入库。反之,则不能取消入库。 int leftQuantity = bll.GetProductLeftQuantity(productId); if (leftQuantity >= cancelQuantity) { bll.DeleteByPurchaseDetailId(purchaseDetailId); return("true"); } else { return("false"); } }
protected void btnDel_Click(object sender, EventArgs e) { object[] arguments = ((LinkButton)sender).CommandArgument.Split(';'); int id = Convert.ToInt32(arguments[0]);//inStore_id int productId = Convert.ToInt32(arguments[2]); int quantity = Convert.ToInt32(arguments[1]); InstoreBll bll = new InstoreBll(); //判断此商品的库存量是否大于取消入库的数量,如果库存量大于取消入库的数量,则此商品未出库,可以取消入库。反之,则不能取消入库。 int leftQuantity = bll.GetProductLeftQuantity(productId); if (leftQuantity >= quantity) { bll.DeleteById(id); GridDataBind(); } else { Common.Alert("此入库单已经出库不能删除!", this); } }
public static void SaveWareHouseDate(int id, string date) { InstoreBll bll = new InstoreBll(); bll.SaveInWareHouse(id, Common.ConvertToDBValue(date), null, ((User)HttpContext.Current.Session["User"]).UserName); }
protected void btn_submit_ServerClick(object sender, EventArgs e) { InstoreBll bll = new InstoreBll(); bll.SaveInWareHouse(Convert.ToInt32(txt_id.Value), Common.ConvertToDBValue(txt_outStoreTime.Value), Convert.ToInt32(txt_inStore.Value), ((User)HttpContext.Current.Session["User"]).UserName); }