Exemplo n.º 1
0
        public static int Create(string column, int row, string value, int worksheetId)
        {
            try
            {
                ExcelDataSet.CellsRow cellRow = Table.NewCellsRow();

                cellRow.Column      = column;
                cellRow.Row         = row;
                cellRow.Value       = value;
                cellRow.WorksheetId = worksheetId;

                Table.AddCellsRow(cellRow);

                if (!Cell_DAL.Update(Table))
                {
                    return(Constants.Constants.UNDEFINED_ID);
                }

                return(cellRow.Id);
            }
            catch
            {
                throw;
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public Cell(int id)
        {
            CellRow = Cell_DAL.GetDataRow(id);

            Id            = id;
            Column        = CellRow.Column;
            Row           = CellRow.Row;
            CurrentValue  = CellRow.Value;
            OriginalValue = CellRow.Value;
            WorksheetId   = CellRow.WorksheetId;
            Included      = true;
        }
Exemplo n.º 4
0
        public static bool Delete(int id)
        {
            try
            {
                ExcelDataSet.CellsRow row = Cell_DAL.GetDataRow(id);

                if (row == null)
                {
                    return(true);
                }

                row.Delete();
                return(Cell_DAL.Update(Table));
            }
            catch
            {
                throw;
            }
        }