コード例 #1
0
ファイル: Cell_BLL.cs プロジェクト: Liam44/ExcelImport
        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
        public static bool Update(ExcelDataSet.CellsRow row)
        {
            try
            {
                CellsTableAdapter adapter = new CellsTableAdapter();

                adapter.Update(row);
                return(true);
            }
            catch
            {
                throw;
            }
        }
コード例 #3
0
ファイル: Cell_BLL.cs プロジェクト: Liam44/ExcelImport
        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;
            }
        }