示例#1
0
 protected internal ProductionOrderBatchStage(ProductionOrderBatchStage productionOrderBatchStage)
 {
     this.name            = productionOrderBatchStage.Name;
     this.type            = productionOrderBatchStage.Type;
     this.plannedDuration = productionOrderBatchStage.PlannedDuration;
     this.ActualStartDate = productionOrderBatchStage.ActualStartDate;
     this.ActualEndDate   = productionOrderBatchStage.ActualEndDate;
     InWorkDays           = productionOrderBatchStage.InWorkDays;
     IsDefault            = productionOrderBatchStage.IsDefault;
 }
示例#2
0
        public ProductionOrder(string name, Producer producer, Currency currency, ProductionOrderBatchStage calculationStage, ProductionOrderBatchStage successfullClosingStage,
                               ProductionOrderBatchStage unsuccessfulClosingStage, ProductionOrderArticleTransportingPrimeCostCalculationType articleTransportingPrimeCostCalculationType,
                               bool mondayIsWorkDay, bool tuesdayIsWorkDay, bool wednesdayIsWorkDay, bool thursdayIsWorkDay, bool fridayIsWorkDay, bool saturdayIsWorkDay, bool sundayIsWorkDay,
                               User createdBy, DateTime currentDateTime)
        {
            ValidationUtils.Assert(!String.IsNullOrEmpty(name), "Название заказа не указано.");
            Name = name;

            ValidationUtils.NotNull(currency, "Валюта не указана.");
            this.currency     = currency;
            this.currencyRate = null;

            ValidationUtils.NotNull(producer, "Производитель не указан.");
            Producer = producer;

            CreationDate = currentDateTime;
            Date         = currentDateTime.Date;
            CreatedBy    = createdBy;
            Curator      = createdBy;
            ArticleTransportingPrimeCostCalculationType = articleTransportingPrimeCostCalculationType;
            Comment = "";

            batches             = new HashedSet <ProductionOrderBatch>();
            payments            = new HashedSet <ProductionOrderPayment>();
            plannedPayments     = new HashedSet <ProductionOrderPlannedPayment>();
            transportSheets     = new HashedSet <ProductionOrderTransportSheet>();
            extraExpensesSheets = new HashedSet <ProductionOrderExtraExpensesSheet>();
            customsDeclarations = new HashedSet <ProductionOrderCustomsDeclaration>();
            materialsPackages   = new HashedSet <ProductionOrderMaterialsPackage>();

            var batch = new ProductionOrderBatch(calculationStage, successfullClosingStage, unsuccessfulClosingStage, createdBy, currentDateTime);

            AddBatch(batch);

            IsClosed = false;

            MondayIsWorkDay    = mondayIsWorkDay;
            TuesdayIsWorkDay   = tuesdayIsWorkDay;
            WednesdayIsWorkDay = wednesdayIsWorkDay;
            ThursdayIsWorkDay  = thursdayIsWorkDay;
            FridayIsWorkDay    = fridayIsWorkDay;
            SaturdayIsWorkDay  = saturdayIsWorkDay;
            SundayIsWorkDay    = sundayIsWorkDay;
            CheckWorkDaysPlan();
        }