public Statistic(DBWrapper.Entities.Statistic statistic) { StatisticId = statistic.StatisticId; Mark = statistic.Mark; RightTasks = statistic.RightTasks; UserId = statistic.UserData == null ? 270 : statistic.UserData.UserId; var db = new DbWrapper.DbWrapper(); if (statistic.TestSet != null) { TestSet = new TestSet(db.GetTestSetById(statistic.TestSet.TestSetId)); } }
public string AddStatistic(Statistic statistic, int testSetId, int userId) { try { var newStatistic = new DBWrapper.Entities.Statistic { RightTasks = statistic.RightTasks, Mark = statistic.Mark, }; _dbWrapper.AddStatistic(newStatistic, testSetId, userId); return(null); } catch (Exception e) { return(e.ToString()); } }