/// <summary> /// Deletes Contract ServiceLines and PaymentTypes /// </summary> /// <param name="contractServiceLinePaymentTypes">ContractServiceLinePaymentTypes</param> /// <returns>true/false</returns> public bool DeleteContractServiceLinesAndPaymentTypes(ContractServiceLinePaymentType contractServiceLinePaymentTypes) { //holds the response data bool returnvalue = false; // Initialize the Stored Procedure _cmd = _db.GetStoredProcCommand("DeleteServiceLinesandPaymentTypes"); // Pass parameters to Stored Procedure(i.e., @ParamName), add values for _db.AddInParameter(_cmd, "@ContractID", DbType.Int64, contractServiceLinePaymentTypes.ContractId); _db.AddInParameter(_cmd, "@ContractServiceTypeID", DbType.Int64, contractServiceLinePaymentTypes.ContractServiceTypeId); _db.AddInParameter(_cmd, "@ServiceLineTypeID", DbType.Int64, contractServiceLinePaymentTypes.ServiceLineTypeId); _db.AddInParameter(_cmd, "@PaymentTypeID", DbType.Int64, contractServiceLinePaymentTypes.PaymentTypeId); _db.AddInParameter(_cmd, "@UserName", DbType.String, contractServiceLinePaymentTypes.UserName); // Retrieve the results of the Stored Procedure in Datatable int updatedRow = _db.ExecuteNonQuery(_cmd); //returns response to Business layer if (updatedRow > 0) { returnvalue = true; } //returns false if any exception occurs return(returnvalue); }
public void DeleteContractServiceLInesandPaymentTypesByIdUnitTest() { var mockProductRepository = new Mock <IContractServiceLinePaymentTypeRepository>(); ContractServiceLinePaymentType objcontractDocs = new ContractServiceLinePaymentType { ContractId = 1 }; mockProductRepository.Setup(f => f.DeleteContractServiceLinesAndPaymentTypes(objcontractDocs)).Returns(true); ContractServiceLinePaymentTypeLogic target = new ContractServiceLinePaymentTypeLogic(mockProductRepository.Object); bool actual = target.DeleteContractServiceLinesAndPaymentTypes(objcontractDocs); Assert.AreEqual(true, actual); }
/// <summary> /// Delete Filters at either contract level or service type level /// </summary> /// <returns>Json result as true/false</returns> public JsonResult DeleteContractServiceTypeFilter(long contractserviceId, long contractId, long serviceLineTypeId, long paymentTypeId) { ContractServiceLinePaymentType contractServiceLinePaymentTypes = new ContractServiceLinePaymentType { ContractServiceTypeId = contractserviceId, ContractId = contractId, ServiceLineTypeId = serviceLineTypeId, PaymentTypeId = paymentTypeId, UserName = GetCurrentUserName() }; //Get the Name of User logged in bool isSuccess = PostApiResponse <bool>("ContractServiceLinePaymentTypes", "DeleteContractServiceLInesandPaymentTypesById", contractServiceLinePaymentTypes); return(Json(isSuccess, JsonRequestBehavior.AllowGet)); }
public bool DeleteContractServiceLInesandPaymentTypesById(ContractServiceLinePaymentType contractServiceLinePaymentTypes) { return(_contractServiceLinePaymentTypesLogic.DeleteContractServiceLinesAndPaymentTypes(contractServiceLinePaymentTypes)); }
/// <summary> /// Deletes the contract service calculate inesand payment types by unique identifier. /// </summary> /// <param name="contractServiceLinePaymentTypes">The contract service line payment types.</param> /// <returns></returns> public bool DeleteContractServiceLinesAndPaymentTypes(ContractServiceLinePaymentType contractServiceLinePaymentTypes) { return(_contractServiceLinePaymentTypesRepository.DeleteContractServiceLinesAndPaymentTypes(contractServiceLinePaymentTypes)); }