示例#1
0
        private NZDecimal GetOnHandQty()
        {
            NZDecimal dOnHandQty = new NZDecimal();

            try
            {
                IssueByItemUIDM uidm = dmcIssueByItem.SaveData(new IssueByItemUIDM());
                if (uidm.ITEM_CD.IsNull || uidm.FROM_LOC_CD.IsNull)
                {
                    return(new NZDecimal());
                }
                IssueConsumptionController ctlIssue = new IssueConsumptionController();
                dOnHandQty = ctlIssue.GetOnHandQty(uidm);
                if (dOnHandQty.IsNull)
                {
                    return(new NZDecimal());
                }
                return(dOnHandQty);
            }
            catch (Exception ex)
            {
                MessageDialog.ShowBusiness(this, ex.Message);
            }
            return(new NZDecimal());
        }
示例#2
0
        private void OnDelete()
        {
            try
            {
                if (shtView.Rows.Count == 0)
                {
                    return;
                }
                if (shtView.ActiveRowIndex < 0)
                {
                    return;
                }

                // show confirm message
                MessageDialogResult dr = MessageDialog.ShowConfirmation(this, new EVOFramework.Message(Messages.eConfirm.CFM9002.ToString()), MessageDialogButtons.YesNo);
                if (dr != MessageDialogResult.Yes)
                {
                    return;
                }

                IssueConsumptionController ctl = new IssueConsumptionController();
                NZString TransID       = new NZString(null, shtView.Cells[shtView.ActiveRowIndex, (int)eColView.ISSUE_NO].Value);
                NZString RefNo         = new NZString(null, shtView.Cells[shtView.ActiveRowIndex, (int)eColView.REF_NO].Value);
                NZString ConsumptionID = ctl.GetConsumptionTransID(TransID);

                ctl.DeleteTransaction(TransID, RefNo, ConsumptionID);

                shtView.RemoveRows(shtView.ActiveRowIndex, 1);
                //LoadData();
            }
            catch (BusinessException err)
            {
                MessageDialog.ShowBusiness(this, err.Error.Message);
                err.Error.FocusOnControl();
            }
            catch (ValidateException err)
            {
                MessageDialog.ShowBusiness(this, err.ErrorResults[0].Message);
                err.ErrorResults[0].FocusOnControl();
            }
            catch (Exception err)
            {
                MessageDialog.ShowBusiness(this, err.Message);
            }
        }
示例#3
0
        private bool SaveData()
        {
            try
            {
                IssueConsumptionController ctlIssue  = new IssueConsumptionController();
                IssueByItemUIDM            uidmIssue = dmcIssueByItem.SaveData(new IssueByItemUIDM());

                switch (m_Mode)
                {
                case eSaveMode.ADD:
                    ctlIssue.SaveAddIssue(uidmIssue);
                    break;

                case eSaveMode.UPDATE:
                    uidmIssue.REF_NO.Value = m_REF_NO;
                    uidmIssue.LOT_NO.Value = txtLotNo.Text;
                    ctlIssue.SaveUpdateIssue(uidmIssue);
                    break;
                }
                return(true);
            }
            catch (ValidateException err)
            {
                for (int i = 0; i < err.ErrorResults.Count; i++)
                {
                    MessageDialog.ShowBusiness(this, err.ErrorResults[i].Message.MessageDescription);
                    err.ErrorResults[i].FocusOnControl();
                }
            }
            catch (BusinessException err)
            {
                MessageDialog.ShowBusiness(this, err.Error.Message.MessageDescription);
                err.Error.FocusOnControl();
            }
            catch (Exception ex)
            {
                MessageDialog.ShowBusiness(this, ex.Message);
            }
            return(false);
        }