Beispiel #1
0
 /// <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 void TestMethodOfInsert()
 {
     MSBuildLogsExtended.DALContracts.ISolutionRepository _DALInstance = MSBuildLogsExtended.LinqDAL.LinqToSqlDataAccessLayerFactorySingleton.Instance.CreateDALInstanceOfSolution();
     MSBuildLogsExtended.DataSourceEntities.Solution      _TestData    = MSBuildLogsExtended.EntityContracts.ISolutionHelper.GetDefaultValue <MSBuildLogsExtended.DataSourceEntities.Solution>();
     _DALInstance.Insert(_TestData);
     //Assert.IsTrue(_TestData.ID != 0);
 }
        public ActionResult Delete(bool isToCompareIdByIdentifierOftOfByIdentifier, System.Int32 valueToCompareIdByIdentifierOftOfByIdentifier, MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM vm, FormCollection collection)
        {
            try
            {
                log.Info(string.Format("{0}: Delete", Framework.LoggingOptions.UI_Process_Started.ToString()));
                var _Response = MSBuildLogsExtended.CommonBLLIoC.IoCSolution.ExistsOfEntityOfByIdentifier(isToCompareIdByIdentifierOftOfByIdentifier, valueToCompareIdByIdentifierOftOfByIdentifier, -1, -1, null);
                if (_Response)
                {
                    MSBuildLogsExtended.DataSourceEntities.Solution entity = vm.Item;
                    MSBuildLogsExtended.CommonBLLIoC.IoCSolution.DeleteEntity(entity);
                    log.Info(string.Format("{0}: Delete", Framework.LoggingOptions.UI_Process_Ended.ToString()));
                }
                else
                {
                    log.Warn(string.Format("{0}: Delete, Entity not exists", Framework.LoggingOptions.UI_Process_Ended.ToString()));
                }

                return(RedirectToAction("UrlStringsAlias.ActionName_Solution_Index"));
            }
            catch (Exception ex)
            {
                Framework.UIAction uiAction = Framework.UIAction.Delete;
                vm.ContentData.Title     = Framework.Resources.UIStringResource.DeleteAlternativeText;
                vm.ContentData.Summary   = MSBuildLogsExtended.Resources.UIStringResourcePerEntitySolution.Delete_Solution;
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM).FullName, uiAction.ToString(), uiAction, Framework.UIActionStatus.Failed);
                log.Error(string.Format("{0}: {1}, {2}, {3}", uiAction, Framework.LoggingOptions.UI_Process_Failed.ToString(), vm.StatusOfResult, vm.StatusMessageOfResult));

                return(View(vm));
            }
        }
        public ActionResult Edit(MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM vm)
        {
            try
            {
                log.Info(string.Format("{0}: Edit", Framework.LoggingOptions.UI_Process_Started.ToString()));

                MSBuildLogsExtended.DataSourceEntities.Solution entity = vm.Item;
                var _Response = MSBuildLogsExtended.CommonBLLIoC.IoCSolution.UpdateEntity(entity);


                log.Info(string.Format("{0}: Edit", Framework.LoggingOptions.UI_Process_Ended.ToString()));
                return(RedirectToAction(UrlStringsAlias.ActionName_Solution_Index));
            }
            catch (Exception ex)
            {
                Framework.UIAction uiAction = Framework.UIAction.Update;
                vm.ContentData.Title     = Framework.Resources.UIStringResource.EditAlternativeText;
                vm.ContentData.Summary   = MSBuildLogsExtended.Resources.UIStringResourcePerEntitySolution.Edit_Solution;
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM).FullName, uiAction.ToString(), uiAction, Framework.UIActionStatus.Failed);
                log.Error(string.Format("{0}: {1}, {2}, {3}", uiAction, Framework.LoggingOptions.UI_Process_Failed.ToString(), vm.StatusOfResult, vm.StatusMessageOfResult));

                return(View(vm));
            }
        }
        public ActionResult AddNew(MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM vm)
        {
            try
            {
                log.Info(string.Format("{0}: AddNew", Framework.LoggingOptions.UI_Process_Started.ToString()));

                MSBuildLogsExtended.DataSourceEntities.Solution entity = vm.Item;

                var _Response = MSBuildLogsExtended.CommonBLLIoC.IoCSolution.InsertEntity(entity);



                TempData[TempDataKey_SolutionController_Copy] = null;
                TempData.Remove(TempDataKey_SolutionController_Copy);
                log.Info(string.Format("{0}: Insert", Framework.LoggingOptions.UI_Process_Ended.ToString()));

                return(RedirectToAction(UrlStringsAlias.ActionName_Solution_Index));
            }
            catch (Exception ex)
            {
                Framework.UIAction uiAction = Framework.UIAction.ViewDetails;
                var entity = CreateEmptyEntityOrGetFromTempData(TempDataKey_SolutionController_Copy);
                vm = MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM.CreateNewViewModel(entity);
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM).FullName, uiAction.ToString(), uiAction, Framework.UIActionStatus.Failed);
                log.Error(string.Format("{0}: AddNew: {1}", Framework.LoggingOptions.Business_Logic_Layer_Process_Failed.ToString(), ex.Message));
                return(View(vm));
            }
        }
