示例#1
0
 public ManufactureOrder(Guid identity, string code, UnitDepartment unit, ManufactureFlow flow, Goods goods)
 {
     this.Identity = identity;
     this.Code     = code;
     this.Unit     = unit;
     this.Flow     = flow;
     this.Goods    = goods;
 }
示例#2
0
 public GarmentComodityPriceDto(GarmentComodityPrice garmentComodityPrice)
 {
     Id       = garmentComodityPrice.Identity;
     Comodity = new GarmentComodity(garmentComodityPrice.ComodityId.Value, garmentComodityPrice.ComodityCode, garmentComodityPrice.ComodityName);
     IsValid  = garmentComodityPrice.IsValid;
     Unit     = new UnitDepartment(garmentComodityPrice.UnitId.Value, garmentComodityPrice.UnitCode, garmentComodityPrice.UnitName);
     Date     = garmentComodityPrice.Date;
     Price    = garmentComodityPrice.Price;
 }
 public GarmentAvalComponentDto(GarmentAvalComponent garmentAvalComponent)
 {
     Id = garmentAvalComponent.Identity;
     AvalComponentNo   = garmentAvalComponent.AvalComponentNo;
     Unit              = new UnitDepartment(garmentAvalComponent.UnitId == null ? 0 : garmentAvalComponent.UnitId.Value, garmentAvalComponent.UnitCode, garmentAvalComponent.UnitName);
     AvalComponentType = garmentAvalComponent.AvalComponentType;
     RONo              = garmentAvalComponent.RONo;
     Article           = garmentAvalComponent.Article;
     Date              = garmentAvalComponent.Date;
 }
 public GarmentAdjustmentListDto(GarmentAdjustment garmentAdjustment)
 {
     Id             = garmentAdjustment.Identity;
     AdjustmentNo   = garmentAdjustment.AdjustmentNo;
     RONo           = garmentAdjustment.RONo;
     Article        = garmentAdjustment.Article;
     Unit           = new UnitDepartment(garmentAdjustment.UnitId.Value, garmentAdjustment.UnitCode, garmentAdjustment.UnitName);
     Comodity       = new GarmentComodity(garmentAdjustment.ComodityId.Value, garmentAdjustment.ComodityCode, garmentAdjustment.ComodityName);
     AdjustmentDate = garmentAdjustment.AdjustmentDate;
     CreatedBy      = garmentAdjustment.AuditTrail.CreatedBy;
 }
        public GarmentAvalComponentViewModel(GarmentAvalComponent garmentAvalComponent)
        {
            Id = garmentAvalComponent.Identity;
            AvalComponentNo   = garmentAvalComponent.AvalComponentNo;
            Unit              = new UnitDepartment(garmentAvalComponent.UnitId.Value, garmentAvalComponent.UnitCode, garmentAvalComponent.UnitName);
            AvalComponentType = garmentAvalComponent.AvalComponentType;
            RONo              = garmentAvalComponent.RONo;
            Article           = garmentAvalComponent.Article;
            Comodity          = garmentAvalComponent.ComodityId.Value > 1 ? new GarmentComodity(garmentAvalComponent.ComodityId.Value, garmentAvalComponent.ComodityCode, garmentAvalComponent.ComodityName) : null;
            Date              = garmentAvalComponent.Date;

            Items = new List <GarmentAvalComponentItemDto>();
        }
示例#6
0
 public GarmentFinishingOutListDto(GarmentFinishingOut garmentFinishingOutList)
 {
     Id               = garmentFinishingOutList.Identity;
     FinishingOutNo   = garmentFinishingOutList.FinishingOutNo;
     UnitTo           = new UnitDepartment(garmentFinishingOutList.UnitToId.Value, garmentFinishingOutList.UnitToCode, garmentFinishingOutList.UnitToName);
     Unit             = new UnitDepartment(garmentFinishingOutList.UnitId.Value, garmentFinishingOutList.UnitCode, garmentFinishingOutList.UnitName);
     RONo             = garmentFinishingOutList.RONo;
     Article          = garmentFinishingOutList.Article;
     FinishingOutDate = garmentFinishingOutList.FinishingOutDate;
     FinishingTo      = garmentFinishingOutList.FinishingTo;
     CreatedBy        = garmentFinishingOutList.AuditTrail.CreatedBy;
     Items            = new List <GarmentFinishingOutItemDto>();
 }
