/// <summary> /// Assigns the enity reference Ids. /// </summary> /// <param name="input">The input.</param> public static void AssignEnityReferenceIDs(MSBuildLogsExtended.DataSourceEntities.SolutionCollection input) { for (int i = 0; i < input.Count; i++) { MSBuildLogsExtended.DataSourceEntities.Solution _Item = input[i]; } }
public ActionResult Import(HttpPostedFileBase file) { ViewBag.FileFormat = "Id,ExternalParentId,Name,Description"; if (file != null && file.ContentLength > 0 && !string.IsNullOrWhiteSpace(file.FileName)) { log.Info(string.Format("{0}: Import", Framework.LoggingOptions.UI_Process_Started.ToString())); Framework.DataStreamServiceResult dataStreamServiceResult = new Framework.DataStreamServiceResult(file.FileName, file.ContentType, file.ContentLength, file.InputStream); dataStreamServiceResult.TempFilePath = Framework.Web.WebFormApplicationApplicationVariables.FileStorageRootFolder; MSBuildLogsExtended.CommonBLL.SolutionDataStreamService dataStreamServiceProvider = new MSBuildLogsExtended.CommonBLL.SolutionDataStreamService(); MSBuildLogsExtended.DataSourceEntities.SolutionCollection collection = dataStreamServiceProvider.GetCollectionFromStream(dataStreamServiceResult); if (collection != null) { MSBuildLogsExtended.DataSourceEntities.SolutionCollection resultCollection = collection; var result = MSBuildLogsExtended.CommonBLLIoC.IoCSolution.BatchInsert(resultCollection); ViewBag.Message = Framework.Resources.UIStringResource.Data_Import_Success; } else { ViewBag.Message = Framework.Resources.UIStringResource.Data_Import_NoRecordInSourceFile; } log.Info(string.Format("{0}: Import", Framework.LoggingOptions.UI_Process_Ended.ToString())); return(View()); } else { ViewBag.Message = ""; return(View()); } }
/// <summary> /// Validates the value before save to database. /// </summary> /// <param name="input">The input.</param> public static void ValidateValueBeforeSaveToDatabase(MSBuildLogsExtended.DataSourceEntities.SolutionCollection input) { for (int i = 0; i < input.Count; i++) { MSBuildLogsExtended.DataSourceEntities.Solution _Item = input[i]; ValidateValueBeforeSaveToDatabase(_Item); } }
public void TestMethodOfBatchInsert() { MSBuildLogsExtended.DALContracts.ISolutionRepository _DALInstance = MSBuildLogsExtended.LinqDAL.LinqToSqlDataAccessLayerFactorySingleton.Instance.CreateDALInstanceOfSolution(); MSBuildLogsExtended.DataSourceEntities.Solution _TestData = MSBuildLogsExtended.EntityContracts.ISolutionHelper.GetDefaultValue <MSBuildLogsExtended.DataSourceEntities.Solution>(); MSBuildLogsExtended.DataSourceEntities.SolutionCollection _Collection = new MSBuildLogsExtended.DataSourceEntities.SolutionCollection(); _Collection.Add(_TestData); _DALInstance.BatchInsert(_Collection); //Assert.IsTrue(_TestData.ID != 0); }