public static CoreDataSet ToCoreDataSet(this UploadDataModel uploadDataModel) { var coreDataSet = new CoreDataSet { AgeId = uploadDataModel.AgeId, AreaCode = uploadDataModel.AreaCode, CategoryId = uploadDataModel.CategoryId, CategoryTypeId = uploadDataModel.CategoryTypeId, Count = uploadDataModel.Count, Denominator = uploadDataModel.Denominator, Denominator_2 = uploadDataModel.Denominator_2, IndicatorId = uploadDataModel.IndicatorId, LowerCi = uploadDataModel.LowerCi, Month = uploadDataModel.Month, Quarter = uploadDataModel.Quarter, SexId = uploadDataModel.SexId, Uid = uploadDataModel.Uid, UploadBatchId = uploadDataModel.UploadBatchId, UpperCi = uploadDataModel.UpperCi, Value = uploadDataModel.Value, ValueNoteId = uploadDataModel.ValueNoteId, Year = uploadDataModel.Year, YearRange = uploadDataModel.YearRange }; return coreDataSet; }
public int InsertCoreData(CoreDataSet coreDataSet, Guid uploadBatchId) { coreDataSet.UploadBatchId = uploadBatchId; return (int)CurrentSession.Save(coreDataSet); }
public void TestGetDuplicateCoreDataSetForAnIndicator() { var coreDataSet = new CoreDataSet { IndicatorId = 337, Year = 2010, YearRange = 1, Quarter = -1, Month = -1, AgeId = 4, SexId = 1, AreaCode = "5P3", CategoryTypeId = -1, CategoryId = -1 }; var result = _coreDataRepository.GetDuplicateCoreDataSetForAnIndicator(coreDataSet); Assert.IsNotNull(result); }
public IList<CoreDataSetDuplicateResponse> GetDuplicateCoreDataSetForAnIndicator(CoreDataSet data) { return CurrentSession.GetNamedQuery("Find_Duplciate_Rows_In_CoreDataSet_SP") .SetInt32("indicator_id", data.IndicatorId) .SetInt32("year", data.Year) .SetInt32("year_range", data.YearRange) .SetInt32("quarter", data.Quarter) .SetInt32("month", data.Month) .SetInt32("age_id", data.AgeId) .SetInt32("sex_id", data.SexId) .SetString("area_code", data.AreaCode) .SetInt32("category_type_id", data.CategoryTypeId) .SetInt32("category_id", data.CategoryId) .SetResultTransformer(Transformers.AliasToBean<CoreDataSetDuplicateResponse>()) .List<CoreDataSetDuplicateResponse>(); }