示例#7
0
 public GarmentLoadingListDto(GarmentLoading garmentLoading)
 {
     Id          = garmentLoading.Identity;
     LoadingNo   = garmentLoading.LoadingNo;
     SewingDONo  = garmentLoading.SewingDONo;
     RONo        = garmentLoading.RONo;
     Article     = garmentLoading.Article;
     Unit        = new UnitDepartment(garmentLoading.UnitId.Value, garmentLoading.UnitCode, garmentLoading.UnitName);
     UnitFrom    = new UnitDepartment(garmentLoading.UnitFromId.Value, garmentLoading.UnitFromCode, garmentLoading.UnitFromName);
     Comodity    = new GarmentComodity(garmentLoading.ComodityId.Value, garmentLoading.ComodityCode, garmentLoading.ComodityName);
     LoadingDate = garmentLoading.LoadingDate;
     CreatedBy   = garmentLoading.AuditTrail.CreatedBy;
 }
示例#8
0
        public GarmentAvalProductDto(GarmentAvalProduct garmentAvalProduct)
        {
            Id = garmentAvalProduct.Identity;

            LastModifiedDate = garmentAvalProduct.AuditTrail.ModifiedDate ?? garmentAvalProduct.AuditTrail.CreatedDate;
            LastModifiedBy   = garmentAvalProduct.AuditTrail.ModifiedBy ?? garmentAvalProduct.AuditTrail.CreatedBy;

            RONo      = garmentAvalProduct.RONo;
            Article   = garmentAvalProduct.Article;
            AvalDate  = garmentAvalProduct.AvalDate;
            Unit      = new UnitDepartment(garmentAvalProduct.UnitId.Value, garmentAvalProduct.UnitCode, garmentAvalProduct.UnitName);
            CreatedBy = garmentAvalProduct.AuditTrail.CreatedBy;
        }
示例#9
0
 public GarmentCuttingInListDto(GarmentCuttingIn garmentCuttingIn)
 {
     Id            = garmentCuttingIn.Identity;
     CutInNo       = garmentCuttingIn.CutInNo;
     CuttingType   = garmentCuttingIn.CuttingType;
     RONo          = garmentCuttingIn.RONo;
     Article       = garmentCuttingIn.Article;
     Unit          = new UnitDepartment(garmentCuttingIn.UnitId.Value, garmentCuttingIn.UnitCode, garmentCuttingIn.UnitName);
     CuttingInDate = garmentCuttingIn.CuttingInDate;
     FC            = garmentCuttingIn.FC;
     CuttingFrom   = garmentCuttingIn.CuttingFrom;
     CreatedBy     = garmentCuttingIn.AuditTrail.CreatedBy;
 }
 public GarmentFinishingInListDto(GarmentFinishingIn garmentFinishingIn)
 {
     Id              = garmentFinishingIn.Identity;
     FinishingInNo   = garmentFinishingIn.FinishingInNo;
     RONo            = garmentFinishingIn.RONo;
     Article         = garmentFinishingIn.Article;
     Unit            = new UnitDepartment(garmentFinishingIn.UnitId.Value, garmentFinishingIn.UnitCode, garmentFinishingIn.UnitName);
     UnitFrom        = new UnitDepartment(garmentFinishingIn.UnitFromId.Value, garmentFinishingIn.UnitFromCode, garmentFinishingIn.UnitFromName);
     FinishingInDate = garmentFinishingIn.FinishingInDate;
     FinishingInType = garmentFinishingIn.FinishingInType;
     Comodity        = new GarmentComodity(garmentFinishingIn.ComodityId.Value, garmentFinishingIn.ComodityCode, garmentFinishingIn.ComodityName);
     CreatedBy       = garmentFinishingIn.AuditTrail.CreatedBy;
 }
示例#11
0
        public GarmentAdjustmentDto(GarmentAdjustment garmentAdjustment)
        {
            Id             = garmentAdjustment.Identity;
            AdjustmentNo   = garmentAdjustment.AdjustmentNo;
            AdjustmentType = garmentAdjustment.AdjustmentType;
            RONo           = garmentAdjustment.RONo;
            Article        = garmentAdjustment.Article;
            Unit           = new UnitDepartment(garmentAdjustment.UnitId.Value, garmentAdjustment.UnitCode, garmentAdjustment.UnitName);
            Comodity       = new GarmentComodity(garmentAdjustment.ComodityId.Value, garmentAdjustment.ComodityCode, garmentAdjustment.ComodityName);
            AdjustmentDate = garmentAdjustment.AdjustmentDate;
            AdjustmentDesc = garmentAdjustment.AdjustmentDesc;

            Items = new List <GarmentAdjustmentItemDto>();
        }
