Exemplo n.º 1
0
        public JsonResult CreateHelp(ProductItemViewModel productMaster)
        {
            //OperationResult<long> createHelpResult = null;
            ActionResult actionResult = null;
            IProductDTO  helpDTO      = this.getProductDTO(productMaster, true);

            // helpDTO.ModifiedBy = this.LoggedInUserID;

            //HelpVersionWorkFlowStep workflowStep=(HelpVersionWorkFlowStep)Enum.Parse(typeof(HelpVersionWorkFlowStep), helpMaster.VersionWorkflowStep);
            //helpDTO.VersionWorkflowStep = workflowStep == HelpVersionWorkFlowStep.CHECKINANDAPPROVE ? HelpVersionWorkflowStatus.PENDINGFORAPPROVALBYCLIENTADMIN : HelpVersionWorkflowStatus.PENDINGFORAPPROVALBYSITEADMIN;

            ProductDAC producManager = new ProductDAC();
            var        result        = producManager.CreateProduct(helpDTO);

            /*if (createHelpResult != null && createHelpResult.IsValid())
             * {
             *  ProductSettings productSettings = new ProductSettings(this.ProductID, this.LoggedInSiteID, this.LanguageID, true);
             *  helpResult = helpManager.GetHelpInformation(createHelpResult.Data, productSettings, this.LoggedInUserID, HelpVersion.Default);
             *  if (helpResult != null && helpResult.IsValid())
             *  {
             *      helpDTO = helpResult.Data;
             *      HelpTreeNode helpNode = new HelpTreeNode();
             *      if (helpDTO.Title.Length > 20)
             *      {
             *          helpNode.title = helpDTO.Title.Substring(0, 18) + "..";
             *      }
             *      else
             *      {
             *          helpNode.title = helpDTO.Title;
             *      }
             *      helpNode.tooltip = helpDTO.Title;
             *      helpNode.isFolder = helpDTO.IsFolder;
             *      helpNode.key = helpDTO.HelpMasterID.ToString();
             *
             *      helpNode.prevKey = prevHelpMasterID.ToString();
             *      helpNode.absolutePath = helpDTO.HelpAbsolutePath;
             *
             *      helpNode.canEdit = helpDTO.CreatedBy == this.LoggedInUserID ||
             *                             this.UserRole == UserRole.Administrator ||
             *                             this.UserRole == UserRole.SuperClientAdministrator;
             *
             *      helpDTO = GetUserDetails(helpDTO);
             *
             *      createHelpModel.HelpMasterId = helpDTO.HelpMasterID;
             *      createHelpModel.JsonHelpTreeNode = JsonUtility.Serialize(helpNode);
             *
             *
             *
             *      finalOperationResult = OperationResult<CreateHelpModel>.CreateSuccessResult(createHelpModel);
             *      actionResult = SmartView<CreateHelpModel>(finalOperationResult);
             *  }
             *  else
             *  {
             *      finalOperationResult = OperationResult<CreateHelpModel>.CreateFailureResult("Error while getting help information.");
             *      actionResult = SmartView<CreateHelpModel>(finalOperationResult);
             *  }*/

            //}

            /*   else
             * {
             *     finalOperationResult = OperationResult<CreateHelpModel>.CreateFailureResult("Help could not be created");
             *     actionResult = SmartView<CreateHelpModel>(finalOperationResult);
             * }*/

            return(Json(true));// actionResult;
        }