/// <summary> /// Получение перечня упаковочных работ. /// </summary> public ArrayList GetPackingWorks() { ArrayList PackingWorksList = new ArrayList(); // Если прибор гарантийный и гарантия не аннулирована, не включаем стоимость упаковки в калькуляцию if ((this.WarrantyRepair) && (!this.VoidWarranty)) { return(PackingWorksList); } string BlockName = ""; string BlockNameID = ""; string WorksType = "Упаковка и накладные расходы"; string WorksTypeID = ServicesCard.GetItemID(ApplicationCard.UniversalCard, WorksType); int Amount = 1; bool Improvement = false; bool VoidWarranty = this.VoidWarranty; bool DoubleCost = false; string DescriptionOfReason = this.DescriptionOfReason; bool RefusalToRepair = this.RefusalToRepair; CalculationItem NewItem = new CalculationItem(Card, DeviceName, DeviceItemID, BlockName, BlockNameID, WorksType, WorksTypeID, Improvement, Amount, true, VoidWarranty, DoubleCost, DescriptionOfReason, RefusalToRepair); PackingWorksList.Add(NewItem); return(PackingWorksList); }
/// <summary> /// Получение перечня калибровочных работ. /// </summary> public ArrayList GetCalibrateWorks() { ArrayList CalibrateWorksList = new ArrayList(); // Если прибор гарантийный и гарантия не аннулирована, не включаем калибровку в калькуляцию if ((this.WarrantyRepair) && (!this.VoidWarranty)) { return(CalibrateWorksList); } /* Калибровка прибора */ string WorkName = ""; if (this.OnlyAccessories) { WorkName = "Диагностика комплектующих"; } else { WorkName = "Калибровка " + this.DeviceType; if (this.GetAge() > 10) { WorkName = WorkName + " (старше 10 лет)"; } } string CalibWorkID = ServicesCard.GetItemID(ApplicationCard.UniversalCard, WorkName); string BlockName = ""; string BlockNameID = ""; string WorksType = WorkName; string WorksTypeID = CalibWorkID; int Amount = 1; bool Improvement = false; bool VoidWarranty = this.VoidWarranty; bool DoubleCost = false; string DescriptionOfReason = this.DescriptionOfReason; bool RefusalToRepair = this.RefusalToRepair; CalculationItem NewItem = new CalculationItem(Card, DeviceName, DevicePassportID, BlockName, BlockNameID, WorksType, WorksTypeID, Improvement, Amount, true, VoidWarranty, DoubleCost, DescriptionOfReason, RefusalToRepair); CalibrateWorksList.Add(NewItem); /* Калибровочные работы для дополнительных изделий */ foreach (AdditionalWare CurrentWare in AdditionalWaresList) { WorkName = "Калибровка " + CurrentWare.TypeName; if (CurrentWare.GetAge() > 10) { WorkName = WorkName + " (старше 10 лет)"; } CalibWorkID = ServicesCard.GetItemID(ApplicationCard.UniversalCard, WorkName); string WaresBlockName = ""; string WaresBlockNameID = ""; string WaresWorksType = WorkName; string WaresWorksTypeID = CalibWorkID; int WaresWorkAmount = 1; bool WaresImprovement = false; bool WaresVoidWarranty = this.VoidWarranty; bool WaresDoubleCost = false; string WaresDescriptionOfReason = this.DescriptionOfReason; bool WaresRefusalToRepair = this.RefusalToRepair; CalculationItem NewWaresItem = new CalculationItem(Card, DeviceName, DevicePassportID, WaresBlockName, WaresBlockNameID, WaresWorksType, WaresWorksTypeID, WaresImprovement, WaresWorkAmount, true, WaresVoidWarranty, WaresDoubleCost, WaresDescriptionOfReason, WaresRefusalToRepair); CalibrateWorksList.Add(NewWaresItem); } return(CalibrateWorksList); }