public static string GetDisplayText(this SerieDTO serie, bool extendedVersion) { string dropSetString = ""; string repType = ""; string kgText = string.Empty; if (extendedVersion) { if (serie.Weight.HasValue) { kgText = Settings.Settings1.Default.WeightType == (int)WeightType.Kg ? ApplicationStrings.WeightType_Kg : ApplicationStrings.WeightType_Pound; } if (serie.DropSet != DropSetType.None) { dropSetString = "^" + (int)serie.DropSet; } if (serie.SetType != SetType.Normalna) { var localier = new EnumLocalizer(LocalizedPropertyGridStrings.ResourceManager); repType = localier.Translate((TrainingPlanSerieRepetitions)serie.SetType); } } double?weightDisp = null; if (serie.Weight.HasValue) { weightDisp = serie.Weight.Value.ToDisplayWeight(); } string format = string.Format("{0}x{1:#.##}", serie.RepetitionNumber, weightDisp); return(string.Format("{0}{3} {1}{2}", format, repType, dropSetString, kgText)); }
public void GenerateStockMovimentFromPurchaseDocument(List <ItemMovimentoStockDTO> pLista, FaturaDTO pDocument, string pMovimentCode) { if (pLista.Count > 0) { int doc = 12; SerieDTO _serie = ObterSerieStock(new SerieDTO(doc)); MovimentoStockDTO dto = new MovimentoStockDTO { Codigo = -1, Documento = doc, ArmazemFrom = pDocument.Armazem, DataStock = DateTime.Today, Lancamento = DateTime.Now, Operacao = pMovimentCode == "E" ? 1 : 2, Serie = _serie.Codigo, Referencia = string.Empty, Utilizador = pDocument.Utilizador, Numeracao = 0, ArmazemTo = pDocument.Armazem, FuncionarioID = pDocument.VendedorID <= 0 ? "-1" : pDocument.VendedorID.ToString(), ListaArtigo = pLista, DocumentoFrom = pDocument.Documento, DocumentID = pDocument.Codigo, Filial = pDocument.Filial, ArmazemID = pDocument.Armazem, DocumentTypeFromID = pDocument.Documento }; Gravar(dto, false); } }
public SetInfoWindow(SerieDTO serie, bool readOnly) : this() { this.serie = serie; Fill(serie); this.readOnly = readOnly; updateReadOnly(); }
public void Fill(SerieDTO serie) { txtComment.Text = serie.Comment; cmbSetType.SelectedIndex = (int)serie.SetType; chkCiezarBezSztangi.IsChecked = serie.IsCiezarBezSztangi; cmbDropSet.SelectedIndex = (int)serie.DropSet; if (serie.RepetitionNumber.HasValue && serie.IsCardio()) { txtDistance.Value = serie.RepetitionNumber.Value.ToDisplayDistance(); } chkRestPause.IsChecked = serie.IsRestPause; chkSuperSlow.IsChecked = serie.IsSuperSlow; cardioPane.SetVisible(serie.IsCardio()); panel1.SetVisible(!serie.IsCardio()); }