コード例 #1
0
        public static void btnCopy_OnClickStep(IQuoteDetails form, EventArgs args)
        {
            var copyFromQuote = form.CurrentEntity as IQuote;
            var newQuote      = EntityFactory.Create <IQuote>();

            if (copyFromQuote == null)
            {
                return;
            }
            var quoteId = copyFromQuote.CopyQuote(newQuote);

            MySlx.MainView.Show <IQuote>(quoteId);
        }
        public static void OnLoad1Step(IQuoteDetails form, EventArgs args)
        {
            var quote = form.CurrentEntity as IQuote;

            if (quote == null)
            {
                return;
            }
            form.lueAccount.IsReadOnly = !string.IsNullOrEmpty(quote.ErpExtId);
            var closed = quote.IsClosed();

            form.txtQuoteId.IsReadOnly         = closed;
            form.lueAccount.IsReadOnly         = closed;
            form.lueSalesOrder.IsReadOnly      = closed;
            form.lueOpportunity.IsReadOnly     = closed;
            form.txtComments.IsReadOnly        = closed;
            form.pklStatus.IsReadOnly          = closed;
            form.dtpQuoteDate.IsReadOnly       = closed;
            form.dtpQuoteExpiration.IsReadOnly = closed;
            form.txtCustomerRFQ.IsReadOnly     = closed;
            form.btnSave.Visible   = !closed;
            form.btnReset.Visible  = !closed;
            form.btnDelete.Visible = !closed;
        }