示例#12
0
 public GarmentFinishedGoodStockDto(GarmentFinishedGoodStock finishedGoodStock)
 {
     Id = finishedGoodStock.Identity;
     FinishedGoodStockNo = finishedGoodStock.FinishedGoodStockNo;
     RONo       = finishedGoodStock.RONo;
     Article    = finishedGoodStock.Article;
     Unit       = new UnitDepartment(finishedGoodStock.UnitId.Value, finishedGoodStock.UnitCode, finishedGoodStock.UnitName);
     Comodity   = new GarmentComodity(finishedGoodStock.ComodityId.Value, finishedGoodStock.ComodityCode, finishedGoodStock.ComodityName);
     Size       = new SizeValueObject(finishedGoodStock.SizeId.Value, finishedGoodStock.SizeName);
     Quantity   = finishedGoodStock.Quantity;
     Uom        = new Uom(finishedGoodStock.UomId.Value, finishedGoodStock.UomUnit);
     BasicPrice = finishedGoodStock.BasicPrice;
     Price      = finishedGoodStock.Price;
 }
        public GarmentCuttingOutDto(GarmentCuttingOut garmentCuttingOut)
        {
            Id             = garmentCuttingOut.Identity;
            CutOutNo       = garmentCuttingOut.CutOutNo;
            CuttingOutType = garmentCuttingOut.CuttingOutType;
            UnitFrom       = new UnitDepartment(garmentCuttingOut.UnitFromId.Value, garmentCuttingOut.UnitFromCode, garmentCuttingOut.UnitFromName);
            CuttingOutDate = garmentCuttingOut.CuttingOutDate;
            RONo           = garmentCuttingOut.RONo;
            Article        = garmentCuttingOut.Article;
            Unit           = new UnitDepartment(garmentCuttingOut.UnitId.Value, garmentCuttingOut.UnitCode, garmentCuttingOut.UnitName);
            Comodity       = new GarmentComodity(garmentCuttingOut.ComodityId.Value, garmentCuttingOut.ComodityCode, garmentCuttingOut.ComodityName);

            Items = new List <GarmentCuttingOutItemDto>();
        }
示例#14
0
 public GarmentSewingDOListDto(GarmentSewingDO garmentSewingDO)
 {
     Id           = garmentSewingDO.Identity;
     SewingDONo   = garmentSewingDO.SewingDONo;
     CuttingOutId = garmentSewingDO.CuttingOutId;
     UnitFrom     = new UnitDepartment(garmentSewingDO.UnitFromId.Value, garmentSewingDO.UnitFromCode, garmentSewingDO.UnitFromName);
     Unit         = new UnitDepartment(garmentSewingDO.UnitId.Value, garmentSewingDO.UnitCode, garmentSewingDO.UnitName);
     RONo         = garmentSewingDO.RONo;
     Article      = garmentSewingDO.Article;
     Comodity     = new GarmentComodity(garmentSewingDO.ComodityId.Value, garmentSewingDO.ComodityCode, garmentSewingDO.ComodityName);
     SewingDODate = garmentSewingDO.SewingDODate;
     CreatedBy    = garmentSewingDO.AuditTrail.CreatedBy;
     Items        = new List <GarmentSewingDOItemDto>();
 }
示例#15
0
 public GarmentExpenditureGoodReturnListDto(GarmentExpenditureGoodReturn garmentExpenditureGoodReturn)
 {
     Id        = garmentExpenditureGoodReturn.Identity;
     ReturNo   = garmentExpenditureGoodReturn.ReturNo;
     RONo      = garmentExpenditureGoodReturn.RONo;
     Article   = garmentExpenditureGoodReturn.Article;
     Unit      = new UnitDepartment(garmentExpenditureGoodReturn.UnitId.Value, garmentExpenditureGoodReturn.UnitCode, garmentExpenditureGoodReturn.UnitName);
     ReturDate = garmentExpenditureGoodReturn.ReturDate;
     ReturType = garmentExpenditureGoodReturn.ReturType;
     Comodity  = new GarmentComodity(garmentExpenditureGoodReturn.ComodityId.Value, garmentExpenditureGoodReturn.ComodityCode, garmentExpenditureGoodReturn.ComodityName);
     Buyer     = new Buyer(garmentExpenditureGoodReturn.BuyerId.Value, garmentExpenditureGoodReturn.BuyerCode, garmentExpenditureGoodReturn.BuyerName);
     Invoice   = garmentExpenditureGoodReturn.Invoice;
     CreatedBy = garmentExpenditureGoodReturn.AuditTrail.CreatedBy;
 }
