private string GetName() { switch (Category) { case ItemCategory.Weapon: case ItemCategory.Armor: if (CountValue == 0) { return(Master.Name); } if (CountValue < 0) { return(Master.Name + CountValue.ToString()); } return(Master.Name + "+" + CountValue.ToString()); case ItemCategory.Arrow: case ItemCategory.Rod: return(string.Format("{0}[{1}]", Master.Name, CountValue)); } return(Master.Name); }
protected override string BuildStringSTEP(ReleaseVersion release) { return(base.BuildStringSTEP(release) + "," + (release < ReleaseVersion.IFC4X3 ? ParserSTEP.DoubleToString(CountValueDouble) : CountValue.ToString()) + (release < ReleaseVersion.IFC4 ? "" : (string.IsNullOrEmpty(mFormula) ? ",$" : ",'" + ParserIfc.Encode(mFormula) + "'"))); }
private void OKButton_Click(object sender, EventArgs e) { try { Price = PriceValue; Count = Count - CountValue; Summ = Summ - SummValue; CratesCount = CratesCount - CratesCountBalue; Mass = Mass - MassValue; if (!File.Exists(Application.StartupPath + "//Raw.Residue.Data.xml")) { General.ShowErrorBox("Список продуктов сырья отсутствует!\nВозможно была потеря данных, обратитесь к администрации программы!"); } else { XmlDocument xDoc = new XmlDocument(); xDoc.Load(Application.StartupPath + "//Raw.Residue.Data.xml"); XmlElement xRoot = xDoc.DocumentElement; XmlNode childnode = xRoot.SelectSingleNode(String.Format("RawResidue[Имя='{0}']", titlebox.Text)); if (childnode != null) { XmlNode nameChildNode = childnode.SelectSingleNode("Имя"); string elemNameStr = "NONE"; if (nameChildNode != null) { elemNameStr = nameChildNode.InnerText; XmlNode massElem = childnode.SelectSingleNode("Масса"); XmlNode countElem = childnode.SelectSingleNode("Количество"); XmlNode cratesElem = childnode.SelectSingleNode("КоличествоКаробок"); XmlNode pricesElem = childnode.SelectSingleNode("Цена"); XmlNode summElem = childnode.SelectSingleNode("Сумма"); if (massElem != null && countElem != null && cratesElem != null && pricesElem != null && summElem != null) { massElem.InnerText = Mass.ToString(); countElem.InnerText = Count.ToString(); cratesElem.InnerText = CratesCount.ToString(); pricesElem.InnerText = Price.ToString(); summElem.InnerText = Summ.ToString(); } } } xDoc.Save(Application.StartupPath + "//Raw.Residue.Data.xml"); } /* * General.UpdateCellData("RawMaterialsResidue", "Цена", Price.ToString().Replace(",", "."), Convert.ToInt32(ID)); * General.UpdateCellData("RawMaterialsResidue", "Количество", Count.ToString().Replace(",", "."), Convert.ToInt32(ID)); * General.UpdateCellData("RawMaterialsResidue", "КоличествоКаробок", CratesCount.ToString().Replace(",", "."), Convert.ToInt32(ID)); * General.UpdateCellData("RawMaterialsResidue", "Масса", Mass.ToString().Replace(",", "."), Convert.ToInt32(ID)); * General.UpdateCellData("RawMaterialsResidue", "Сумма", Summ.ToString().Replace(",", "."), Convert.ToInt32(ID)); */ Date = DateControl.Value.ToString(); if (ProviderTextBox.Text != null) { Provider = ProviderTextBox.Text; } if (RecipientTextBox.Text != null) { Recipient = RecipientTextBox.Text; } RemovedRawMaterialsForm RRMF = new RemovedRawMaterialsForm(); RRMF.InsertRecords(titlebox.Text, MassValue.ToString().Replace(",", "."), PriceValue.ToString().Replace(",", "."), CountValue.ToString().Replace(",", "."), CratesCountBalue.ToString().Replace(",", "."), SummValue.ToString().Replace(",", "."), Date, Provider, Recipient); RRMF.ShowDialog(this); this.Close(); } catch (Exception) { } }
internal override void SetXML(XmlElement xml, BaseClassIfc host, HashSet <int> processed) { base.SetXML(xml, host, processed); xml.SetAttribute("CountValue", CountValue.ToString()); setAttribute(xml, "Formula", Formula); }