public OperationResult Add(Row rowToAdd) { var result = new OperationResult(); try { _ctx.Rows.Insert(rowToAdd); } catch (Exception ex) { result.Success = false; result.AddMessage(ex.Message); } return result; }
public OperationResult Update(string rowNumber, Row rowToUpdate) { var result = new OperationResult(); try { var row = _ctx.Rows.FindOne(Query.EQ("Number", rowNumber)); if (row == null) { result.Success = false; result.AddMessage(string.Format("Not found", rowNumber)); return result; } row.Cells = rowToUpdate.Cells; _ctx.Rows.Save(row); } catch (Exception ex) { result.Success = false; result.AddMessage(ex.Message); } return result; }