示例#16
0
 public GarmentExpenditureGoodReturnDto(GarmentExpenditureGoodReturn garmentExpenditureGoodReturn)
 {
     Id        = garmentExpenditureGoodReturn.Identity;
     ReturNo   = garmentExpenditureGoodReturn.ReturNo;
     RONo      = garmentExpenditureGoodReturn.RONo;
     Article   = garmentExpenditureGoodReturn.Article;
     Unit      = new UnitDepartment(garmentExpenditureGoodReturn.UnitId.Value, garmentExpenditureGoodReturn.UnitCode, garmentExpenditureGoodReturn.UnitName);
     ReturDate = garmentExpenditureGoodReturn.ReturDate;
     ReturType = garmentExpenditureGoodReturn.ReturType;
     Comodity  = new GarmentComodity(garmentExpenditureGoodReturn.ComodityId.Value, garmentExpenditureGoodReturn.ComodityCode, garmentExpenditureGoodReturn.ComodityName);
     Buyer     = new Buyer(garmentExpenditureGoodReturn.BuyerId.Value, garmentExpenditureGoodReturn.BuyerCode, garmentExpenditureGoodReturn.BuyerName);
     Invoice   = garmentExpenditureGoodReturn.Invoice;
     ReturDesc = garmentExpenditureGoodReturn.ReturDesc;
     Items     = new List <GarmentExpenditureGoodReturnItemDto>();
 }
示例#17
0
        public GarmentFinishingOutDto(GarmentFinishingOut garmentFinishingOutList)
        {
            Id               = garmentFinishingOutList.Identity;
            FinishingOutNo   = garmentFinishingOutList.FinishingOutNo;
            UnitTo           = new UnitDepartment(garmentFinishingOutList.UnitToId.Value, garmentFinishingOutList.UnitToCode, garmentFinishingOutList.UnitToName);
            Unit             = new UnitDepartment(garmentFinishingOutList.UnitId.Value, garmentFinishingOutList.UnitCode, garmentFinishingOutList.UnitName);
            RONo             = garmentFinishingOutList.RONo;
            Article          = garmentFinishingOutList.Article;
            FinishingOutDate = garmentFinishingOutList.FinishingOutDate;
            FinishingTo      = garmentFinishingOutList.FinishingTo;
            Comodity         = new GarmentComodity(garmentFinishingOutList.ComodityId.Value, garmentFinishingOutList.ComodityCode, garmentFinishingOutList.ComodityName);
            IsDifferentSize  = garmentFinishingOutList.IsDifferentSize;

            Items = new List <GarmentFinishingOutItemDto>();
        }
