Esempio n. 1
0
        private void fpView_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                bool isClickOnCell = false;

                CellRange cellRange = fpMovePartList.GetCellFromPixel(0, 0, e.X, e.Y);
                if (cellRange.Column != -1 && cellRange.Row != -1)
                {
                    shtMovePartList.SetActiveCell(cellRange.Row, cellRange.Column);
                    shtMovePartList.AddSelection(cellRange.Row, cellRange.Column, 1, 1);
                    isClickOnCell = true;
                }

                if (isClickOnCell)
                {
                    NZString transID         = new NZString(null, shtMovePartList.Cells[cellRange.Row, (int)eColView.TRANS_ID_FROM].Value);
                    bool     canEditOrDelete = m_transactionValidator.TransactionCanEditOrDelete(transID);

                    miDelete.Enabled      = canEditOrDelete && ActivePermission.Delete;
                    miDeleteGroup.Enabled = canEditOrDelete && ActivePermission.Delete;
                    miEdit.Enabled        = canEditOrDelete && ActivePermission.Edit;
                }
                else
                {
                    miDelete.Enabled      = false;
                    miDeleteGroup.Enabled = false;
                    miEdit.Enabled        = false;
                }

                ctxMenu.Show(fpMovePartList, e.Location);
            }
        }
Esempio n. 2
0
        private bool CheckCanEditOrDelete(int row)
        {
            if (shtPackingList.RowCount <= 0)
            {
                return(false);
            }
            NZString transID         = new NZString(null, shtPackingList.Cells[row, (int)eColView.TRANS_ID].Value);
            bool     canEditOrDelete = m_transactionValidator.TransactionCanEditOrDelete(transID);

            if (canEditOrDelete)
            {
                //Unpack Cannot Delete and Modify
                InventoryTransBIZ       biz = new InventoryTransBIZ();
                InventoryTransactionDTO dto = biz.LoadByTransactionID(transID);
                if (dto != null)
                {
                    if (DataDefine.Convert2ClassCode(DataDefine.eTRANS_TYPE.Unpack).Equals(dto.TRANS_CLS.StrongValue) ||
                        DataDefine.Convert2ClassCode(DataDefine.eTRANS_TYPE.Unpack_Consumption).Equals(dto.TRANS_CLS.StrongValue)
                        )
                    {
                        canEditOrDelete = false;
                    }
                }
            }

            return(canEditOrDelete);
        }
Esempio n. 3
0
        private void fpView_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                bool isClickOnCell = false;

                CellRange cellRange = fpDelivery.GetCellFromPixel(0, 0, e.X, e.Y);
                if (cellRange.Column != -1 && cellRange.Row != -1)
                {
                    shtDelivery.SetActiveCell(cellRange.Row, cellRange.Column);
                    shtDelivery.AddSelection(cellRange.Row, cellRange.Column, 1, 1);
                    isClickOnCell = true;
                }

                if (isClickOnCell)
                {
                    //NZString transID = new NZString(null,this.shtDelivery.Cells[cellRange.Row, (int)eColView.TRANS_ID].Value);
                    //bool canEditOrDelete = m_transactionValidator.TransactionCanEditOrDelete(transID);

                    //if (Convert.ToDecimal(shtDelivery.GetValue(cellRange.Row, (int)eColView.RETURN_QTY)) > 0)
                    //{
                    //    miDeletePack.Enabled = false;
                    //    miDeleteOrder.Enabled = false;
                    //    miDeleteGroup.Enabled = false;
                    //}
                    //else
                    //{
                    //    miDeletePack.Enabled = canEditOrDelete && ActivePermission.Delete;
                    //    miDeleteOrder.Enabled = canEditOrDelete && ActivePermission.Delete;
                    //    miDeleteGroup.Enabled = canEditOrDelete && ActivePermission.Delete;
                    //}

                    //miEdit.Enabled = canEditOrDelete && ActivePermission.Edit;

                    NZString transID         = new NZString(null, this.shtDelivery.Cells[cellRange.Row, (int)eColView.TRANS_ID].Value);
                    bool     canEditOrDelete = m_transactionValidator.TransactionCanEditOrDelete(transID);

                    miEdit.Enabled          = canEditOrDelete && ActivePermission.Edit;
                    miDeletePack.Enabled    = canEditOrDelete && ActivePermission.Delete;
                    miDeleteOrder.Enabled   = canEditOrDelete && ActivePermission.Delete;
                    miDeleteGroup.Enabled   = canEditOrDelete && ActivePermission.Delete;
                    miExportInvoice.Enabled = canEditOrDelete && ActivePermission.View;
                }
                else
                {
                    miEdit.Enabled          = false;
                    miDeletePack.Enabled    = false;
                    miDeleteOrder.Enabled   = false;
                    miDeleteGroup.Enabled   = false;
                    miExportInvoice.Enabled = false;
                }

                ctxMenu.Show(fpDelivery, e.Location);
            }
        }
Esempio n. 4
0
        private void InitializeScreenMode()
        {
            if (m_editTransactionID == null)
            {
                SetScreenMode(eScreenMode.ADD);

                AdjustmentEntryUIDM model = new AdjustmentEntryUIDM();
                model.TransactionID.Value = "";
                dmcAdjust.LoadData(model);

                SysConfigBIZ sysBiz        = new SysConfigBIZ();
                SysConfigDTO argScreenInfo = new SysConfigDTO();
                argScreenInfo.SYS_GROUP_ID = DataDefine.eSYSTEM_CONFIG.TRN120.SYS_GROUP_ID;
                argScreenInfo.SYS_KEY      = (NZString)DataDefine.eSYSTEM_CONFIG.TRN120.SYS_KEY.DEFAULT_DATE.ToString();
                dtAdjustDate.Value         = sysBiz.GetDefaultDateForScreen(argScreenInfo);
            }
            else
            {
                bool bCanEdit = m_transactionValidator.TransactionCanEditOrDelete(m_editTransactionID);

                if (bCanEdit)
                {
                    SetScreenMode(eScreenMode.EDIT);
                }
                else
                {
                    SetScreenMode(eScreenMode.VIEW);
                }


                AdjustmentEntryUIDM model = m_controller.LoadData(m_editTransactionID);
                //if (model.AdjustType.StrongValue == DataDefine.Convert2ClassCode(DataDefine.eIN_OUT_CLASS.Out)) {
                //    model.OnHandQty.Value = model.OnHandQty.StrongValue + model.AdjustQty.StrongValue;
                //}

                dmcAdjust.LoadData(model);
                LoadInventoryUM(model.ItemCode);
                UpdateOnhandQtyText();
            }
        }
Esempio n. 5
0
        private bool CheckIssueDate(NZString TranID)
        {
            TransactionValidator val = new TransactionValidator();

            return(val.TransactionCanEditOrDelete(TranID));
        }