Beispiel #6
0
 /// <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 TestMethodOfBatchUpdate()
 {
     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);
     _DALInstance.BatchDelete(_Collection);
     Assert.IsTrue(true);
 }
Beispiel #8
0
 /// <summary>
 /// Creates the entity.
 /// </summary>
 /// <returns>a new instance of <see cref="MSBuildLogsExtended.DataSourceEntities.Solution"/></returns>
 public static MSBuildLogsExtended.DataSourceEntities.Solution CreateEntity(
     System.Int32 id
     , System.String externalParentId
     , System.String name
     , System.String description
     )
 {
     MSBuildLogsExtended.DataSourceEntities.Solution _retval = new MSBuildLogsExtended.DataSourceEntities.Solution(
         id
         , externalParentId
         , name
         , description
         );
     return(_retval);
 }
        /// <summary>
        /// Creates the entity.
        /// </summary>
        /// <returns>a new instance of <see cref="MSBuildLogsExtended.DataSourceEntities.Solution"/></returns>
        public static MSBuildLogsExtended.DataSourceEntities.Solution CreateEntity(
			System.Int32 id
			,System.String externalParentId
			,System.String name
			,System.String description
			)
        {
            MSBuildLogsExtended.DataSourceEntities.Solution _retval = new MSBuildLogsExtended.DataSourceEntities.Solution(
				id
				,externalParentId
				,name
				,description
				);
            return _retval;
        }
        /// <summary>
        /// single item insert with entity input
        /// </summary>
        /// <param name="input">to-be-inserted instance of entity class</param>
        public MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionSolution Insert(MSBuildLogsExtended.DataSourceEntities.Solution input)
        {
            log.Info(string.Format("{0}: Insert", Framework.LoggingOptions.Data_Access_Layer_Process_Started.ToString()));
            MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionSolution  _retval = new MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionSolution();
            _retval.OriginalValue = new MSBuildLogsExtended.DataSourceEntities.SolutionCollection();
            _retval.OriginalValue.Add(input);

            if (input != null)
            {
                MSBuildLogsExtended.LinqToSqlContexts.Solution _LinqItem = MSBuildLogsExtended.EntityContracts.ISolutionHelper.Clone<MSBuildLogsExtended.DataSourceEntities.Solution, MSBuildLogsExtended.LinqToSqlContexts.Solution>(input);
                this.LinqContext.Solution.InsertOnSubmit(_LinqItem);
                this.LinqContext.SubmitChanges();
                MSBuildLogsExtended.DataSourceEntities.Solution _Result = new MSBuildLogsExtended.DataSourceEntities.Solution();
                MSBuildLogsExtended.EntityContracts.ISolutionHelper.Copy<MSBuildLogsExtended.LinqToSqlContexts.Solution, MSBuildLogsExtended.DataSourceEntities.Solution>(_LinqItem, _Result);
                _retval.Result = new MSBuildLogsExtended.DataSourceEntities.SolutionCollection();
                _retval.Result.Add(_Result);
            }

            log.Info(string.Format("{0}: Insert", Framework.LoggingOptions.Data_Access_Layer_Process_Ended.ToString()));
            return _retval;
        }
        private MSBuildLogsExtended.DataSourceEntities.Solution CreateEmptyEntityOrGetFromTempData(string tempDataKey_SolutionController_Copy)
        {
            MSBuildLogsExtended.DataSourceEntities.Solution entity;
            if (TempData.ContainsKey(tempDataKey_SolutionController_Copy) && TempData[tempDataKey_SolutionController_Copy] != null)
            {
                try
                {
                    entity = (MSBuildLogsExtended.DataSourceEntities.Solution)TempData[tempDataKey_SolutionController_Copy];
                    TempData.Keep(tempDataKey_SolutionController_Copy);
                }
                catch
                {
                    entity = new MSBuildLogsExtended.DataSourceEntities.Solution();
                }
            }
            else
            {
                entity = new MSBuildLogsExtended.DataSourceEntities.Solution();
            }

            return(entity);
        }
        //
        // GET: /MSBuildLogsExtended.DataSourceEntities.Solution/Create
        public ActionResult AddNew()
        {
            ViewBag.Message = "to AddNew a new MSBuildLogsExtended.DataSourceEntities.Solution";



            MSBuildLogsExtended.DataSourceEntities.Solution entity;
            if (TempData.ContainsKey(TempDataKey_SolutionController_Copy) && TempData[TempDataKey_SolutionController_Copy] != null)
            {
				try
				{
					entity = (MSBuildLogsExtended.DataSourceEntities.Solution)TempData[TempDataKey_SolutionController_Copy];
					TempData.Keep(TempDataKey_SolutionController_Copy);
				}
				catch
				{
	                entity = new MSBuildLogsExtended.DataSourceEntities.Solution();
				}
            }
            else
            {
                entity = new MSBuildLogsExtended.DataSourceEntities.Solution();
            }

            return View(entity);
        } 
