예제 #1
0
        protected ChooseOperationBase(bool highlightEntities, DocumentChoiceType choiceType, OperationType operationType = OperationType.Any)
            : base(choiceType)
        {
            this.highlightEntities = highlightEntities;
            this.operationType     = operationType;

            Initialize();
        }
예제 #2
0
 public ChooseComplexProduction(DocumentChoiceType choiceType) : base(choiceType)
 {
 }
예제 #3
0
 public ChooseIssuedInvoice(DocumentChoiceType choiceType)
     : base(choiceType)
 {
 }
예제 #4
0
 protected virtual string GetQueryStateKey(DocumentChoiceType choice)
 {
     return(string.Format("{0}_{1}", typeof(T).FullName, choice));
 }
예제 #5
0
 protected Choose(DocumentChoiceType choiceType)
     : base(choiceType)
 {
     queryStateKey = GetQueryStateKey(choiceType);
 }
예제 #6
0
 public ChooseTransfer(DocumentChoiceType choiceType) : base(choiceType)
 {
 }
예제 #7
0
        public static bool ShowMessageHasInvoice <TOper> (TOper oper, long invNum, string icon, out bool allowView, bool annulling = false, DocumentChoiceType choiceType = DocumentChoiceType.Choose) where TOper : Operation
        {
            string message = null;

            allowView = false;
            if (annulling)
            {
                if (oper.OperationType == OperationType.Purchase)
                {
                    message = Translator.GetString("Document No.{0} cannot be annulled because the received invoice " +
                                                   "No.{1} is attached to it. Please, void the invoice before annulling this document.");
                }
                else
                {
                    message = Translator.GetString("Document No.{0} cannot be annulled because the issued invoice " +
                                                   "No.{1} is attached to it. Please, void the invoice before annulling this document.");
                }
            }
            else if (choiceType == DocumentChoiceType.CreateChildDocument)
            {
                if (oper.OperationType == OperationType.Purchase)
                {
                    message = Translator.GetString("Document No.{0} cannot be attached to invoice because the received invoice " +
                                                   "No.{1} is already attached to it. Please, void the invoice before attaching another invoice to this document.");
                }
                else
                {
                    message = Translator.GetString("Document No.{0} cannot be attached to another invoice because the issued invoice " +
                                                   "No.{1} is already attached to it. Please, void the invoice before attaching another invoice to this document.");
                }
            }

            if (message == null)
            {
                allowView = true;
                if (BusinessDomain.LoggedUser.UserLevel > UserAccessLevel.Operator)
                {
                    return(ShowMessageHasInvoiceChangeUser(oper, invNum, icon, out allowView));
                }

                if (oper.OperationType == OperationType.Consignment)
                {
                    message = Translator.GetString("Consignment No.{0} cannot be edited because the issued invoice " +
                                                   "No.{1} is attached to a sale on it. Please, void the invoice before editing this consignment.");
                }
                else if (oper.OperationType != OperationType.Purchase)
                {
                    message = Translator.GetString("Document No.{0} cannot be edited because the issued invoice " +
                                                   "No.{1} is attached to it. Please, void the invoice before editing this document.");
                }
                else
                {
                    message = Translator.GetString("Document No.{0} cannot be edited because the received invoice " +
                                                   "No.{1} is attached to it. Please, void the invoice before editing this document.");
                }
            }

            using (MessageError msg = new MessageError(string.Format(message,
                                                                     Operation.GetFormattedOperationNumber(oper.Id),
                                                                     Operation.GetFormattedOperationNumber(invNum)), icon, ErrorSeverity.Warning, null))
                msg.Run();

            return(false);
        }
예제 #8
0
 public ChooseAdvancePayment(DocumentChoiceType choiceType)
     : base(choiceType)
 {
     Initialize();
 }
예제 #9
0
 protected ChooseOperationBase(DocumentChoiceType choiceType)
     : this(false, choiceType)
 {
 }
예제 #10
0
 protected ChooseOperation(DocumentChoiceType choiceType)
     : base(choiceType)
 {
 }
예제 #11
0
 protected ChooseOperation(bool highlightEntities, DocumentChoiceType choiceType, OperationType operationType = OperationType.Any)
     : base(highlightEntities, choiceType, operationType)
 {
 }
예제 #12
0
 public ChooseSale(bool showInvoiceInfo, DocumentChoiceType choiceType, OperationType operationType = OperationType.Any)
     : base(showInvoiceInfo, choiceType, operationType)
 {
     this.operationType = operationType;
 }
예제 #13
0
 public ChoosePurchase(bool showInvoiceInfo, DocumentChoiceType choiceType)
     : base(showInvoiceInfo, choiceType)
 {
 }
 public ChooseStockTaking(DocumentChoiceType choiceType) : base(choiceType)
 {
 }
예제 #15
0
 public ChooseWaste(DocumentChoiceType choiceType) : base(choiceType)
 {
 }
예제 #16
0
 protected ChooseInvoice(DocumentChoiceType choiceType)
     : base(choiceType)
 {
 }