/// <summary> /// This action method will be called once you click on 'Add Service Type' in Context menu in tree /// </summary> /// <param name="contractId">contractId where user wants to add new service type</param> /// <param name="nodeId">The node unique identifier.</param> /// <param name="serviceTypeId"></param> /// <param name="isEdit"></param> /// <returns> /// View /// </returns> public ActionResult ContractServiceType(long contractId, long nodeId, long serviceTypeId, bool isEdit) { ContractServiceTypeViewModel model = new ContractServiceTypeViewModel(); if (isEdit) { ContractServiceType contractServiceType = new ContractServiceType { ContractServiceTypeId = serviceTypeId, ContractId = contractId, UserName = GetLoggedInUserName() }; //Get the Name of User logged in ContractServiceType contractServiceTypeInfo = PostApiResponse <ContractServiceType>("ContractServiceType", "GetContractServiceTypeDetails", contractServiceType); model = AutoMapper.Mapper.Map <ContractServiceType, ContractServiceTypeViewModel>(contractServiceTypeInfo); } model.ContractId = contractId; model.ContractNodeId = nodeId; model.IsEdit = isEdit; return(View(model)); }
public JsonResult IsContractServiceTypeNameExit(ContractServiceTypeViewModel serviceTypeViewModel) { ContractServiceType contractServiceType = AutoMapper.Mapper.Map <ContractServiceTypeViewModel, ContractServiceType>(serviceTypeViewModel); //Get the Name of User logged in contractServiceType.UserName = GetLoggedInUserName(); return(Json(PostApiResponse <bool>(Shared.Helpers.Constants.ContractServiceType, Shared.Helpers.Constants.IsContractServiceTypeNameExit, contractServiceType))); }
public JsonResult AddEditServiceDetails(ContractServiceTypeViewModel serviceTypeViewModel) { ContractServiceType contractServiceType = AutoMapper.Mapper.Map <ContractServiceTypeViewModel, ContractServiceType>(serviceTypeViewModel); //Get the Name of User logged in contractServiceType.UserName = GetLoggedInUserName(); long contractServiceTypeId = PostApiResponse <long>("ContractServiceType", "AddEditContractServiceType", contractServiceType); LastExpandedNodeId = serviceTypeViewModel.ContractNodeId; LastHighlightedNodeId = contractServiceTypeId; return(Json(new { insertedContractServiceTypeId = contractServiceTypeId })); }