Ejemplo n.º 1
0
        /// <summary>
        /// 绑定锁定数据
        /// </summary>
        private void BindGridLock(string p_StorgeID)
        {
            StorgeLockRule rule = new StorgeLockRule();

            //gridView1.GridControl.DataSource=rule.RShow(" AND WHID="+SysString.ToDBString(p_WHID)+" AND ItemCode="+SysString.ToDBString(p_ItemCode),ProcessGrid.GetQueryField(gridView1));
            gridView2.GridControl.DataSource = rule.RShow(" AND StorgeID=" + SysString.ToDBString(p_StorgeID), ProcessGrid.GetQueryField(gridView2));
            gridView2.GridControl.Show();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 解锁操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCancelLock_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this.FormListAID, this.FormListBID, RightSub.新增))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }
                if (saveLockID == 0)
                {
                    this.ShowMessage("请先查询要操作的记录");
                    return;
                }

                if (DialogResult.Yes != ShowConfirmMessage("解除锁定为不可恢复操作,确认要解除?"))
                {
                    return;
                }
                if (!NewCheckCorrect())
                {
                    return;
                }
                //if (!FCommon.RightCheck(this.FormID, this.FormListAID, this.FormListBID, RightSub.审核1))//不具有审核权限
                //{
                //    if (!CheckOPID(FParamConfig.LoginID, saveLockID))//检验是不是管理员 !Common.CheckAdmin(FParamConfig.LoginID) && !Common.CheckWHAdmin(FParamConfig.LoginID) &&
                //    {
                //        this.ShowMessage("你不是该单的业务员,不能操作该单据");
                //        return;
                //    }
                //}
                if (SysConvert.ToDecimal(txtLockQty.Text.Trim()) > SysConvert.ToDecimal(txtTotalLockQty.Text.Trim()))
                {
                    this.ShowMessage("解锁数量大于锁定数量,解锁失败");
                    txtLockQty.Focus();
                    return;
                }
                StorgeLockRule rule = new StorgeLockRule();
                rule.RUnLock(saveLockID, SysConvert.ToDecimal(txtLockQty.Text.Trim()), txtRemark.Text.Trim(), true);

                string tempwhid     = saveItemWHID;
                string tempitemcode = saveItemCode;
                string tempStorgeID = saveStorgeID.ToString();
                BindGrid();
                ProcessGrid.GridViewFocus(gridView1, new string[1] {
                    "ID"
                }, new string[1] {
                    tempStorgeID
                });
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 锁定库存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLockStorge_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this.FormListAID, this.FormListBID, RightSub.新增))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }
                if (saveStorgeID == 0)
                {
                    this.ShowMessage("请先查询要操作的记录");
                    return;
                }
                if (SysConvert.ToFloat(txtLockQty.Text.Trim()) > SysConvert.ToFloat(txtLeftQty.Text.Trim()))
                {
                    this.ShowMessage("锁定数量大于当前可使用数量,不能实现库存锁定");
                    return;
                }
                if (!NewCheckCorrect())
                {
                    return;
                }
                //if (!CheckCorrectLock())
                //{
                //    return;
                //}
                StorgeLockRule rule   = new StorgeLockRule();
                StorgeLock     entity = this.GetEntity();
                rule.RLock(entity, true);

                string tempwhid     = saveItemWHID;
                string tempitemcode = saveItemCode;
                string tempStorgeID = saveStorgeID.ToString();
                BindGrid();
                ProcessGrid.GridViewFocus(gridView1, new string[1] {
                    "ID"
                }, new string[1] {
                    tempStorgeID
                });
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }