public ContractsDto AddNewContractData(NewContractModel _newcontract) { ContractsDto DtoTransfer = new ContractsDto { StartDate = _newcontract.StartDate, EndDate = _newcontract.EndDate, ServiceNo = _newcontract.ServiceNo, Contract_Company = _newcontract.Contract_Company, Contract_EndUser = _newcontract.Contract_EndUser, Contract_Plan = _newcontract.Contract_Plan }; return(DtoTransfer); }
public IActionResult AddNewContract([FromBody] NewContractModel AddNewcontractRequest) { ReturnModel returnmessage = new ReturnModel(); if (!ModelState.IsValid) { return(BadRequest()); } ContractsDto NewContractData = AddNewContractData(AddNewcontractRequest); bool isValidContract = _iNewContract.AddNewContract(NewContractData); if (isValidContract != true) { return(BadRequest()); } returnmessage.Message = "New Contract Created"; var returnvalue = JsonConvert.SerializeObject(returnmessage); return(Ok(returnvalue)); }