public ActionResult Delete(bool isToCompareIdByIdentifierOftOfByIdentifier, System.Int64?valueToCompareIdByIdentifierOftOfByIdentifier, MSBuildExtensionPack.AspNetMvc40ViewModel.BuildItemVM vm, FormCollection collection)
        {
            try
            {
                log.Info(string.Format("{0}: Delete", Framework.LoggingOptions.UI_Process_Started.ToString()));
                var _Response = MSBuildExtensionPack.CommonBLLIoC.IoCBuild.ExistsOfDefaultOfByIdentifier(isToCompareIdByIdentifierOftOfByIdentifier, valueToCompareIdByIdentifierOftOfByIdentifier, -1, -1, null);
                if (_Response)
                {
                    MSBuildExtensionPack.DataSourceEntities.Build entity = MSBuildExtensionPack.EntityContracts.IBuildHelper.Clone <MSBuildExtensionPack.DataSourceEntities.Build.Default, MSBuildExtensionPack.DataSourceEntities.Build>(vm.Item);
                    MSBuildExtensionPack.CommonBLLIoC.IoCBuild.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_Build_Index"));
            }
            catch (Exception ex)
            {
                Framework.UIAction uiAction = Framework.UIAction.Delete;
                vm.ContentData.Title     = Framework.Resx.UIStringResource.Delete;
                vm.ContentData.Summary   = MSBuildExtensionPack.Resx.UIStringResourcePerEntityBuild.Delete_Build;
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildExtensionPack.AspNetMvc40ViewModel.BuildItemVM).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(MSBuildExtensionPack.AspNetMvc40ViewModel.BuildItemVM vm)
        {
            try
            {
                log.Info(string.Format("{0}: AddNew", Framework.LoggingOptions.UI_Process_Started.ToString()));

                MSBuildExtensionPack.DataSourceEntities.Build entity = MSBuildExtensionPack.EntityContracts.IBuildHelper.Clone <MSBuildExtensionPack.DataSourceEntities.Build.Default, MSBuildExtensionPack.DataSourceEntities.Build>(vm.Item);

                var _Response = MSBuildExtensionPack.CommonBLLIoC.IoCBuild.InsertEntity(entity);

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

                return(RedirectToAction(UrlStringsAlias.ActionName_Build_Index));
            }
            catch (Exception ex)
            {
                Framework.UIAction uiAction = Framework.UIAction.Create;
                var entity = CreateEmptyEntityOrGetFromTempData(TempDataKey_BuildController_Copy);
                vm = MSBuildExtensionPack.AspNetMvc40ViewModel.BuildItemVM.CreateNewViewModel(entity);
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildExtensionPack.AspNetMvc40ViewModel.BuildItemVM).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));
            }
        }
        public ActionResult Edit(MSBuildExtensionPack.AspNetMvc40ViewModel.BuildItemVM vm)
        {
            try
            {
                log.Info(string.Format("{0}: Edit", Framework.LoggingOptions.UI_Process_Started.ToString()));

                MSBuildExtensionPack.DataSourceEntities.Build entity = MSBuildExtensionPack.EntityContracts.IBuildHelper.Clone <MSBuildExtensionPack.DataSourceEntities.Build.Default, MSBuildExtensionPack.DataSourceEntities.Build>(vm.Item);
                var _Response = MSBuildExtensionPack.CommonBLLIoC.IoCBuild.UpdateEntity(entity);

                log.Info(string.Format("{0}: Edit", Framework.LoggingOptions.UI_Process_Ended.ToString()));
                return(RedirectToAction(UrlStringsAlias.ActionName_Build_Index));
            }
            catch (Exception ex)
            {
                Framework.UIAction uiAction = Framework.UIAction.Update;
                vm.ContentData.Title     = Framework.Resx.UIStringResource.Edit;
                vm.ContentData.Summary   = MSBuildExtensionPack.Resx.UIStringResourcePerEntityBuild.Edit_Build;
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildExtensionPack.AspNetMvc40ViewModel.BuildItemVM).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));
            }
        }
        /// <summary>
        /// delete an entity of <see cref=" MSBuildExtensionPack.DataSourceEntities.Build"/> using .net value types.
        /// http://[host]/api/BuildApi/DeleteEntity
        /// </summary>
        /// <param name="input">input entity</param>
        public async Task <MSBuildExtensionPack.CommonBLLEntities.BuildResponseMessageBuiltIn> DeleteEntityAsync(
            MSBuildExtensionPack.DataSourceEntities.Build input)
        {
            string url = GetHttpRequestUrl(ActionName_InsertEntity);

            return(await Post <MSBuildExtensionPack.DataSourceEntities.Build, MSBuildExtensionPack.CommonBLLEntities.BuildResponseMessageBuiltIn>(url, input));
        }
 /// <summary>
 /// Assigns the enity reference Ids.
 /// </summary>
 /// <param name="input">The input.</param>
 public static void AssignEnityReferenceIDs(MSBuildExtensionPack.DataSourceEntities.BuildCollection input, System.Int32 solutionId)
 {
     for (int i = 0; i < input.Count; i++)
     {
         MSBuildExtensionPack.DataSourceEntities.Build _Item = input[i];
         _Item.SolutionId = solutionId;
     }
 }
 /// <summary>
 /// Validates the value before save to database.
 /// </summary>
 /// <param name="input">The input.</param>
 public static void ValidateValueBeforeSaveToDatabase(MSBuildExtensionPack.DataSourceEntities.BuildCollection input)
 {
     for (int i = 0; i < input.Count; i++)
     {
         MSBuildExtensionPack.DataSourceEntities.Build _Item = input[i];
         ValidateValueBeforeSaveToDatabase(_Item);
     }
 }
 /// <summary>
 /// Validates the value before save to database.
 /// </summary>
 /// <param name="item">The item.</param>
 public static void ValidateValueBeforeSaveToDatabase(MSBuildExtensionPack.DataSourceEntities.Build item)
 {
     // DateTimePropertiesToMinValueOfDateTimeInSQL
     if (item.BuildStartTime < Framework.DateTimePeriodHelper.MinValueOfDateTimeInSQL)
     {
         item.BuildStartTime = Framework.DateTimePeriodHelper.MinValueOfDateTimeInSQL;
     }
 }
 /// <summary>
 /// Creates the entity.
 /// </summary>
 /// <returns>a new instance of <see cref="MSBuildExtensionPack.DataSourceEntities.Build"/></returns>
 public static MSBuildExtensionPack.DataSourceEntities.Build CreateEntity(
     System.Int64 id
     , System.Int32 solutionId
     , System.String name
     , System.String description
     , System.DateTime buildStartTime
     )
 {
     MSBuildExtensionPack.DataSourceEntities.Build _retval = new MSBuildExtensionPack.DataSourceEntities.Build(
         id
         , solutionId
         , name
         , description
         , buildStartTime
         );
     return(_retval);
 }