Beispiel #13
0
 /// <summary>
 /// Validates the value before save to database.
 /// </summary>
 /// <param name="item">The item.</param>
 public static void ValidateValueBeforeSaveToDatabase(MSBuildLogsExtended.DataSourceEntities.Solution item)
 {
 }
        /// <summary>
        /// single item update with entity input
        /// </summary>
        /// <param name="input">to-be-updated instance of entity class</param>
        public MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionSolution Update(MSBuildLogsExtended.DataSourceEntities.Solution input)
        {
            log.Info(string.Format("{0}: Update", Framework.LoggingOptions.Data_Access_Layer_Process_Started.ToString()));
            MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionSolution  _retval = new MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionSolution();
            _retval.OriginalValue = new MSBuildLogsExtended.DataSourceEntities.SolutionCollection();
            _retval.OriginalValue.Add(input);

            if (input != null)
            {
                MSBuildLogsExtended.LinqToSqlContexts.Solution _LinqItem = GetLinqObjectByIdentifier(input);
                if (_LinqItem != null)
                {
                    //MSBuildLogsExtended.EntityContracts.ISolutionHelper.Copy<MSBuildLogsExtended.DataSourceEntities.Solution, MSBuildLogsExtended.LinqToSqlContexts.Solution>(input, _LinqItem);
                    _LinqItem.Id = input.Id;
                    _LinqItem.ExternalParentId = input.ExternalParentId;
                    _LinqItem.Name = input.Name;
                    _LinqItem.Description = input.Description;
                    this.LinqContext.SubmitChanges();
					MSBuildLogsExtended.DataSourceEntities.Solution _Result = new MSBuildLogsExtended.DataSourceEntities.Solution();
					MSBuildLogsExtended.EntityContracts.ISolutionHelper.Copy<MSBuildLogsExtended.LinqToSqlContexts.Solution, MSBuildLogsExtended.DataSourceEntities.Solution>(_LinqItem, _Result);
					_retval.Result = new MSBuildLogsExtended.DataSourceEntities.SolutionCollection();
					_retval.Result.Add(_Result);
                }
            }
            log.Info(string.Format("{0}: Update", Framework.LoggingOptions.Data_Access_Layer_Process_Started.ToString()));
			return _retval;
        }
        /// <summary>
        /// single item delete by identifier with entity identifier input
        /// </summary>
        /// <param name="id">delete the item if its identifier equals to this parameter</param>
        public MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionSolution DeleteByIdentifier(MSBuildLogsExtended.DataSourceEntities.SolutionIdentifier id)
        {
            log.Info(string.Format("{0}: DeleteByIdentifier", Framework.LoggingOptions.Data_Access_Layer_Process_Started.ToString()));
            
			MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionSolution  _retval = new MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionSolution();

            if (id != null)
            {
                MSBuildLogsExtended.LinqToSqlContexts.Solution _LinqItem = GetLinqObjectByIdentifier(id);
                if (_LinqItem != null)
                {
					MSBuildLogsExtended.DataSourceEntities.Solution _Original = new MSBuildLogsExtended.DataSourceEntities.Solution();
					MSBuildLogsExtended.EntityContracts.ISolutionHelper.Copy<MSBuildLogsExtended.LinqToSqlContexts.Solution, MSBuildLogsExtended.DataSourceEntities.Solution>(_LinqItem, _Original);

					_retval.OriginalValue = new MSBuildLogsExtended.DataSourceEntities.SolutionCollection();
					_retval.OriginalValue.Add(_Original);

                    this.LinqContext.Solution.DeleteOnSubmit(_LinqItem);
                    this.LinqContext.SubmitChanges();
                }
            }
            log.Info(string.Format("{0}: DeleteByIdentifier", Framework.LoggingOptions.Data_Access_Layer_Process_Ended.ToString()));
			return _retval;
        }