예제 #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;
            }
        }
예제 #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);
        }
예제 #3
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;
            }
        }