コード例 #1
0
        protected void BtnUpdatePurchaseGroup_OnClick(object sender, EventArgs e)
        {
            var strCompanyId     = RCB_Company.SelectedValue;
            var strPurchaseGroup = RCB_PurchaseGroup.SelectedValue;

            if (string.IsNullOrEmpty(strCompanyId) || strCompanyId == Guid.Empty.ToString())
            {
                RAM.Alert("请选择供应商");
                return;
            }
            if (RG_PurchaseSet.SelectedItems.Count == 0)
            {
                RAM.Alert("请勾选商品");
                return;
            }
            var goodsIds = (from GridDataItem dataItem in RG_PurchaseSet.SelectedItems
                            let goodsId = new Guid(dataItem.GetDataKeyValue("GoodsId").ToString())
                                          let companyId = new Guid(dataItem.GetDataKeyValue("CompanyId").ToString())
                                                          where companyId == new Guid(strCompanyId)
                                                          select goodsId).ToList();

            if (goodsIds.Count == 0)
            {
                RAM.Alert("请选择相同供应商的商品");
                return;
            }

            string errorMessage;
            var    result = _purchaseSet.UpdatePurchaseSetToPurchaseGroupId(goodsIds, new Guid(strCompanyId), new Guid(strPurchaseGroup), out errorMessage);

            if (result > 0)
            {
                RG_PurchaseSet.Rebind();
            }
        }
コード例 #2
0
        /// <summary>禁用商品采购设置
        /// </summary>
        protected void OnClick_DisablePurchaseSet(object sender, EventArgs e)
        {
            var items = RG_PurchaseSet.SelectedItems;

            if (items.Count == 0)
            {
                RAM.Alert("系统提示:请先选择你需要【禁用】的商品采购设置!");
                return;
            }
            foreach (GridDataItem dataItem in RG_PurchaseSet.SelectedItems)
            {
                var goodsId     = new Guid(dataItem.GetDataKeyValue("GoodsId").ToString());
                var warehouseId = new Guid(dataItem["WarehouseId"].Text);
                var state       = Convert.ToInt32(dataItem.GetDataKeyValue("IsDelete").ToString());
                if (state == (int)State.Enable)
                {
                    _purchaseSet.NewDeletePurchaseSet(goodsId, warehouseId, State.Disable);
                    //报备管理禁用操作记录添加
                    var goodsInfo = _goodsCenterSao.GetGoodsBaseInfoById(goodsId);
                    if (goodsInfo != null)
                    {
                        var personnelInfo = CurrentSession.Personnel.Get();
                        WebControl.AddOperationLog(personnelInfo.PersonnelId, personnelInfo.RealName, goodsId, goodsInfo.GoodsCode,
                                                   OperationPoint.ReportManage.Disable.GetBusinessInfo(), string.Empty);
                    }
                }
            }
            RG_PurchaseSet.Rebind();
        }
コード例 #3
0
 protected void IbtnSearch_Click(object sender, ImageClickEventArgs e)
 {
     IsLoad            = false;
     Session["IsLoad"] = "0";
     RG_PurchaseSet.CurrentPageIndex = 0;
     RG_PurchaseSet.Rebind();
 }