/// <inheritdoc/> public string ToDelimitedString() { CultureInfo culture = CultureInfo.CurrentCulture; return(string.Format( culture, StringHelper.StringFormatSequence(0, 26, Configuration.FieldSeparator), Id, SetIdFt1.HasValue ? SetIdFt1.Value.ToString(culture) : null, TransactionId, TransactionBatchId, TransactionDate.HasValue ? TransactionDate.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, TransactionPostingDate.HasValue ? TransactionPostingDate.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, TransactionType, TransactionCode?.ToDelimitedString(), TransactionDescription, TransactionDescriptionAlt, TransactionQuantity.HasValue ? TransactionQuantity.Value.ToString(Consts.NumericFormat, culture) : null, TransactionAmountExtended?.ToDelimitedString(), TransactionAmountUnit?.ToDelimitedString(), DepartmentCode?.ToDelimitedString(), HealthPlanId?.ToDelimitedString(), InsuranceAmount?.ToDelimitedString(), AssignedPatientLocation?.ToDelimitedString(), FeeSchedule, PatientType, DiagnosisCodeFt1 != null ? string.Join(Configuration.FieldRepeatSeparator, DiagnosisCodeFt1.Select(x => x.ToDelimitedString())) : null, PerformedByCode?.ToDelimitedString(), OrderedByCode?.ToDelimitedString(), UnitCost?.ToDelimitedString(), FillerOrderNumber?.ToDelimitedString(), EnteredByCode?.ToDelimitedString(), ProcedureCode?.ToDelimitedString() ).TrimEnd(Configuration.FieldSeparator.ToCharArray())); }
public StringModel ToStringModel <BLModel, StringModel>() { Mapper.CreateMap <OrderExport, StringOrderExport>() .ForAllMembers(item => item.ToString().CutDownTo(50)); var stringModel = Mapper.Map <OrderExport, StringOrderExport>(this); stringModel.UnitCost = UnitCost.DecimalToString(2); stringModel.ExportDate = ExportDate.DateTimeToString(); stringModel.ItemDescription = ItemDescription.CutDownTo(50); stringModel.LeadTime = LeadTime.DecimalToString(2); stringModel.EstimateOfDemand = EstimateOfDemand.DecimalToString(2); stringModel.Returnable = Returnable.CutDownTo(1); stringModel.Stocked = Stocked.CutDownTo(1); stringModel.Hazardous = Hazardous.CutDownTo(1); stringModel.DueDate = DueDate.DateTimeToString(); Mapper.CreateMap <StringOrderExport, StringModel>(); var stringModelRet = Mapper.Map <StringOrderExport, StringModel>(stringModel); return(stringModelRet); }
public StringModel ToStringModel <BLModel, StringModel>() { Mapper.CreateMap <DealerPartsMaster, StringDealerPartsMaster>() .ForAllMembers(item => item.ToString().CutDownTo(50)); var stringModel = Mapper.Map <DealerPartsMaster, StringDealerPartsMaster>(this); stringModel.ExtractionDate = ExtractionDate.DateTimeToString(); stringModel.Description = Description.CutDownTo(100); stringModel.ActivationDate = ActivationDate.DateToString(); stringModel.UnitCost = UnitCost.DecimalToString(2); stringModel.Weight = Weight.DecimalToString(4); stringModel.Volume = Volume.DecimalToString(4); stringModel.Active = Active.CutDownTo(1); stringModel.PurchasePrice = PurchasePrice.DecimalToString(2); stringModel.InheritStock = InheritStock.CutDownTo(1); stringModel.ReplacementMultiplier = ReplacementMultiplier.DecimalToString(2); if (Weight == 0) { stringModel.Weight = String.Empty; } //if (UnitCost == 0) stringModel.UnitCost = String.Empty; if (UnitCost == null) { stringModel.UnitCostCurrency = String.Empty; } if (Volume == 0) { stringModel.Volume = String.Empty; } if (BulkOrderQuantity1 == 0) { stringModel.BulkOrderQuantity1 = String.Empty; } if (BulkOrderQuantity2 == 0) { stringModel.BulkOrderQuantity2 = String.Empty; } if (MultipleOrderQty == 0) { stringModel.MultipleOrderQty = "1"; //String.Empty; } Mapper.CreateMap <StringDealerPartsMaster, StringModel>(); var stringModelRet = Mapper.Map <StringDealerPartsMaster, StringModel>(stringModel); return(stringModelRet); }
public UnitCost GetUnitCost(IEnumerable <VUnit> units) { ResetCalculationVariables(); var cost = new UnitCost(); foreach (var unit in units) { cost += GetUnitCost(unit.UnitData.Type, unit.CurrentInfusion, unit.UnitRank, unit.IsLimitBroken); } return(cost); }
/// <inheritdoc/> public string ToDelimitedString() { CultureInfo culture = CultureInfo.CurrentCulture; return(string.Format( culture, StringHelper.StringFormatSequence(0, 44, Configuration.FieldSeparator), Id, SetIdFt1.HasValue ? SetIdFt1.Value.ToString(culture) : null, TransactionId, TransactionBatchId, TransactionDate?.ToDelimitedString(), TransactionPostingDate.HasValue ? TransactionPostingDate.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, TransactionType?.ToDelimitedString(), TransactionCode?.ToDelimitedString(), TransactionDescription, TransactionDescriptionAlt, TransactionQuantity.HasValue ? TransactionQuantity.Value.ToString(Consts.NumericFormat, culture) : null, TransactionAmountExtended?.ToDelimitedString(), TransactionAmountUnit?.ToDelimitedString(), DepartmentCode?.ToDelimitedString(), HealthPlanId?.ToDelimitedString(), InsuranceAmount?.ToDelimitedString(), AssignedPatientLocation?.ToDelimitedString(), FeeSchedule?.ToDelimitedString(), PatientType?.ToDelimitedString(), DiagnosisCodeFt1 != null ? string.Join(Configuration.FieldRepeatSeparator, DiagnosisCodeFt1.Select(x => x.ToDelimitedString())) : null, PerformedByCode != null ? string.Join(Configuration.FieldRepeatSeparator, PerformedByCode.Select(x => x.ToDelimitedString())) : null, OrderedByCode != null ? string.Join(Configuration.FieldRepeatSeparator, OrderedByCode.Select(x => x.ToDelimitedString())) : null, UnitCost?.ToDelimitedString(), FillerOrderNumber?.ToDelimitedString(), EnteredByCode != null ? string.Join(Configuration.FieldRepeatSeparator, EnteredByCode.Select(x => x.ToDelimitedString())) : null, ProcedureCode?.ToDelimitedString(), ProcedureCodeModifier != null ? string.Join(Configuration.FieldRepeatSeparator, ProcedureCodeModifier.Select(x => x.ToDelimitedString())) : null, AdvancedBeneficiaryNoticeCode?.ToDelimitedString(), MedicallyNecessaryDuplicateProcedureReason?.ToDelimitedString(), NdcCode?.ToDelimitedString(), PaymentReferenceId?.ToDelimitedString(), TransactionReferenceKey != null ? string.Join(Configuration.FieldRepeatSeparator, TransactionReferenceKey.Select(x => x.ToString(Consts.NumericFormat, culture))) : null, PerformingFacility != null ? string.Join(Configuration.FieldRepeatSeparator, PerformingFacility.Select(x => x.ToDelimitedString())) : null, OrderingFacility?.ToDelimitedString(), ItemNumber?.ToDelimitedString(), ModelNumber, SpecialProcessingCode != null ? string.Join(Configuration.FieldRepeatSeparator, SpecialProcessingCode.Select(x => x.ToDelimitedString())) : null, ClinicCode?.ToDelimitedString(), ReferralNumber?.ToDelimitedString(), AuthorizationNumber?.ToDelimitedString(), ServiceProviderTaxonomyCode?.ToDelimitedString(), RevenueCode?.ToDelimitedString(), PrescriptionNumber, NdcQtyAndUom?.ToDelimitedString() ).TrimEnd(Configuration.FieldSeparator.ToCharArray())); }
public void Refresh() { StringBuilder sb = new StringBuilder(); sb.Append(Quantity.ToString()); sb.Append(" "); sb.Append(ProductName); sb.Append(", $"); sb.Append(UnitCost.ToString()); sb.Append(" each, total cost $"); sb.Append(Subtotal.ToString()); ItemAsString = sb.ToString(); }
UnitCost GetOverInfusionCosts(IUnitData unitData, int infusion, int excessKills) { // over infuse logic. Because this is annoyingly complex, it gets comments // We use recursion to get the cost of the previous infuse, then add on our current infusion var previousInfCost = GetInfusionCosts(unitData, infusion - 1, excessKills); var material = new UnitRecepePiece(unitData.BasicType, 10, UnitRankType.None, 1); // Get the material count - this may not be correct, I only tested inf10->11, which was 11 units var materialQty = infusion; // check see if any qs charges will be involved in the cost of the infuse materials UnitCost qsMaterialCost = default; var remainingQsCharges = qsCharges; if (remainingQsCharges > 0) { // cost of the infuse feed if we have a qs charge qsMaterialCost = GetRawUnitCost(material); // as we need 10+ mats, we are going to exhaust our QS charges // at this stage it isn't possible to have more than 10 QS charges qsCharges = 0; } // get the cost of our unit without any qs charges var fullMaterialCost = GetRawUnitCost(material); // cost of feed, e.g, 3000 for inf 11, 4000 for inf 12; var mainUnitFeedCost = 2000 + (infusion - 10) * 1000; // at this stage it seems unrealistic we will get more than 11,000 vet, so it's unlikely there will be any kills on our materials. var killRecycleRefund = 0; // as we use recursion for each infuse, we should only get the bonus of one here var infuseRecycleRefund = GetInfuseRecycleRefund(1); // finally we can total it all together var materialKills = fullMaterialCost.Kills * (materialQty - remainingQsCharges) + qsMaterialCost.Kills * remainingQsCharges; var materialMinerals = fullMaterialCost.Minerals * (materialQty - remainingQsCharges) + qsMaterialCost.Minerals * remainingQsCharges; var totalKillCost = materialKills + mainUnitFeedCost - infuseRecycleRefund - killRecycleRefund; return(new UnitCost(previousInfCost.Minerals + materialMinerals, previousInfCost.Kills + totalKillCost, 0)); }
public async Task <List <KeyValuePair <string, string> > > TempUnits(string fund_id) { List <KeyValuePair <string, string> > temp_units = new List <KeyValuePair <string, string> >(); if (!string.IsNullOrWhiteSpace(fund_id)) { var filter = new SearchUnitCostRequest(null); var unit = new UnitCost(); filter.fund_id = long.Parse(fund_id); HsborsResponse <List <UnitCost> > response = await unit.Search <UnitCost, SearchUnitCostRequest>(filter); var models = response.Model; foreach (var model in models) { temp_units.Add(new KeyValuePair <string, string>(model.id.ToString(), model.hsdate)); } } return(temp_units); }
public CityguardUnit() { UnitStats = new UnitStats() { Attack = 10, InfanteryDefence = 10, CavaleryDefence = 10, MagicDefence = 10, ArtillerieDefence = 10, Space = 1, FoodUsage = 2, Speed = 0, AttackStructure = 0 }; UnitCost = new UnitCost() { Wood = 100 }; ImagePath = "pack://application:,,,/Resources/Images/Units/units_cityguard.png"; Name = "Cityguard"; UnitType = UnitType.Infantery; UnitEntity = UnitEntity.Cityguard; }
public BerserkerUnit() { UnitStats = new UnitStats() { Attack = 50, InfanteryDefence = 15, CavaleryDefence = 12, MagicDefence = 10, ArtillerieDefence = 15, Space = 1, FoodUsage = 6, Speed = 20, AttackStructure = 15 }; UnitCost = new UnitCost() { Iron = 150 }; ImagePath = "pack://application:,,,/Resources/Images/Units/units_berserker.png"; Name = "Berserker"; UnitType = UnitType.Infantery; UnitEntity = UnitEntity.Berserker; }
public RangerUnit() { UnitStats = new UnitStats() { Attack = 20, InfanteryDefence = 40, CavaleryDefence = 10, MagicDefence = 25, ArtillerieDefence = 15, Space = 1, FoodUsage = 3, Speed = 20, AttackStructure = 20 }; UnitCost = new UnitCost() { Wood = 160 }; ImagePath = "pack://application:,,,/Resources/Images/Units/units_ranger.png"; Name = "Ranger"; UnitType = UnitType.Infantery; UnitEntity = UnitEntity.Ranger; }
public ScoutUnit() { UnitStats = new UnitStats() { Attack = 10, InfanteryDefence = 10, CavaleryDefence = 10, MagicDefence = 10, ArtillerieDefence = 10, Space = 2, FoodUsage = 5, Speed = 8, AttackStructure = 10 }; UnitCost = new UnitCost() { Iron = 40, Gold = 120 }; ImagePath = "pack://application:,,,/Resources/Images/Units/units_scout.png"; Name = "Scout"; UnitType = UnitType.Cavalery; UnitEntity = UnitEntity.Scout; }
public TemplarUnit() { UnitStats = new UnitStats() { Attack = 25, InfanteryDefence = 20, CavaleryDefence = 30, MagicDefence = 50, ArtillerieDefence = 15, Space = 1, FoodUsage = 3, Speed = 20, AttackStructure = 25 }; UnitCost = new UnitCost() { Iron = 90, Gold = 100 }; ImagePath = "pack://application:,,,/Resources/Images/Units/units_templar.png"; Name = "Templar"; UnitType = UnitType.Infantery; UnitEntity = UnitEntity.Templar; }
public CrossbowUnit() { UnitStats = new UnitStats() { Attack = 40, InfanteryDefence = 40, CavaleryDefence = 90, MagicDefence = 30, ArtillerieDefence = 40, Space = 2, FoodUsage = 10, Speed = 10, AttackStructure = 40 }; UnitCost = new UnitCost() { Wood = 150, Gold = 200 }; ImagePath = "pack://application:,,,/Resources/Images/Units/units_crossbow.png"; Name = "Crossbowman"; UnitType = UnitType.Cavalery; UnitEntity = UnitEntity.Crossbow; }
public PaladinUnit() { UnitStats = new UnitStats() { Attack = 60, InfanteryDefence = 50, CavaleryDefence = 20, MagicDefence = 90, ArtillerieDefence = 40, Space = 2, FoodUsage = 15, Speed = 10, AttackStructure = 60 }; UnitCost = new UnitCost() { Iron = 200, Gold = 160 }; ImagePath = "pack://application:,,,/Resources/Images/Units/units_paladin.png"; Name = "Paladin"; UnitType = UnitType.Cavalery; UnitEntity = UnitEntity.Paladin; }
public WarlockUnit() { UnitStats = new UnitStats() { Attack = 120, InfanteryDefence = 30, CavaleryDefence = 20, MagicDefence = 50, ArtillerieDefence = 40, Space = 2, FoodUsage = 20, Speed = 10, AttackStructure = 120 }; UnitCost = new UnitCost() { Iron = 100, Gold = 350 }; ImagePath = "pack://application:,,,/Resources/Images/Units/units_warlock.png"; Name = "Warlock"; UnitType = UnitType.Magic; UnitEntity = UnitEntity.Warlock; }
public MageUnit() { UnitStats = new UnitStats() { Attack = 75, InfanteryDefence = 15, CavaleryDefence = 10, MagicDefence = 30, ArtillerieDefence = 15, Space = 1, FoodUsage = 5, Speed = 20, AttackStructure = 75 }; UnitCost = new UnitCost() { Iron = 50, Gold = 150 }; ImagePath = "pack://application:,,,/Resources/Images/Units/units_mage.png"; Name = "Mage"; UnitType = UnitType.Magic; UnitEntity = UnitEntity.Mage; }
/// <summary> /// Returns Item SO details. /// </summary> /// <returns></returns> public override string ToString() { return(string.Format("Name: '{0}'; Category: '{1}'; Subcategory: '{2}', Quality: {3}; UnitCost: {4}; UnitSpace: {5}", Name, Category.Name, Subcategory.Name, Quality.ToString(), UnitCost.ToString(), UnitSpace.ToString())); }
public void Refresh() { ItemAsString = Quantity.ToString() + " " + ProductName + "," + UnitCost.ToString() + " лв всеки, крайна цена " + Subtotal.ToString() + "лв"; }
public Product ProductModel2Product() { string unitCost = UnitCost.ToString(); return(new Product(Guid, ProductId, ModelNumber, ModelName, unitCost, Description, CategoryName)); } //ProductModel2Product()
public void Refresh() { ItemAsString = Quantity.ToString() + " " + ProductName + ", $" + UnitCost.ToString() + " each, total cost $" + Subtotal.ToString(); }
public override string ToString() => $"{ModelName} ({UnitCost.ToString(CultureInfo.InvariantCulture)}";
public User UserModel2User() { string unitCost = UnitCost.ToString(); return(new User(Guid, UserId, ModelNumber, ModelName, unitCost, Description, CategoryName)); } //UserModel2User()
public override string ToString() { return($"{ModelName} ({UnitCost.ToString(CultureInfo.InvariantCulture)})"); }
public static async Task <UnitCost> GetUnitcost(this HSBorsDb db, UnitCost entity) => await db.UnitCosts.FirstOrDefaultAsync(item => (item.date == entity.date && item.fund_id == entity.fund_id) || item.id == entity.id);
public void Add(UnitCost entry) { this.context.UnitsCosts.Add(entry); }
public void Delete(UnitCost entry) { this.context.UnitsCosts.Remove(entry); }