예제 #1
0
        private void cashBlotterBindingSource_CurrentChanged(object sender, EventArgs e)
        {
            try
            {
                CLAS.CashBlotterRow cbr = CurrentRow();

                if (cbr == null)
                {
                    return;
                }


                if (cbr.IsNull("CashBlotterID"))
                {
                    return;
                }

                loadCBDetailData();
                ApplySecurity(cbr);
                ApplyRowBR();
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }
예제 #2
0
        private void ApplyRowBR()
        {
            bool noDetailRow = false;

            CLAS.CashBlotterRow cbr = CurrentRow();
            if (cbr.GetCBDetailRows().Length == 0)
            {
                noDetailRow = true;
            }

            //CLAS.CBDetailRow cbdr = CurrentDetailRow();
            //f (cbdr == null)
            //    noDetailRow = true;

            bool noAccess = (FM.AtMng.SecurityManager.CanExecute(0, atSecurity.SecurityManager.Features.Atrium) == atSecurity.SecurityManager.ExPermissions.No);

            if (noDetailRow || (!cbr.IsNull("FirstConfirm") && !cbr.IsNull("SecondConfirm")) || noAccess) //CB Processed; is Final
            {
                tsProcessFirst.Enabled  = Janus.Windows.UI.InheritableBoolean.False;
                tsProcessSecond.Enabled = Janus.Windows.UI.InheritableBoolean.False;
                cmdProcessCB.Enabled    = Janus.Windows.UI.InheritableBoolean.False;

                tsSave.Enabled   = Janus.Windows.UI.InheritableBoolean.False;
                tsDelete.Enabled = Janus.Windows.UI.InheritableBoolean.False;
                valuableAmountNumericEditBox.ReadOnly  = true;
                valuableAmountNumericEditBox.BackColor = SystemColors.Control;
                valuableDateCalendarCombo.ReadOnly     = true;
                valuableDateCalendarCombo.BackColor    = SystemColors.Control;
                valuableTypeComboBox.ReadOnly          = true;
                currencyCodeComboBox.ReadOnly          = true;
                statusCodeComboBox.ReadOnly            = true;
                natureOfPaymentComboBox.ReadOnly       = true;
                paymentSourceComboBox.ReadOnly         = true;
                commentsEditBox.ReadOnly  = true;
                commentsEditBox.BackColor = SystemColors.Control;
            }
            else
            {
                cmdProcessCB.Enabled = Janus.Windows.UI.InheritableBoolean.True;
                if (!cbr.IsNull("FirstConfirm"))
                {
                    tsProcessFirst.Enabled  = Janus.Windows.UI.InheritableBoolean.False;
                    tsProcessSecond.Enabled = Janus.Windows.UI.InheritableBoolean.True;
                }
                else
                {
                    tsProcessFirst.Enabled  = Janus.Windows.UI.InheritableBoolean.True;
                    tsProcessSecond.Enabled = Janus.Windows.UI.InheritableBoolean.False;
                }

                tsSave.Enabled   = Janus.Windows.UI.InheritableBoolean.True;
                tsDelete.Enabled = Janus.Windows.UI.InheritableBoolean.True;

                valuableAmountNumericEditBox.ReadOnly  = false;
                valuableAmountNumericEditBox.BackColor = SystemColors.Window;
                valuableDateCalendarCombo.ReadOnly     = false;
                valuableDateCalendarCombo.BackColor    = SystemColors.Window;
                valuableTypeComboBox.ReadOnly          = false;
                currencyCodeComboBox.ReadOnly          = false;
                statusCodeComboBox.ReadOnly            = false;
                natureOfPaymentComboBox.ReadOnly       = false;
                paymentSourceComboBox.ReadOnly         = false;
                commentsEditBox.ReadOnly  = false;
                commentsEditBox.BackColor = SystemColors.Window;
            }
        }