示例#1
0
 internal ExcelCell EnsureCell(uint column)
 {
     ExcelCell cell = GetCell(column);
     if (null == cell) {
         cell = new ExcelCell(this, null);
         cell.Column = column;
         cell.Row = Row;
         Cells.Add(cell);
     }
     return cell;
 }
示例#2
0
        public void Parse(ref string lCategory)
        {
            string tmpCategory = ParseCategory();
            if (!string.IsNullOrEmpty(tmpCategory)) {
                lCategory = tmpCategory.Replace(":", "");
            }
            OriginalCategory = lCategory;

            for (int j = 0; j < _entry.Count; ++j) {
                CellEntry cell = _entry[j];

                if (cell.Column.Equals(ColumnNames.Description)) {
                    Description = cell.Value;
                }
                else if (cell.Column.Equals(ColumnNames.Name)) {
                    Name = cell.Value;
                }
                else if (cell.Column.Equals(ColumnNames.Price)) {
                    string price = cell.Value;
                    if (!string.IsNullOrEmpty(price)) {
                        string str = price;

                        decimal lPrice = 0;
                        if (ApiUtils.TryDecimalParse(str, out lPrice)) {
                            Price = lPrice;
                            HasPrice = true;
                        }
                    }
                }
                else {
                    ExcelCell excelCell = new ExcelCell(this, cell);
                    Cells.Add(excelCell);
                    excelCell.Parse();
                }
            }

            if (OriginalCategory != null && Name != null && OriginalCategory.Contains("���������") &&
                !IsContainer(Name)) {
                Name = OriginalCategory + " " + Name;
            }
        }