示例#18
0
        public GarmentCuttingInDto(GarmentCuttingIn garmentCuttingIn)
        {
            Id = garmentCuttingIn.Identity;

            CutInNo       = garmentCuttingIn.CutInNo;
            CuttingType   = garmentCuttingIn.CuttingType;
            RONo          = garmentCuttingIn.RONo;
            Article       = garmentCuttingIn.Article;
            Unit          = new UnitDepartment(garmentCuttingIn.UnitId.Value, garmentCuttingIn.UnitCode, garmentCuttingIn.UnitName);
            CuttingInDate = garmentCuttingIn.CuttingInDate;
            FC            = garmentCuttingIn.FC;
            CuttingFrom   = garmentCuttingIn.CuttingFrom;

            Items = new List <GarmentCuttingInItemDto>();
        }
        public GarmentLoadingDto(GarmentLoading garmentLoading)
        {
            Id          = garmentLoading.Identity;
            LoadingNo   = garmentLoading.LoadingNo;
            SewingDOId  = garmentLoading.SewingDOId;
            SewingDONo  = garmentLoading.SewingDONo;
            RONo        = garmentLoading.RONo;
            Article     = garmentLoading.Article;
            Unit        = new UnitDepartment(garmentLoading.UnitId.Value, garmentLoading.UnitCode, garmentLoading.UnitName);
            UnitFrom    = new UnitDepartment(garmentLoading.UnitFromId.Value, garmentLoading.UnitFromCode, garmentLoading.UnitFromName);
            Comodity    = new GarmentComodity(garmentLoading.ComodityId.Value, garmentLoading.ComodityCode, garmentLoading.ComodityName);
            LoadingDate = garmentLoading.LoadingDate;

            Items = new List <GarmentLoadingItemDto>();
        }
        public async Task Get_StateUnderTest_ExpectedBehavior()
        {
            // Arrange
            var unitUnderTest = CreateOrdersController();

            //fake

            var goodsId = Guid.NewGuid();
            var product = new Goods(goodsId, "Benang 401");

            var unitId = Guid.NewGuid();

            var unit = new UnitDepartment(unitId, "Spinning");

            var flowId = Guid.NewGuid();

            var flow = new ManufactureFlow(flowId, product, new List <ManufactureOrderActivityType> {
                ManufactureOrderActivityType.Spinning_Blowing,
                ManufactureOrderActivityType.Spinning_Carding
            });

            var orderCode = "MO010101";

            var order = new ManufactureOrder(Guid.NewGuid(), orderCode, unit, flow, product);

            var orders = new List <ManufactureOrder>()
            {
                order
            };

            this.mockManufactureOrderRepo.Setup(x => x.GetAllAsync()).Returns(Task.FromResult(orders.AsQueryable()));

            this.mockMapper.Setup(x => x.Map <ManufactureOrder, ManufactureOrderDto>(It.IsAny <ManufactureOrder>()))
            .Returns(new ManufactureOrderDto
            {
                Id   = order.Identity.ToString(),
                Code = order.Code
            });

            // Act
            var result = await unitUnderTest.Get();

            // Assert

            result.Should().BeOfType <OkObjectResult>()
            .Subject.Value.Should().BeOfType <List <ManufactureOrderDto> >()
            .Subject.Count.Should().BeGreaterThan(0);
        }
        public GarmentSewingInDto(GarmentSewingIn garmentSewingIn)
        {
            Id           = garmentSewingIn.Identity;
            SewingInNo   = garmentSewingIn.SewingInNo;
            SewingFrom   = garmentSewingIn.SewingFrom;
            LoadingId    = garmentSewingIn.LoadingId;
            LoadingNo    = garmentSewingIn.LoadingNo;
            UnitFrom     = new UnitDepartment(garmentSewingIn.UnitFromId.Value, garmentSewingIn.UnitFromCode, garmentSewingIn.UnitFromName);
            Unit         = new UnitDepartment(garmentSewingIn.UnitId.Value, garmentSewingIn.UnitCode, garmentSewingIn.UnitName);
            RONo         = garmentSewingIn.RONo;
            Article      = garmentSewingIn.Article;
            Comodity     = new GarmentComodity(garmentSewingIn.ComodityId.Value, garmentSewingIn.ComodityCode, garmentSewingIn.ComodityName);
            SewingInDate = garmentSewingIn.SewingInDate;

            Items = new List <GarmentSewingInItemDto>();
        }
 public GarmentFinishingInDto(GarmentFinishingIn garmentFinishingIn)
 {
     Id              = garmentFinishingIn.Identity;
     FinishingInNo   = garmentFinishingIn.FinishingInNo;
     RONo            = garmentFinishingIn.RONo;
     Article         = garmentFinishingIn.Article;
     Unit            = new UnitDepartment(garmentFinishingIn.UnitId.Value, garmentFinishingIn.UnitCode, garmentFinishingIn.UnitName);
     UnitFrom        = new UnitDepartment(garmentFinishingIn.UnitFromId.Value, garmentFinishingIn.UnitFromCode, garmentFinishingIn.UnitFromName);
     Comodity        = new GarmentComodity(garmentFinishingIn.ComodityId.Value, garmentFinishingIn.ComodityCode, garmentFinishingIn.ComodityName);
     FinishingInDate = garmentFinishingIn.FinishingInDate;
     FinishingInType = garmentFinishingIn.FinishingInType;
     Comodity        = new GarmentComodity(garmentFinishingIn.ComodityId.Value, garmentFinishingIn.ComodityCode, garmentFinishingIn.ComodityName);
     DOId            = garmentFinishingIn.DOId;
     DONo            = garmentFinishingIn.DONo;
     Items           = new List <GarmentFinishingInItemDto>();
 }
