//是否缺货 protected void ccb_IsStockScarcity_CheckedChanged(object sender, EventArgs e) { var ccb = sender as ConfirmCheckBox; if (ccb != null) { var item = ccb.Parent.Parent as GridDataItem; if (item != null) { var goodsId = new Guid(item.GetDataKeyValue("GoodsId").ToString()); var isScarcity = ccb.Checked; try { string errorMsg; var personnel = CurrentSession.Personnel.Get(); var result = _goodsCenterSao.SetGoodsIsScarcity(goodsId, isScarcity, personnel.RealName, personnel.PersonnelId, out errorMsg); if (result) { new LogUtility().WriteException(isScarcity ? new Exception("非异常,记录缺货!") : new Exception("非异常,记录不缺货!"), goodsId.ToString()); RG_Goods.Rebind(); } else { MessageBox.Show(this, "设置商品是否缺货失败!" + errorMsg); } } catch { MessageBox.Show(this, "设置商品是否缺货失败!"); } } } }
//是否上下架 protected void ccb_IsOnShelf_CheckedChanged(object sender, EventArgs e) { var ccb = sender as ConfirmCheckBox; if (ccb != null) { var item = ccb.Parent.Parent as GridDataItem; if (item != null) { var goodsId = new Guid(item.GetDataKeyValue("GoodsId").ToString()); bool isOnShelf = ccb.Checked; string errorManage; try { var personnel = CurrentSession.Personnel.Get(); var result = _goodsCenterSao.SetPurchaseState(goodsId, isOnShelf, personnel.RealName, personnel.PersonnelId, out errorManage); if (result) { RG_Goods.Rebind(); } else { MessageBox.Show(this, "设置商品是否上架失败!" + errorManage); } } catch { MessageBox.Show(this, "设置商品是否上架失败!"); } } } }
//选择商品分类 protected void TvGoodsClassNodeClick(object sender, RadTreeNodeEventArgs e) { Hid_GoodsClassId.Value = Guid.Empty.ToString(); if (!string.IsNullOrEmpty(e.Node.Value)) { Hid_GoodsClassId.Value = e.Node.Value; RG_Goods.CurrentPageIndex = 0; RG_Goods.Rebind(); tree_GoodsClass.Attributes.CssStyle.Value = "display:\"\";"; } Hid_TreeToggle.Value = "1"; }