internal bool Save(int worksheetId) { bool result = false; if (CellRow == null) { Id = Cell_BLL.Create(Column, Row, CurrentValue, worksheetId); CellRow = Cell_DAL.GetDataRow(Id); result = true; } else if (Included) { CellRow.Value = CurrentValue; result = Cell_DAL.Update(CellRow); } else { result = Cell_BLL.Delete(Id); } OriginalValue = CurrentValue; return(result); }
public WorkSheet(int worksheetId) { WorksheetRow = WorkSheet_DAL.GetDataRow(worksheetId); Id = worksheetId; Name = WorksheetRow.Name; WorkbookId = WorksheetRow.WorkbookId; Cells = new Dictionary <KeyValuePair <int, string>, Cell>(); foreach (int cellId in Cell_BLL.Cells(Id)) { Cell cell = new Cell(cellId); Cells.Add(new KeyValuePair <int, string>(cell.Row, cell.Column), cell); } }