示例#23
0
 public GarmentSewingInListDto(GarmentSewingIn garmentSewingInList)
 {
     Id           = garmentSewingInList.Identity;
     SewingInNo   = garmentSewingInList.SewingInNo;
     SewingFrom   = garmentSewingInList.SewingFrom;
     LoadingId    = garmentSewingInList.LoadingId;
     LoadingNo    = garmentSewingInList.LoadingNo;
     UnitFrom     = new UnitDepartment(garmentSewingInList.UnitFromId.Value, garmentSewingInList.UnitFromCode, garmentSewingInList.UnitFromName);
     Unit         = new UnitDepartment(garmentSewingInList.UnitId.Value, garmentSewingInList.UnitCode, garmentSewingInList.UnitName);
     RONo         = garmentSewingInList.RONo;
     Article      = garmentSewingInList.Article;
     Comodity     = new GarmentComodity(garmentSewingInList.ComodityId.Value, garmentSewingInList.ComodityCode, garmentSewingInList.ComodityName);
     SewingInDate = garmentSewingInList.SewingInDate;
     CreatedBy    = garmentSewingInList.AuditTrail.CreatedBy;
     Items        = new List <GarmentSewingInItemDto>();
 }
示例#24
0
        public GarmentPreparingDto(GarmentPreparing garmentPreparing)
        {
            Id = garmentPreparing.Identity;

            LastModifiedDate = garmentPreparing.AuditTrail.ModifiedDate ?? garmentPreparing.AuditTrail.CreatedDate;
            LastModifiedBy   = garmentPreparing.AuditTrail.ModifiedBy ?? garmentPreparing.AuditTrail.CreatedBy;

            UENId       = garmentPreparing.UENId;
            UENNo       = garmentPreparing.UENNo;
            Unit        = new UnitDepartment(garmentPreparing.UnitId.Value, garmentPreparing.UnitName, garmentPreparing.UnitCode);
            ProcessDate = garmentPreparing.ProcessDate;
            RONo        = garmentPreparing.RONo;
            Article     = garmentPreparing.Article;
            IsCuttingIn = garmentPreparing.IsCuttingIn;
            CreatedBy   = garmentPreparing.AuditTrail.CreatedBy;
            Buyer       = new Domain.Shared.ValueObjects.Buyer(garmentPreparing.BuyerId.Value, garmentPreparing.BuyerCode, garmentPreparing.BuyerName);
        }
示例#25
0
        public GarmentSubconCuttingOutDto(GarmentSubconCuttingOut garmentCuttingOut)
        {
            Id             = garmentCuttingOut.Identity;
            CutOutNo       = garmentCuttingOut.CutOutNo;
            CuttingOutType = garmentCuttingOut.CuttingOutType;
            UnitFrom       = new UnitDepartment(garmentCuttingOut.UnitFromId.Value, garmentCuttingOut.UnitFromCode, garmentCuttingOut.UnitFromName);
            CuttingOutDate = garmentCuttingOut.CuttingOutDate;
            RONo           = garmentCuttingOut.RONo;
            Article        = garmentCuttingOut.Article;
            Comodity       = new GarmentComodity(garmentCuttingOut.ComodityId.Value, garmentCuttingOut.ComodityCode, garmentCuttingOut.ComodityName);

            EPOId          = garmentCuttingOut.EPOId;
            EPOItemId      = garmentCuttingOut.EPOItemId;
            POSerialNumber = garmentCuttingOut.POSerialNumber;

            Items = new List <GarmentSubconCuttingOutItemDto>();
        }
示例#26
0
 public GarmentExpenditureGoodDto(GarmentExpenditureGood garmentExpenditureGood)
 {
     Id = garmentExpenditureGood.Identity;
     ExpenditureGoodNo = garmentExpenditureGood.ExpenditureGoodNo;
     RONo            = garmentExpenditureGood.RONo;
     Article         = garmentExpenditureGood.Article;
     Unit            = new UnitDepartment(garmentExpenditureGood.UnitId.Value, garmentExpenditureGood.UnitCode, garmentExpenditureGood.UnitName);
     ExpenditureDate = garmentExpenditureGood.ExpenditureDate;
     ExpenditureType = garmentExpenditureGood.ExpenditureType;
     Comodity        = new GarmentComodity(garmentExpenditureGood.ComodityId.Value, garmentExpenditureGood.ComodityCode, garmentExpenditureGood.ComodityName);
     Buyer           = new Buyer(garmentExpenditureGood.BuyerId.Value, garmentExpenditureGood.BuyerCode, garmentExpenditureGood.BuyerName);
     Invoice         = garmentExpenditureGood.Invoice;
     ContractNo      = garmentExpenditureGood.ContractNo;
     Carton          = garmentExpenditureGood.Carton;
     Description     = garmentExpenditureGood.Description;
     IsReceived      = garmentExpenditureGood.IsReceived;
     Items           = new List <GarmentExpenditureGoodItemDto>();
 }
