void OneDetailLine(int x, int y, int CostOffset, MyVoucherRow row) { const int IngredientOffset = 100; string str; str = row.VoucherID.ToString(); m_Graphics.DrawString(str, m_Font, m_Brush, x, y); str = row.StockTime.Day.ToString("d02"); m_Graphics.DrawString(str, m_Font, m_Brush, x + 88, y); decimal dCost = row.IsCostNull() ? 0m : row.Cost; str = dCost.ToString("f1"); float w = m_Graphics.MeasureString(str, m_Font).Width; m_Graphics.DrawString(str, m_Font, m_Brush, x + CostOffset + 40 - w, y); try { var dRows = row.GetVoucherDetailRows(); str = ""; foreach (var r in dRows) { if (r.IsVolumeNull()) { continue; } if (str.Length > 20) { str += "..."; break; } string name = r.IngredientRow.Name.ToString(); string vol = r.Volume.ToString(); string cost = r.Cost.ToString("f1"); if (name.Length > 8) { name = name.Substring(0, 8); } str += (" " + name + " " + vol + " (" + cost + ")"); if (str.Length < 20) { for (int k = str.Length; k < 20; k++) { str += " "; } } } } catch { } m_Graphics.DrawString(str, m_Font, m_Brush, x + IngredientOffset, y); }
public CSelectedVoucher(int i, decimal d, MyVoucherRow voucher) { id = i; cot = d; Voucher = voucher; }