示例#27
0
        public async Task Post_StateUnderTest_ExpectedBehavior()
        {
            // Arrange
            var unitUnderTest = CreateOrdersController();

            //fake

            var goodsId = Guid.NewGuid();
            var product = new Goods(goodsId, "Benang 401");

            var unitId = Guid.NewGuid();

            var unit = new UnitDepartment(unitId, "Spinning");

            var flowId = Guid.NewGuid();

            var flow = new ManufactureFlow(flowId, product, new List <ManufactureOrderActivityType> {
                ManufactureOrderActivityType.Spinning_Blowing,
                ManufactureOrderActivityType.Spinning_Carding
            });

            var orderCode = "MO010101";

            var order = new ManufactureOrder(Guid.NewGuid(), "MO010101", unit, flow, product);

            this.mockManufactureOrderService.Setup(x => x.PlaceOrderAsync(orderCode, unitId, flowId, goodsId)).Returns(Task.FromResult(order));

            var form = new ManufactureOrderForm
            {
                Code            = orderCode,
                UnitId          = unitId.ToString(),
                FlowId          = flowId.ToString(),
                OutputProductId = goodsId.ToString()
            };

            // Act
            IActionResult result = await unitUnderTest.Post(form);

            // Assert
            result.Should().BeOfType <OkObjectResult>()
            .Subject.Value.Should().BeOfType <string>()
            .Subject.Should().Be(order.Identity.ToString());
        }
示例#28
0
        public GarmentDeliveryReturnDto(GarmentDeliveryReturn garmentDeliveryReturn)
        {
            Id = garmentDeliveryReturn.Identity;

            LastModifiedDate = garmentDeliveryReturn.AuditTrail.ModifiedDate ?? garmentDeliveryReturn.AuditTrail.CreatedDate;
            LastModifiedBy   = garmentDeliveryReturn.AuditTrail.ModifiedBy ?? garmentDeliveryReturn.AuditTrail.CreatedBy;

            DRNo        = garmentDeliveryReturn.DRNo;
            RONo        = garmentDeliveryReturn.RONo;
            Article     = garmentDeliveryReturn.Article;
            UnitDOId    = garmentDeliveryReturn.UnitDOId;
            UnitDONo    = garmentDeliveryReturn.UnitDONo;
            UENId       = garmentDeliveryReturn.UENId;
            PreparingId = garmentDeliveryReturn.PreparingId;
            ReturnDate  = garmentDeliveryReturn.ReturnDate;
            ReturnType  = garmentDeliveryReturn.ReturnType;
            Unit        = new UnitDepartment(garmentDeliveryReturn.UnitId.Value, garmentDeliveryReturn.UnitName, garmentDeliveryReturn.UnitCode);
            Storage     = new Storage(garmentDeliveryReturn.StorageId.Value, garmentDeliveryReturn.StorageName, garmentDeliveryReturn.StorageCode);
            IsUsed      = garmentDeliveryReturn.IsUsed;
            CreatedBy   = garmentDeliveryReturn.AuditTrail.CreatedBy;
        }
示例#29
0
        public async Task <ManufactureOrder> PlaceOrderAsync(string orderCode, Guid unitId, Guid flowId, Guid goodsId)
        {
            var goods = new Goods(_productRepository.GetProductById(goodsId));

            var unit = new UnitDepartment(_departmentRepository.GetDepartmentById(unitId));

            var flow = new ManufactureFlow(flowId, goods, new List <ManufactureOrderActivityType> {
                ManufactureOrderActivityType.Spinning_Blowing,
                ManufactureOrderActivityType.Spinning_Carding
            });

            var orderId = Guid.NewGuid();
            var order   = new ManufactureOrder(orderId, orderCode, unit, flow, goods);

            order.AddDomainEvent(new OnManufactureOroderPlaced(orderId));

            await _manufactureOrderRepository.AddOrder(order);

            await _productRepository.UnitOfWork.SaveChangesAsync();

            return(order);
        }